[Felipe Contreras <al593181@mail.mty.itesm.mx>] bug in useldt.h
Andreas Jaeger
aj@suse.de
Wed Dec 12 06:38:00 GMT 2001
Jakub Jelinek <jakub@redhat.com> writes:
> On Wed, Dec 12, 2001 at 09:43:47AM +0100, Andreas Jaeger wrote:
>> Greg Schafer <gschafer@zip.com.au> writes:
>>
>> > Andreas Jaeger wrote:
>> >> Something like this? Felipe - and others with this problem -, please
>> >> regenerate configure (with autoconf 2.13!) and tell me whether it
>> >> looks fine in your environment.
>> >>
>> >> Ok to commit?
>> >
>> > Hi Andreas
>> >
>> > I just gave this a quick test.
>> >
>> > It fixes the first 3 linker tests but breaks the 4th ie: now it doesn't
>> > find -z combreloc (even in the normal case when glibc is already installed)
>> > and I cannot see why. No clues in config.log either.
>>
>> With -nostdlib we get no rel.dyn sections and we explicitly search for
>> them. Jakub, is the readelf call really needed?
>
> It is, because the default ld behaviour is to ignore unknown -z options.
> Wouldn't using
>
> extern int bar (void);
> int foo (void) { return bar (); }
>
> instead of current:
>
> int foo (void) { return 0; }
>
> help here?
Yes, that helps! Thanks, here's the updated patch.
Ok to commit?
Andreas
2001-12-11 Andreas Jaeger <aj@suse.de>
* configure.in: Use -nostartfiles -nostdlib for linker tests, fix
combreloc test so that it works in this case.
============================================================
Index: configure.in
--- configure.in 2001/12/06 09:17:24 1.328
+++ configure.in 2001/12/12 09:48:57
@@ -999,7 +999,9 @@ EOF
cat > conftest.c <<EOF
int _start (void) { return 42; }
EOF
- if AC_TRY_COMMAND([${CC-cc} -shared -o conftest.so conftest.c -Wl,--enable-new-dtags,-z,nodelete 1>&AC_FD_CC])
+ if AC_TRY_COMMAND([${CC-cc} -shared -o conftest.so conftest.c
+ -nostartfiles -nostdlib
+ -Wl,--enable-new-dtags,-z,nodelete 1>&AC_FD_CC])
then
libc_cv_z_nodelete=yes
else
@@ -1013,7 +1015,9 @@ EOF
cat > conftest.c <<EOF
int _start (void) { return 42; }
EOF
- if AC_TRY_COMMAND([${CC-cc} -shared -o conftest.so conftest.c -Wl,--enable-new-dtags,-z,nodlopen 1>&AC_FD_CC])
+ if AC_TRY_COMMAND([${CC-cc} -shared -o conftest.so conftest.c
+ -nostartfiles -nostdlib
+ -Wl,--enable-new-dtags,-z,nodlopen 1>&AC_FD_CC])
then
libc_cv_z_nodlopen=yes
else
@@ -1027,7 +1031,9 @@ EOF
cat > conftest.c <<EOF
int _start (void) { return 42; }
EOF
- if AC_TRY_COMMAND([${CC-cc} -shared -o conftest.so conftest.c -Wl,--enable-new-dtags,-z,initfirst 1>&AC_FD_CC])
+ if AC_TRY_COMMAND([${CC-cc} -shared -o conftest.so conftest.c
+ -nostartfiles -nostdlib
+ -Wl,--enable-new-dtags,-z,initfirst 1>&AC_FD_CC])
then
libc_cv_z_initfirst=yes
else
@@ -1053,9 +1059,12 @@ EOF
AC_CACHE_CHECK(for -z combreloc,
libc_cv_z_combreloc, [dnl
cat > conftest.c <<EOF
-int foo (void) { return 0; }
+extern int bar (void);
+int foo (void) { return bar (); }
EOF
- if AC_TRY_COMMAND([${CC-cc} -shared -o conftest.so conftest.c -Wl,-z,combreloc 1>&AC_FD_CC])
+ if AC_TRY_COMMAND([${CC-cc} -shared -o conftest.so conftest.c
+ -nostdlib -nostartfiles
+ -Wl,-z,combreloc 1>&AC_FD_CC])
then
dnl The following test is a bit weak. We must use a tool which can test
dnl cross-platform since the gcc used can be a cross compiler. Without
--
Andreas Jaeger
SuSE Labs aj@suse.de
private aj@arthur.inka.de
http://www.suse.de/~aj
More information about the Libc-alpha
mailing list