diff options
author | Michael Meissner <meissner@linux.vnet.ibm.com> | 2015-06-01 22:45:17 +0000 |
---|---|---|
committer | Michael Meissner <meissner@linux.vnet.ibm.com> | 2015-06-01 22:45:17 +0000 |
commit | d30562045fc749a7c24bbf9ed2f90afdf2ff0283 (patch) | |
tree | 06b37f0a7a2b8fd0cd2482fe757a9b2916c9d655 | |
parent | 6f945c8ff081ca698e1da7b9f08d5b26cf66162f (diff) |
Initial advance-toolchain support
git-svn-id: https://gcc.gnu.org/svn/gcc/branches/ibm/gcc-5-prefixes@223998 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r-- | gcc/ChangeLog.meissner | 21 | ||||
-rw-r--r-- | gcc/config.gcc | 34 | ||||
-rw-r--r-- | gcc/config/rs6000/linux64.h | 46 | ||||
-rw-r--r-- | gcc/doc/install.texi | 5 |
4 files changed, 98 insertions, 8 deletions
diff --git a/gcc/ChangeLog.meissner b/gcc/ChangeLog.meissner index 2618defe19f..c3d8f93277e 100644 --- a/gcc/ChangeLog.meissner +++ b/gcc/ChangeLog.meissner @@ -1,4 +1,25 @@ 2015-06-01 Michael Meissner <meissner@linux.vnet.ibm.com> + * config.gcc (powerpc*-*-*): Add support for a new configure + option --with-advance-toolchain=<xxx> which overrides using the + default header files, libraries and dynamic linker. + + * config/rs6000/linux64.h (SUBSUBTARGET_EXTRA_SPECS): Add new + specs to support the configure --with-advance-toolchain=<xxx> + option. + (LINK_OS_EXTRA_SPEC32): Likewise. + (LINK_OK_EXTRA_SPEC64): Likewise. + (INCLUDE_EXTRA): Likewise. + (DYNAMIC_LINKER_PREFIX): Likewise. + (CPP_OS_DEFAULT_SPEC): Use the new specs for providing advance + toolchain support. + (GLIBC_DYNAMIC_LINKER32): Likewise. + (GLIBC_DYNAMIC_LINKER64): Likewise. + (LINK_OS_LINUX_SPEC32): Likewise. + (LINK_OS_LINUX_SPEC64): Likewise. + + * doc/install.texi (--enable-advance-toolchain=<xx>): Document new + configuration option. + Clone branch from 223994. * REVISION: New file, track subversion id. diff --git a/gcc/config.gcc b/gcc/config.gcc index e23a34c2528..31ccf423d7f 100644 --- a/gcc/config.gcc +++ b/gcc/config.gcc @@ -4044,7 +4044,7 @@ case "${target}" in ;; powerpc*-*-* | rs6000-*-*) - supported_defaults="abi cpu cpu_32 cpu_64 float tune tune_32 tune_64" + supported_defaults="abi cpu cpu_32 cpu_64 float tune tune_32 tune_64 advance_toolchain" for which in cpu cpu_32 cpu_64 tune tune_32 tune_64; do eval "val=\$with_$which" @@ -4091,6 +4091,38 @@ case "${target}" in exit 1 ;; esac + + if test "x$with_advance_toolchain" != x; then + if test -d "/opt/$with_advance_toolchain/." -a \ + -d "/opt/$with_advance_toolchain/bin/." -a \ + -d "/opt/$with_advance_toolchain/include/."; then + + tm_file="$tm_file ./advance-toolchain.h" + (at="/opt/$with_advance_toolchain"; \ + echo "#undef INCLUDE_EXTRA_SPEC"; \ + echo "#define INCLUDE_EXTRA_SPEC" \ + "\"-isystem $at/include\""; \ + echo; \ + echo "#undef LINK_OS_EXTRA_SPEC32"; \ + echo "#define LINK_OS_EXTRA_SPEC32" \ + "\"%{!static:--enable-new-dtags" \ + "-rpath $at/lib}" \ + "-L $at/lib\""; \ + echo; \ + echo "#undef LINK_OS_EXTRA_SPEC64"; \ + echo "#define LINK_OS_EXTRA_SPEC64" \ + "\"%{!static:--enable-new-dtags" \ + "-rpath $at/lib64}" \ + "-L $at/lib64\""; \ + echo; \ + echo "#undef DYNAMIC_LINKER_PREFIX"; \ + echo "#define DYNAMIC_LINKER_PREFIX \"$at\"") \ + > advance-toolchain.h + else + echo "Unknown advance-toolchain $with_advance_toolchain" + exit 1 + fi + fi ;; s390*-*-*) diff --git a/gcc/config/rs6000/linux64.h b/gcc/config/rs6000/linux64.h index bec0fd9c842..1af77cce7bf 100644 --- a/gcc/config/rs6000/linux64.h +++ b/gcc/config/rs6000/linux64.h @@ -207,7 +207,31 @@ extern int dot_symbols; { "asm_spec32", ASM_SPEC32 }, \ { "asm_spec64", ASM_SPEC64 }, \ { "link_os_linux_spec32", LINK_OS_LINUX_SPEC32 }, \ - { "link_os_linux_spec64", LINK_OS_LINUX_SPEC64 }, + { "link_os_linux_spec64", LINK_OS_LINUX_SPEC64 }, \ + { "link_os_extra_spec32", LINK_OS_EXTRA_SPEC32 }, \ + { "link_os_extra_spec64", LINK_OS_EXTRA_SPEC64 }, \ + { "include_extra", INCLUDE_EXTRA_SPEC }, \ + { "dynamic_linker_prefix", DYNAMIC_LINKER_PREFIX }, + +/* Optional specs used for overriding the system include directory, default + -rpath links, and prefix for the dynamic linker. Normally, there are not + defined, but if the user configure with the --with-advance-toolchain=<xxx> + option, the advance-toolchain.h file will override these. */ +#ifndef INCLUDE_EXTRA_SPEC +#define INCLUDE_EXTRA_SPEC "" +#endif + +#ifndef LINK_OS_EXTRA_SPEC32 +#define LINK_OS_EXTRA_SPEC32 "" +#endif + +#ifndef LINK_OS_EXTRA_SPEC64 +#define LINK_OS_EXTRA_SPEC64 "" +#endif + +#ifndef DYNAMIC_LINKER_PREFIX +#define DYNAMIC_LINKER_PREFIX "" +#endif #undef MULTILIB_DEFAULTS #if DEFAULT_ARCH64_P @@ -341,7 +365,7 @@ extern int dot_symbols; while (0) #undef CPP_OS_DEFAULT_SPEC -#define CPP_OS_DEFAULT_SPEC "%(cpp_os_linux)" +#define CPP_OS_DEFAULT_SPEC "%(cpp_os_linux) %(include_extra)" #undef LINK_SHLIB_SPEC #define LINK_SHLIB_SPEC "%{shared:-shared} %{!shared: %{static:-static}}" @@ -361,12 +385,18 @@ extern int dot_symbols; #undef LINK_OS_DEFAULT_SPEC #define LINK_OS_DEFAULT_SPEC "%(link_os_linux)" -#define GLIBC_DYNAMIC_LINKER32 "/lib/ld.so.1" +#define GLIBC_DYNAMIC_LINKER32 "%(dynamic_linker_prefix)/lib/ld.so.1" + #ifdef LINUX64_DEFAULT_ABI_ELFv2 -#define GLIBC_DYNAMIC_LINKER64 "%{mabi=elfv1:/lib64/ld64.so.1;:/lib64/ld64.so.2}" +#define GLIBC_DYNAMIC_LINKER64 \ +"%{mabi=elfv1:%(dynamic_linker_prefix)/lib64/ld64.so.1;" \ +":%(dynamic_linker_prefix)/lib64/ld64.so.2}" #else -#define GLIBC_DYNAMIC_LINKER64 "%{mabi=elfv2:/lib64/ld64.so.2;:/lib64/ld64.so.1}" +#define GLIBC_DYNAMIC_LINKER64 \ +"%{mabi=elfv2:%(dynamic_linker_prefix)/lib64/ld64.so.2;" \ +":%(dynamic_linker_prefix)/lib64/ld64.so.1}" #endif + #define UCLIBC_DYNAMIC_LINKER32 "/lib/ld-uClibc.so.0" #define UCLIBC_DYNAMIC_LINKER64 "/lib/ld64-uClibc.so.0" #if DEFAULT_LIBC == LIBC_UCLIBC @@ -402,11 +432,13 @@ extern int dot_symbols; #define LINK_OS_LINUX_SPEC32 LINK_OS_LINUX_EMUL32 " %{!shared: %{!static: \ %{rdynamic:-export-dynamic} \ - -dynamic-linker " GNU_USER_DYNAMIC_LINKER32 "}}" + -dynamic-linker " GNU_USER_DYNAMIC_LINKER32 "}} \ + %(link_os_extra_spec32)" #define LINK_OS_LINUX_SPEC64 LINK_OS_LINUX_EMUL64 " %{!shared: %{!static: \ %{rdynamic:-export-dynamic} \ - -dynamic-linker " GNU_USER_DYNAMIC_LINKER64 "}}" + -dynamic-linker " GNU_USER_DYNAMIC_LINKER64 "}} \ + %(link_os_extra_spec64)" #undef TOC_SECTION_ASM_OP #define TOC_SECTION_ASM_OP \ diff --git a/gcc/doc/install.texi b/gcc/doc/install.texi index 24c4a338282..9b29beac7da 100644 --- a/gcc/doc/install.texi +++ b/gcc/doc/install.texi @@ -1607,6 +1607,11 @@ should not be built. Specify that the compiler should use DWARF 2 debugging information as the default. +@item --enable-advance-toolchain=@var{at} +On 64-bit PowerPC Linux systems, configure the compiler to use the +header files, library files, and the dynamic linker from the Advance +Toolchain release @var{at} instead of the default versions. + @item --enable-targets=all @itemx --enable-targets=@var{target_list} Some GCC targets, e.g.@: powerpc64-linux, build bi-arch compilers. |