From ea847a59dc7db35e48d15faf01ca81ba982675c8 Mon Sep 17 00:00:00 2001 From: "kfraser@localhost.localdomain" Date: Wed, 18 Oct 2006 16:56:27 +0100 Subject: Clean up linker flag definitions. 1. GNU ld does not understand -m{32,64}. It must be cooked for it by the GCC driver program. 2. Where GNU ld is directly called we must use -melf_{i386,x86_64}. 3. We cannot avoid calling GNU ld directly in some cases (e.g., when specifying GNU-specific linker scripts) as on some host architectures the GCC driver is configured to call the host linker. 4. We cannot add -melf_{i386,x86_64} to LDFLAGS as the option is not recognised by GCC. Hence we define new LDFLAGS_DIRECT, to be added to the command line only when invoking GNU ld directly. Signed-off-by: Keir Fraser --- config/x86_32.mk | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'config/x86_32.mk') diff --git a/config/x86_32.mk b/config/x86_32.mk index 4db3c73b3b..7e13463326 100644 --- a/config/x86_32.mk +++ b/config/x86_32.mk @@ -7,5 +7,7 @@ CONFIG_XCUTILS := y CONFIG_IOEMU := y CFLAGS += -m32 -march=i686 -LDFLAGS += -m32 LIBDIR := lib + +# Use only if calling $(LD) directly. +LDFLAGS_DIRECT += -melf_i386 -- cgit v1.2.3