Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#96 Compiling error undefined reference to xdr_* on LFS 7

None
open
nobody
None
5
2014-05-09
2012-03-04
James Sefton
No

Hi,

I hope someone can spare a little time to help me figure this out.
I have a system built on LFS (so everything is built from source) and I am trying to compile quota-tools.

my initial attempt consisted of these commands:
./configure --prefix=/usr
make

That returned an error saying that it could not find rpc/rpc.h

After some research I discovered that this is likely related to the fact that RPC support was removed in a recent version of GLib in favour of using the libtirpc alternative and I should build against that instead.

So I eventually got libtirpc built. (Took me a while to satisfy its dependencies)

Running the above commands again still resulted in the same missing rpc/rpc.h errors.
Following various bits of information I managed to gather, I got past this error by passing the libtirpc's include path to the configure command.
This then got me to another error which i have been unable to work around.
Taking on board various suggestions I found around google - my configure line now looks like this:

CFLAGS="-I/usr/include/tirpc" CPPFLAGS="-I/usr/include/tirpc" XDR_CFLAGS="-I/usr/include/tirpc" LIBS="-ltirpc" ./configure --prefix=/usr
make

(I know there are probably excessive variables defined there - just making sure I don't miss something that's needed)

The problem I am now seeing is below:

cc -pie -o quotacheck quotacheck.o quotacheck_v1.o quotacheck_v2.o quotaops.o bylabel.o common.o quotasys.o pot.o quotaio.o quotaio_v1.o quotaio_v2.o quotaio_tree.o quotaio_rpc.o quotaio_xfs.o quotaio_meta.o quotaio_generic.o rquota_xdr.o rquota_client.o rquota_clnt.o -lext2fs -lcom_err
rquota_xdr.o: In function `xdr_sq_dqblk':
rquota_xdr.c:(.text+0x51): undefined reference to `xdr_u_int'
rquota_xdr.c:(.text+0x74): undefined reference to `xdr_u_int'
rquota_xdr.c:(.text+0x97): undefined reference to `xdr_u_int'
rquota_xdr.c:(.text+0xba): undefined reference to `xdr_u_int'
rquota_xdr.c:(.text+0xdd): undefined reference to `xdr_u_int'
rquota_xdr.o:rquota_xdr.c:(.text+0x100): more undefined references to `xdr_u_int' follow
rquota_xdr.o: In function `xdr_getquota_args':
rquota_xdr.c:(.text+0x525): undefined reference to `xdr_string'
rquota_xdr.c:(.text+0x545): undefined reference to `xdr_int'
rquota_xdr.o: In function `xdr_setquota_args':
rquota_xdr.c:(.text+0x57f): undefined reference to `xdr_int'
rquota_xdr.c:(.text+0x5a7): undefined reference to `xdr_string'
rquota_xdr.c:(.text+0x5c7): undefined reference to `xdr_int'
rquota_xdr.o: In function `xdr_ext_getquota_args':
rquota_xdr.c:(.text+0x629): undefined reference to `xdr_string'
rquota_xdr.c:(.text+0x649): undefined reference to `xdr_int'
rquota_xdr.c:(.text+0x669): undefined reference to `xdr_int'
rquota_xdr.o: In function `xdr_ext_setquota_args':
rquota_xdr.c:(.text+0x6a3): undefined reference to `xdr_int'
rquota_xdr.c:(.text+0x6ce): undefined reference to `xdr_string'
rquota_xdr.c:(.text+0x6ee): undefined reference to `xdr_int'
rquota_xdr.c:(.text+0x70e): undefined reference to `xdr_int'
rquota_xdr.o: In function `xdr_rquota':
rquota_xdr.c:(.text+0x799): undefined reference to `xdr_int'
rquota_xdr.c:(.text+0x7bc): undefined reference to `xdr_bool'
rquota_xdr.c:(.text+0x7df): undefined reference to `xdr_u_int'
rquota_xdr.c:(.text+0x802): undefined reference to `xdr_u_int'
rquota_xdr.c:(.text+0x825): undefined reference to `xdr_u_int'
rquota_xdr.c:(.text+0x848): undefined reference to `xdr_u_int'
rquota_xdr.c:(.text+0x86b): undefined reference to `xdr_u_int'
rquota_xdr.o:rquota_xdr.c:(.text+0x88e): more undefined references to `xdr_u_int' follow
rquota_xdr.o: In function `xdr_rquota':
rquota_xdr.c:(.text+0x9f0): undefined reference to `xdr_int'
rquota_xdr.c:(.text+0xa13): undefined reference to `xdr_bool'
rquota_xdr.c:(.text+0xa36): undefined reference to `xdr_u_int'
rquota_xdr.c:(.text+0xa59): undefined reference to `xdr_u_int'
rquota_xdr.c:(.text+0xa7c): undefined reference to `xdr_u_int'
rquota_xdr.c:(.text+0xa9f): undefined reference to `xdr_u_int'
rquota_xdr.c:(.text+0xac2): undefined reference to `xdr_u_int'
rquota_xdr.o:rquota_xdr.c:(.text+0xae5): more undefined references to `xdr_u_int' follow
rquota_xdr.o: In function `xdr_rquota':
rquota_xdr.c:(.text+0xc1a): undefined reference to `xdr_int'
rquota_xdr.c:(.text+0xc3d): undefined reference to `xdr_bool'
rquota_xdr.c:(.text+0xc60): undefined reference to `xdr_u_int'
rquota_xdr.c:(.text+0xc83): undefined reference to `xdr_u_int'
rquota_xdr.c:(.text+0xca6): undefined reference to `xdr_u_int'
rquota_xdr.c:(.text+0xcc9): undefined reference to `xdr_u_int'
rquota_xdr.c:(.text+0xcec): undefined reference to `xdr_u_int'
rquota_xdr.o:rquota_xdr.c:(.text+0xd0c): more undefined references to `xdr_u_int' follow
rquota_xdr.o: In function `xdr_qr_status':
rquota_xdr.c:(.text+0xd87): undefined reference to `xdr_enum'
rquota_client.o: In function `rpc_rquota_get':
rquota_client.c:(.text+0x443): undefined reference to `clnt_create'
rquota_client.c:(.text+0x455): undefined reference to `authunix_create_default'
rquota_client.c:(.text+0x541): undefined reference to `clnt_create'
rquota_client.c:(.text+0x553): undefined reference to `authunix_create_default'
collect2: ld returned 1 exit status
make: *** [quotacheck] Error 1

A bit of system info:-

Kernel: 2.6.33.20
Arch: i686 (as reported by uname -p and -m. uname -i reports i386)
GLib: 2.30.2

If you need any more system information, please ask.

I would very much appreciate any help that anyone can offer me with this.

James

Discussion

  • Jan Kara
    Jan Kara
    2012-03-05

    Hmm, from a quick look it seems as a discrepancy between what old rpc library provided and what new tirpc library provides. I already tried to convert quota-tools to tirpc library but I wasn't able to make some things work so I gave up after a while. I guess I should try again as using tirpc is needed also for proper ipv6 support.

     

  • Anonymous
    2012-09-30

    Are there any updates on this? I have the same issue trying to compile on latest LFS SVN. I do actually have the /usr/include/rpc directory (rpc.h, xdr.h, clnt.h etc are all present) and I still can't compile (specifically, can't link).

    My older LFS build with glibc 2.13 built the 4.0.1 release just fine. The current LFS is using glibc 2.16.

     

  • Anonymous
    2012-09-30

    Just solved this. This doesn't seem to be an issue with libtirpc. Edit the makefile to add "-ltirpc" to both the EXT2LIBS and LDFLAGS lines and it should compile. It indeed has to do with glibc dropping RPC support in 2.14.

     
  • Jan Kara
    Jan Kara
    2013-08-14

    Ticket moved from /p/linuxquota/support-requests/17/

     


Anonymous


Cancel   Add attachments