nfs.c not linking
Gedare Bloom
gedare at rtems.org
Thu Jun 4 15:47:25 UTC 2015
If you're using the RTEMS Makefiles (via $RTEMS_MAKEFILE_PATH) you can
add a lib with, for example for math,
LINK_LIBS += -lm
in your application Makefile. See for example,
examples-v2.git/benchmarks/nbench/Makefile.
If you're using some other approach to build your application you will
need to provide some details so we might guess where link libraries
would be provided for your application.
Gedare
On Thu, Jun 4, 2015 at 11:42 AM, Ben Dart <Ben.Dart at adept.com> wrote:
> Try adding "-lnfs" to the linker flags, that's what I have to do for 4.11 at least.
>
> Where exactly do you add the linker flags too? RTEMS has lots of makefiles? Where is the linking performed?
>
> Ben
>
> -----Original Message-----
> From: Nick Withers [mailto:nick.withers at anu.edu.au]
> Sent: Wednesday, June 03, 2015 4:40 PM
> To: Ben Dart
> Cc: Joel Sherrill; Gedare Bloom; users at rtems.org
> Subject: Re: nfs.c not linking
>
> On Wed, 2015-06-03 at 13:33 -0700, Ben Dart wrote:
>> When I build this I get the linking error,
>>
>> 1>../../../../../adept_5200/lib\librtemscpu.a(libshell_a-main_mount_nfs.o): In function `rtems_shell_nfs_mounter':
>> 1>d:\Subversion\rtems49\Trunk\build_5200\powerpc-rtems4.9\c\adept_5200\cpukit\libmisc/../../../../../../rtems-4.9.2/c/src/../../cpukit/libmisc/shell/main_mount_nfs.c:46: undefined reference to `rpcUdpInit'
>> 1>d:\Subversion\rtems49\Trunk\build_5200\powerpc-rtems4.9\c\adept_5200\cpukit\libmisc/../../../../../../rtems-4.9.2/c/src/../../cpukit/libmisc/shell/main_mount_nfs.c:51: undefined reference to `nfsInit'
>> 1>d:\Subversion\rtems49\Trunk\build_5200\powerpc-rtems4.9\c\adept_5200\cpukit\libmisc/../../../../../../rtems-4.9.2/c/src/../../cpukit/libmisc/shell/main_mount_nfs.c:58: undefined reference to `nfsMount'
>> 1>../../../../../adept_5200/lib\librtemscpu.a(dummy.o):(.data+0x10): undefined reference to `main'
>>
>> Important parts are these:
>>
>> In function `rtems_shell_nfs_mounter':
>> main_mount_nfs.c:46: undefined reference to `rpcUdpInit'
>> main_mount_nfs.c:51: undefined reference to `nfsInit'
>> main_mount_nfs.c:58: undefined reference to `nfsMount'
>>
>> To me this indicates that nfs.c is not being correctly linked to this file? Has there been a bug that describes this behavior? Was anyone ever able to use `mount -t nfs` in 4.9.2?
>>
>> There is a similar bug reported here:
>> http://www.aps.anl.gov/epics/tech-talk/2012/msg01030.php?format=printe
>> r But this is for 4.10 and I checked the nfs.c and other files and
>> there are no static declarations of these files.
>>
>> Is there definitely nothing else I need to do to get this working? No additions to make files to link these together correctly? Or any compiler directives?
>
> Try adding "-lnfs" to the linker flags, that's what I have to do for
> 4.11 at least.
>
>> Thanks again for your help.
>>
>> Ben
>>
>>
>> -----Original Message-----
>> From: Joel Sherrill [mailto:joel.sherrill at oarcorp.com]
>> Sent: Wednesday, June 03, 2015 8:29 AM
>> To: Gedare Bloom; Ben Dart
>> Cc: users at rtems.org
>> Subject: Re: nfs.c not linking
>>
>>
>>
>> On June 3, 2015 11:25:26 AM EDT, Gedare Bloom <gedare at rtems.org> wrote:
>> >On Wed, Jun 3, 2015 at 11:21 AM, Ben Dart <Ben.Dart at adept.com> wrote:
>> >> Hi,
>> >>
>> >>
>> >>
>> >> I am trying to build RTEMS 4.9.2 with the command line `mount`
>> >enabled for
>> >> nfs mounts. As suggested here:
>> >This version of RTEMS is not really supported by the public
>> >community, although there are probably still enough active and
>> >ex-users of it that you might get help.
>>
>> +1 this is old.
>>
>> >
>> >>
>> >https://docs.rtems.org/releases/rtemsdocs-4.9.2/share/rtems/html/shel
>> >l/
>> >shell00038.html
>> >> I have added the following to shellconfig.h:
>> >>
>> >>
>> >>
>> >> #ifdef RTEMS_NETWORKING
>> >>
>> >> #define CONFIGURE_SHELL_MOUNT_NFS
>> >>
>> >> #endif
>> >>
>> >I'm not sure what this shellconfig.h is, but you should be including
>> >this in a file your application will include before it includes
>> >confdefs.h, and then you also need to be sure to configure rtems with
>> >--enable-networking.
>>
>> Shellconfig.h is the way to configure the SRT of commands in the shell.
>>
>> >>
>> >>
>> >> This should fill rtems_shell_Mount_filesystems with the NFS mount
>> >type and
>> >> allow me to mount with NFS. Unfortunately I am unable to build. I
>> >> get linkers errors as follows:
>> >>
>> >>
>> >>
>> >>
>> >1>../../../../../adept_5200/lib\librtemscpu.a(libshell_a-main_mount_nfs.o):
>> >> In function `rtems_shell_nfs_mounter':
>> >>
>> >>
>> >1>d:\Subversion\rtems49\Trunk\build_5200\powerpc-rtems4.9\c\adept_5200\cpukit\libmisc/../../../../../../rtems-4.9.2/c/src/../../cpukit/libmisc/shell/main_mount_nfs.c:46:
>> >> undefined reference to `rpcUdpInit'
>> >>
>> >>
>> >1>d:\Subversion\rtems49\Trunk\build_5200\powerpc-rtems4.9\c\adept_5200\cpukit\libmisc/../../../../../../rtems-4.9.2/c/src/../../cpukit/libmisc/shell/main_mount_nfs.c:51:
>> >> undefined reference to `nfsInit'
>> >>
>> >>
>> >1>d:\Subversion\rtems49\Trunk\build_5200\powerpc-rtems4.9\c\adept_5200\cpukit\libmisc/../../../../../../rtems-4.9.2/c/src/../../cpukit/libmisc/shell/main_mount_nfs.c:58:
>> >> undefined reference to `nfsMount'
>> >>
>> >> 1>collect2: ld returned 1 exit status
>> >>
>> >>
>> >>
>> >> Is there something else I need to do to be able to use the ‘mount’
>> >console
>> >> command with TFTP or NFS?
>> >>
>> >>
>> >>
>> >> Ben
>> >>
>> >>
>> >> _______________________________________________
>> >> users mailing list
>> >> users at rtems.org
>> >> http://lists.rtems.org/mailman/listinfo/users
>> >_______________________________________________
>> >users mailing list
>> >users at rtems.org
>> >http://lists.rtems.org/mailman/listinfo/users
>>
>> --joel
>> _______________________________________________
>> users mailing list
>> users at rtems.org
>> http://lists.rtems.org/mailman/listinfo/users
>
>
More information about the users
mailing list