Introduce target-specific LDFLAGS, the same way we have CFLAGS for the target.
It seems to be helping gcc somewhat into telling the correct endianness to ld that sticks with little endian even when the target is big (eg armeb-unknown-linux-uclibcgnueabi).
There's still work to do, especially finish the gcc part that is not in this commit.
/trunk/scripts/functions | 9 7 2 0 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
1.1 --- a/scripts/functions Wed May 21 21:52:31 2008 +0000
1.2 +++ b/scripts/functions Wed May 21 22:00:52 2008 +0000
1.3 @@ -508,10 +508,12 @@
1.4 y,) target_endian_eb=eb
1.5 target_endian_el=
1.6 CT_ARCH_ENDIAN_CFLAG="-mbig-endian"
1.7 + CT_ARCH_ENDIAN_LDFLAG="-EB"
1.8 ;;
1.9 ,y) target_endian_eb=
1.10 target_endian_el=el
1.11 CT_ARCH_ENDIAN_CFLAG="-mlittle-endian"
1.12 + CT_ARCH_ENDIAN_LDFLAG="-EL"
1.13 ;;
1.14 esac
1.15
1.16 @@ -545,13 +547,16 @@
1.17 CT_TARGET=$(CT_DoConfigSub "${CT_TARGET_ARCH}-${CT_TARGET_VENDOR:-unknown}-${CT_TARGET_KERNEL}-${CT_TARGET_SYS}")
1.18
1.19 # Prepare the target CFLAGS
1.20 - CT_ARCH_TARGET_CFLAGS="${CT_ARCH_ARCH_CFLAG}"
1.21 + CT_ARCH_TARGET_CFLAGS="${CT_ARCH_ENDIAN_CFLAG}"
1.22 + CT_ARCH_TARGET_CFLAGS="${CT_ARCH_TARGET_CFLAGS} ${CT_ARCH_ARCH_CFLAG}"
1.23 CT_ARCH_TARGET_CFLAGS="${CT_ARCH_TARGET_CFLAGS} ${CT_ARCH_ABI_CFLAG}"
1.24 CT_ARCH_TARGET_CFLAGS="${CT_ARCH_TARGET_CFLAGS} ${CT_ARCH_CPU_CFLAG}"
1.25 CT_ARCH_TARGET_CFLAGS="${CT_ARCH_TARGET_CFLAGS} ${CT_ARCH_TUNE_CFLAG}"
1.26 CT_ARCH_TARGET_CFLAGS="${CT_ARCH_TARGET_CFLAGS} ${CT_ARCH_FPU_CFLAG}"
1.27 CT_ARCH_TARGET_CFLAGS="${CT_ARCH_TARGET_CFLAGS} ${CT_ARCH_FLOAT_CFLAG}"
1.28 - CT_ARCH_TARGET_CFLAGS="${CT_ARCH_TARGET_CFLAGS} ${CT_ARCH_ENDIAN_CFLAG}"
1.29 +
1.30 + # Now on for the target LDFLAGS
1.31 + CT_ARCH_TARGET_LDFLAGS="${CT_ARCH_ENDIAN_LDFLAG}"
1.32 }
1.33
1.34 # This function does pause the build until the user strikes "Return"