This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
[PATCH] Add sysdep-LDFLAGS prector, postctor, et al
- From: Ryan Arnold <rsa at us dot ibm dot com>
- To: libc-alpha at sourceware dot org
- Cc: roland at redhat dot com
- Date: Thu, 14 Jan 2010 15:01:57 -0600
- Subject: [PATCH] Add sysdep-LDFLAGS prector, postctor, et al
- Reply-to: rsa at us dot ibm dot com
The following patch fixes an erroneous condition where the prector,
prectorS, postctor, and postctorS do not contain the sysdep-LDFLAGS and
therefore the wrong version of crtbegin.o (and others) may be picked up.
For me this manifest during a powerpc soft-fp build of glibc where the
prector was used to find the correct beginctr.o:
`/opt/at05/bin/gcc -m32 --print-file-name=crtbegin.o`
When it should indicate:
`/opt/at05/bin/gcc -m32 -msoft-float --print-file-name=crtbegin.o`
The result is:
/opt/at05/libexec/gcc/powerpc64-linux/4.3.5/ld:
Warning: /opt/at05/lib/gcc/powerpc64-linux/4.3.5/crtbegin.o uses hard
float, /home/ryanarn/glibc/stage_476/build/glibc32_ppc476/iconv/iconvconfig uses soft float
And it ends up pointing to:
/opt/at05/lib/gcc/powerpc64-linux/4.3.5/crtbegin.o
When it should point to:
/opt/at05/lib/gcc/powerpc64-linux/4.3.5/nof/crtbegin.o
Ryan S. Arnold
IBM Linux Technology Center
2010-01-14 Ryan S. Arnold <rsa@us.ibm.com>
* Makeconfig (+prector, +postctor, +prectorS, +postctorS): Add
$(sysdep-LDFLAGS) to pre and post ctors so that the proper .o
files are found by GCC.
diff --git a/Makeconfig b/Makeconfig
index 9f134cc..15cd4ca 100644
--- a/Makeconfig
+++ b/Makeconfig
@@ -549,11 +549,11 @@ endif
ifeq ($(elf),yes)
+preinit = $(addprefix $(csu-objpfx),crti.o)
+postinit = $(addprefix $(csu-objpfx),crtn.o)
-+prector = `$(CC) --print-file-name=crtbegin.o`
-+postctor = `$(CC) --print-file-name=crtend.o`
++prector = `$(CC) $(sysdep-LDFLAGS) --print-file-name=crtbegin.o`
++postctor = `$(CC) $(sysdep-LDFLAGS) --print-file-name=crtend.o`
# Variants of the two previous definitions for linking PIE programs.
-+prectorS = `$(CC) --print-file-name=crtbeginS.o`
-+postctorS = `$(CC) --print-file-name=crtendS.o`
++prectorS = `$(CC) $(sysdep-LDFLAGS) --print-file-name=crtbeginS.o`
++postctorS = `$(CC) $(sysdep-LDFLAGS) --print-file-name=crtendS.o`
+interp = $(addprefix $(elf-objpfx),interp.os)
endif
csu-objpfx = $(common-objpfx)csu/