Help - Search - Members - Calendar
Full Version: Stat64 Missing In Dev_img-1.6
OESF Forums > Distros, Development, and Model Specific Forums > Everything Development > Qt/Qtopia
andrewmaier
Hi all,

I frequently seem to run into trouble when compiling software using the dev-img (1.6), While linking, I get errors related to stat64 not being available, E.g. when compiling cpio I get:

CODE
gcc  -g -O2   -o cpio  copyin.o copyout.o copypass.o defer.o dstring.o global.omain.o tar.o util.o filemode.o idcache.o makepath.o userspec.o ../lib/libcpio.a
main.o: In function `parse_opt':
/mnt/card/Documents/Develop/cpio-2.6/src/main.c:413: undefined reference to `stat64'
main.o: In function `process_args':
/mnt/card/Documents/Develop/cpio-2.6/src/main.c:594: undefined reference to `stat64'
collect2: ld returned 1 exit status
make[2]: *** [cpio] Error 1
make[2]: Leaving directory `/usr/mnt.rom/card/Documents/Develop/cpio-2.6/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/usr/mnt.rom/card/Documents/Develop/cpio-2.6'
make: *** [all] Error 2


I am sure this has been dealt with, or there is a workaround. BTW the debian arm cross-compiler package seems to have stat64 implemented, as I was able to cross compile cpio, but still I would like to compile packages natively

Any clues?

Andrew
m-morino
Hi,
QUOTE(andrewmaier @ Feb 27 2005, 10:44 PM)
I frequently seem to run into trouble when compiling software using the dev-img (1.6), While linking, I get errors related to stat64 not being available, E.g. when compiling cpio I get:
*

The compiler_setup.sh script included in the dev_img-1.6 doesn't make essential sybolic links of glibc libraries.

You have to make symlinks as follows:

CODE
$ su
# ln -s /lib/libcom_err.so.2 /usr/lib/libcom_err.so
# ln -s /lib/libcrypt.so.1 /usr/lib/libcrypt.so
# ln -s /lib/libdl.so.2 /usr/lib/libdl.so
# ln -s /lib/libnsl.so.1 /usr/lib/libnsl.so
# ln -s /lib/libnss_compat.so.2 /usr/lib/libnss_compat.so
# ln -s /lib/libnss_dns.so.2 /usr/lib/libnss_dns.so
# ln -s /lib/libnss_files.so.2 /usr/lib/libnss_files.so
# ln -s /lib/libnss_nis.so.2 /usr/lib/libnss_nis.so
# ln -s /lib/libpthread.so.0 /usr/lib/libpthread.so
# ln -s /lib/libresolv.so.2 /usr/lib/libresolv.so
# ln -s /lib/libss.so.2 /usr/lib/libss.so
# ln -s /lib/libutil.so.1 /usr/lib/libutil.so
# ln -s /lib/libuuid.so.1 /usr/lib/libuuid.so
# rm /usr/lib/libc.so
# cat > /usr/lib/libc.so << EOF
GROUP ( /lib/libc.so.6 /usr/lib/libc_nonshared.a )
EOF
# chmod 755 /usr/lib/libc.so
# ldconfig


HTH,
andrewmaier
QUOTE(m-morino @ Feb 27 2005, 04:13 PM)
Hi,
[...]
You have to make symlinks as follows:

CODE
[...]
# cat > /usr/lib/libc.so << EOF
GROUP ( /lib/libc.so.6 /usr/lib/libc_nonshared.a )
EOF

[...]


Thanks for the replay. Unfortunately, on a cacko system, /usr/lib/libc.so is on a readonly system, and therefore the cat command fails. Any way to get around this?

Thanks,

Andrew
andrewmaier
OK, following all the links, I end up that /usr/lib/libc.so is identical to /lib/libc.so.6. So what does the code below actally do? Simply append /usr/lib/libc_nonshared.a to libc.so.6?? Can this be done??

To honest I have never encountered anything like GROUP (..). What does it do?


CODE
[...]
# cat > /usr/lib/libc.so << EOF
GROUP ( /lib/libc.so.6 /usr/lib/libc_nonshared.a )
EOF



Thanks,

Andrew
m-morino
Hi,
QUOTE(andrewmaier @ Feb 28 2005, 01:10 AM)
OK, following all the links, I end up that /usr/lib/libc.so is identical to /lib/libc.so.6. So what does the code below actally do? Simply append /usr/lib/libc_nonshared.a to libc.so.6??  Can this be done??

To honest I have never encountered anything like GROUP (..). What does it do?
*

ld (linker) can be controlled by the "linker script" (see ld.info).
GROUP() command instruct the ld linker to search specified libraries for unresolved symbols repeatedly until no new undefined references are created.

It's recommended that you should put the script instead of normal symbolic link from /lib/libc.so.6. smile.gif

BTW, libc_nonshread.a literally contains non-shared libc functions.
see this Program-Library-HOWTO Document.

I don't have a detailed knowledge of the cacko system.
But I guess you can remount /(root) with r/w enabled by typing below:

CODE
$ su
# mount -o rw,remount /
# rm /usr/lib/libc.so
# cat > /usr/lib/libc.so << EOF
GROUP ( /lib/libc.so.6 /usr/lib/libc_nonshared.a )
EOF
# mount -o ro,remount /

HTH,
andrewmaier
Hi,

I feel like I am such an idiot. This morning, after a good nights sleep I (without even having to read your reply) completely understood what was going on. I was obsessed by the fact, that I somehow would have to concatenate a shared and a nonshared library, which seemed to be very bizarre for me.

What I did not know, and what I have leared is that a library can consist of a linker script.

Thank you for you kind explanation.

Andrew

BTW, everything works fine now, I can link and compile software like gnu cpio, gforth, etc
papercrane
Thanks so much for this fix. I applied it to my Z and now I can compile parted. :-)
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2014 Invision Power Services, Inc.