OESF | ELSI | pdaXrom | OpenZaurus | Zaurus Themes | Community Links | Ibiblio

IPB

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Stat64 Missing In Dev_img-1.6
andrewmaier
post Feb 27 2005, 05:44 AM
Post #1





Group: Members
Posts: 26
Joined: 8-February 04
Member No.: 370



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
Go to the top of the page
 
+Quote Post
m-morino
post Feb 27 2005, 07:13 AM
Post #2





Group: Members
Posts: 26
Joined: 15-December 04
From: Sendai, Japan
Member No.: 5,934



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,
Go to the top of the page
 
+Quote Post
andrewmaier
post Feb 27 2005, 07:56 AM
Post #3





Group: Members
Posts: 26
Joined: 8-February 04
Member No.: 370



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
Go to the top of the page
 
+Quote Post
andrewmaier
post Feb 27 2005, 08:10 AM
Post #4





Group: Members
Posts: 26
Joined: 8-February 04
Member No.: 370



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
Go to the top of the page
 
+Quote Post
m-morino
post Feb 27 2005, 07:59 PM
Post #5





Group: Members
Posts: 26
Joined: 15-December 04
From: Sendai, Japan
Member No.: 5,934



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,
Go to the top of the page
 
+Quote Post
andrewmaier
post Feb 28 2005, 02:06 AM
Post #6





Group: Members
Posts: 26
Joined: 8-February 04
Member No.: 370



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
Go to the top of the page
 
+Quote Post
papercrane
post Apr 7 2005, 12:35 PM
Post #7





Group: Members
Posts: 65
Joined: 23-February 04
From: Santa Rosa
Member No.: 1,997



Thanks so much for this fix. I applied it to my Z and now I can compile parted. :-)
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic
2 User(s) are reading this topic (2 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 25th December 2014 - 06:21 AM