On Tue, Jul 5, 2011 at 7:54 PM, H.J. Lu <hjl.to...@gmail.com> wrote: >>> I'd like to start submitting a series of patches to enable x32: >>> >>> https://sites.google.com/site/x32abi/ >>> >>> The GCC x32 branch is very stable. There are no unexpected failures in >>> C, C++, Fortran and Objective C testsuites. SPEC CPU 2K/2006 compile >>> and run correctly at -O2 and -O3. >>> >>> More than 90% of changes are in x86 backend. I have submitted non-x86 >>> backend patches. Most of them have been reviewed and checked in. Only >>> 4 patches are pending for review/approval. >>> >>> This is the first x86 backend patch to support x32. By default, x32 is >>> disabled and x32 run-time support isn't required. OK for trunk? >> >> Please strip out --enable-ia32 stuff, it complicates things ATM. I >> assume that --enable-x32 applies only to 64bit targets, so this part
I think that better name of the file would be "t-linux64-x32". @@ -2631,6 +2640,7 @@ esac case ${target} in i[34567]86-*-linux* | x86_64-*-linux*) tmake_file="${tmake_file} i386/t-pmm_malloc i386/t-i386" + libgcc_tm_file="${libgcc_tm_file} i386/value-unwind.h" Not yet. @@ -58,25 +58,31 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see #if TARGET_64BIT_DEFAULT #define SPEC_32 "m32" -#define SPEC_64 "!m32" +#define SPEC_64 "m32|mx32:;" +#define SPEC_X32 "mx32" #else -#define SPEC_32 "!m64" +#define SPEC_32 "m64|mx32:;" #define SPEC_64 "m64" +#define SPEC_X32 "mx32" #endif I really think that "!(m64|mx32)" is more descriptive and clear... #undef LINK_SPEC #define LINK_SPEC "%{" SPEC_64 ":-m " GNU_USER_LINK_EMULATION64 "} \ %{" SPEC_32 ":-m " GNU_USER_LINK_EMULATION32 "} \ + %{" SPEC_X32 ":-m " GNU_USER_LINK_EMULATIONX32 "} \ %{shared:-shared} \ %{!shared: \ %{!static: \ %{rdynamic:-export-dynamic} \ %{" SPEC_32 ":-dynamic-linker " GNU_USER_DYNAMIC_LINKER32 "} \ - %{" SPEC_64 ":-dynamic-linker " GNU_USER_DYNAMIC_LINKER64 "}} \ + %{" SPEC_64 ":-dynamic-linker " GNU_USER_DYNAMIC_LINKER64 "} \ + %{" SPEC_X32 ":-dynamic-linker " GNU_USER_DYNAMIC_LINKERX32 "}} \ %{static:-static}}" On the border of bikesheding, GNU_USER_LINK_EMULATION64_X32 and GNU_USER_DYNAMIC_LINKER64_X32 sounds better to me. Same with the below: +#define GLIBC_DYNAMIC_LINKERX32 "/libx32/ld-linux-x32.so.2" +#define UCLIBC_DYNAMIC_LINKERX32 "/lib/ldx32-uClibc.so.0" +#define BIONIC_DYNAMIC_LINKERX32 "/system/bin/linkerx32" +++ b/gcc/config/i386/t-linux-x32 Please rename above file to t-linux64-x32. With above small changes, the patch looks OK to me. Please also wait for build and options maintainer (CC'd) approvals. Thanks, Uros.