nfs.c not linking

Ben Dart Ben.Dart at adept.com
Wed Jun 3 20:33:02 UTC 2015


So After the last advice I have checked the following:

1. I am compiling with --enable-networking
2. There is currently no way for us to upgrade to 4.10
3. I have added the following to shellconfig.c as per the instructions here https://docs.rtems.org/releases/rtemsdocs-4.9.2/share/rtems/html/shell/shell00038.html
	#ifdef RTEMS_NETWORKING
  		#define CONFIGURE_SHELL_MOUNT_TFTP
  		#define CONFIGURE_SHELL_MOUNT_FTP
  		#define CONFIGURE_SHELL_MOUNT_NFS
	#endif

This causes the array rtems_shell_Mount_filesystems to look like this:
	rtems_shell_filesystems_t *rtems_shell_Mount_filesystems[] = {
		&rtems_shell_Mount_TFTP,
		&rtems_shell_Mount_FTP,
		&rtems_shell_Mount_NFS,
		NULL
   	 };

All of this is desired.

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=printer 
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? 

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/shell/
>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


More information about the users mailing list