Skip to contentSkip to conversation

glibc staging puts .a files in /lib

PATCH In review Khem Raj 2 participants 3 messages May 26, 2008

lore
Share & tools
lore

Khem Raj

author
#0 lore raw

PATCH 1/1 glibc staging puts .a files in /lib

Hi

I have been seeing this problem where link would fail for libgcc when building libgcc with some weird messages like

version node not found for symbol __longjmp@@GLIBC_2.3.4

also Leon was seeing same issue on eglibc. I tracked this problem to this problem in eglibc that it was installing libc.a in $sysroot/lib where as all .a files should be in $sysroot/usr/lib then I saw that this was being done in do_stage in glibc-stage.inc

Anyway the problem was that in glibc we use install-lib and install-headers targets which does not put the /usr/lib/libc.so and /usr/lib/libpthread.so scripts. If we did use 'install' these scripts would be installed correctly.

Anyway then do_stage tries to manually generate those files and I am seeing that even in glibc these paths are not correct and .a files are copied into $sysroot/lib

The attached patch fixes it for glibc. Eglibc also needs similar fix but I decided to use make install in eglibc which makes it much easier.

OK ?

Thanks

-Khem

#

# old_revision [273d68b8b346bda4dde4800b40123921d50c6fc8]
#
# patch "packages/glibc/glibc-stage.inc"
#  from [c50ef9d6a30c9a54b38d3166f9c5c13a1535a9e6]
#    to [8abe1d7d9fd4c34d725a7f26db2110bb66ec3e16]
#
============================================================
--- packages/glibc/glibc-stage.inc	c50ef9d6a30c9a54b38d3166f9c5c13a1535a9e6
+++ packages/glibc/glibc-stage.inc	8abe1d7d9fd4c34d725a7f26db2110bb66ec3e16
@@ -16,8 +16,8 @@ do_stage() {
 		install -m 0644 ${S}/sunrpc/rpcsvc/$h ${STAGING_INCDIR}/rpcsvc/
 	done
 	for i in libc.a libc_pic.a libc_nonshared.a; do
-		install -m 0644 ${B}/$i ${STAGING_DIR_HOST}/${layout_base_libdir}/ || die "failed to install $i"
+		install -m 0644 ${B}/$i ${STAGING_DIR_HOST}/${layout_libdir}/ || die "failed to install $i"
 	done
-	echo 'GROUP ( libpthread.so.0 libpthread_nonshared.a )' > ${STAGING_DIR_HOST}/${layout_base_libdir}/libpthread.so
-	echo 'GROUP ( libc.so.6 libc_nonshared.a )' > ${STAGING_DIR_HOST}/${layout_base_libdir}/libc.so
+	echo 'GROUP ( ${layout_base_libdir}/libpthread.so.0 ${layout_libdir}/libpthread_nonshared.a )' > ${STAGING_DIR_HOST}/${layout_libdir}/libpthread.so
+	echo 'GROUP ( ${layout_base_libdir}/libc.so.6 ${layout_libdir}/libc_nonshared.a )' > ${STAGING_DIR_HOST}/${layout_libdir}/libc.so
 }
#1 lore raw

Hello Khem,

Quoted 6 lines · Khem Raj

I have been seeing this problem where link would fail for libgcc when building libgcc with some weird messages like

also Leon was seeing same issue on eglibc. I tracked this problem to

Kudos Khem! Thank you very much for investigating this; I would not have been able to track it down so quickly.

It's good to have your toolchain expertise around, very much appreciated.

Quoted 5 lines

The attached patch fixes it for glibc. Eglibc also needs similar fix but I decided to use make install in eglibc which makes it much easier.

OK ?

I just wonder why we didn't see this issue on glibc yet? Even with my machine (mpc8313e-rdb) this didn't show up earlier.
Could it be the (older) version of glibc I used?

Regards,

Signature · 1 line
Leon
author
#2 lore raw
Quoted 14 lines · Leon Woestenberg

Hello Khem,

Quoted 6 lines · Khem Raj

I have been seeing this problem where link would fail for libgcc when building libgcc with some weird messages like

also Leon was seeing same issue on eglibc. I tracked this problem to

Kudos Khem! Thank you very much for investigating this; I would not have been able to track it down so quickly.

It's good to have your toolchain expertise around, very much appreciated.

Quoted 8 lines
Quoted 5 lines

The attached patch fixes it for glibc. Eglibc also needs similar fix but I decided to use make install in eglibc which makes it much easier.

OK ?

I just wonder why we didn't see this issue on glibc yet? Even with my machine (mpc8313e-rdb) this didn't show up earlier.
Could it be the (older) version of glibc I used?

yes. The 2.6.1 glibc's libc.a does link silently. Thats why it was still working there.

Quoted 2 lines

Regards,