From: Steven Munroe <munroesj@us.ibm.com>
To: GNU libc hacker <libc-hacker@sources.redhat.com>,
Alan Modra <amodra@bigpond.net.au>
Subject: Including libgcc_eh in bug-atexit3-lib.so build breaks powerpc
Date: Tue, 01 Aug 2006 22:24:00 -0000 [thread overview]
Message-ID: <44CFD565.8020701@us.ibm.com> (raw)
With the recent change:
2006-07-28 Ulrich Drepper <drepper@redhat.com>
* dlfcn/Makefile (LDLIBS-bug-atexit3-lib.so): Use this instead of
LDFLAGS. Add -lgcc_eh and libc_nonshared (again) to make sure we
get the __stack_chk_fail_local definition when it's needed.
we see the powerpc[32|64] make check fail when compiling with gcc-4.1.1:
/opt/biarch/gcc411-p6-test/bin/gcc -m32 -mlong-double-128 -shared
-static-libgcc -Wl,-dynamic-linker=/lib/ld.so.1 -Wl,-z,defs
-B/home/sjmunroe/work/build32-24x/csu/ -Wl,-z,combreloc -Wl,-z,relro
-Wl,--hash-style=both -L/home/sjmunroe/work/build32-24x
-L/home/sjmunroe/work/build32-24x/math
-L/home/sjmunroe/work/build32-24x/elf
-L/home/sjmunroe/work/build32-24x/dlfcn
-L/home/sjmunroe/work/build32-24x/nss
-L/home/sjmunroe/work/build32-24x/nis
-L/home/sjmunroe/work/build32-24x/rt
-L/home/sjmunroe/work/build32-24x/resolv
-L/home/sjmunroe/work/build32-24x/crypt
-L/home/sjmunroe/work/build32-24x/nptl
-Wl,-rpath-link=/home/sjmunroe/work/build32-24x:/home/sjmunroe/work/build32-24x/math:/home/sjmunroe/work/build32-24x/elf:/home/sjmunroe/work/build32-24x/dlfcn:/home/sjmunroe/work/build32-24x/nss:/home/sjmunroe/work/build32-24x/nis:/home/sjmunroe/work/build32-24x/rt:/home/sjmunroe/work/build32-24x/resolv:/home/sjmunroe/work/build32-24x/crypt:/home/sjmunroe/work/build32-24x/nptl
-o /home/sjmunroe/work/build32-24x/dlfcn/bug-atexit3-lib.so -T
/home/sjmunroe/work/build32-24x/shlib.lds
/home/sjmunroe/work/build32-24x/csu/abi-note.o
/home/sjmunroe/work/build32-24x/dlfcn/bug-atexit3-lib.os
/home/sjmunroe/work/build32-24x/libc.so
/home/sjmunroe/work/build32-24x/libc_nonshared.a -lstdc++ -lgcc_eh
/home/sjmunroe/work/build32-24x/libc_nonshared.a
/opt/biarch/gcc411-p6-test/lib/gcc/powerpc64-linux/4.1.1/libgcc_eh.a(unwind-dw2.o):(.got2+0x10):
undefined reference to `__libc_stack_end'
collect2: ld returned 1 exit status
make[2]: *** [/home/sjmunroe/work/build32-24x/dlfcn/bug-atexit3-lib.so]
Error 1
The problem is that unwind-dw2 needs __libc_stack_end to find the AUX
Vector AT_HWCAP. The HWCAP is required to check for the presence of FPU
or Altivec registers. But `__libc_stack_end' is only exported by ld.so
and ld.so is not included in this link.
The simple solution is to add "$(common-objpfx)/elf/ld.so" to the link.
However some might find a patch like the following objectionable:
diff -urN libc24-cvstip-20060731/dlfcn/Makefile libc24/dlfcn/Makefile
--- libc24-cvstip-20060731/dlfcn/Makefile 2006-07-28
12:37:26.000000000 -0500
+++ libc24/dlfcn/Makefile 2006-08-01 16:37:06.199679600 -0500
@@ -140,6 +140,7 @@
$(objpfx)bug-atexit3: $(libdl)
$(objpfx)bug-atexit3.out: $(objpfx)bug-atexit3-lib.so
$(objpfx)bug-atexit3-lib.so: $(common-objpfx)libc.so \
+ $(common-objpfx)/elf/ld.so \
$(common-objpfx)libc_nonshared.a
As it is fixing an arch specific problem in a generic part of the tree.
Unfortunately my other attempts to resolve this from powerpc specific
Makefiles have failed. For example:
diff -urN libc24-cvstip-20060731/sysdeps/powerpc/Makefile
libc24/sysdeps/powerpc/Makefile
--- libc24-cvstip-20060731/sysdeps/powerpc/Makefile 2004-02-13
21:24:52.000000000 -0600
+++ libc24/sysdeps/powerpc/Makefile 2006-08-01 15:51:50.835642272 -0500
@@ -28,3 +28,7 @@
# get offset to rtld_global._dl_hwcap
gen-as-const-headers += rtld-global-offsets.sym
endif
+
+ifeq ($(subdir),dlfcn)
+LDLIBS-bug-atexit3-lib.so += $(common-objpfx)/elf/ld.so
+endif
Has no effect.
Some guidence on the best way to resolve this would be appreciated
reply other threads:[~2006-08-01 22:24 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=44CFD565.8020701@us.ibm.com \
--to=munroesj@us.ibm.com \
--cc=amodra@bigpond.net.au \
--cc=libc-hacker@sources.redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).