diff options
author | Max Filippov <jcmvbkbc@gmail.com> | 2020-04-12 23:53:32 -0700 |
---|---|---|
committer | Max Filippov <jcmvbkbc@gmail.com> | 2020-06-15 03:35:50 -0700 |
commit | 8c8eb94914c1afcac014e33def43ce329dfa314e (patch) | |
tree | 247b0573a9dc63fa160111995e68501bc19b9986 /libgcc | |
parent | f50c32fa7ab4d3bb8b8091c6d38186799b81093b (diff) | |
download | gcc-8c8eb94914c1afcac014e33def43ce329dfa314e.zip gcc-8c8eb94914c1afcac014e33def43ce329dfa314e.tar.gz gcc-8c8eb94914c1afcac014e33def43ce329dfa314e.tar.bz2 |
gcc: xtensa: add -mabi option for call0/windowed ABI
2020-06-15 Max Filippov <jcmvbkbc@gmail.com>
gcc/
* config/xtensa/elf.h (ASM_SPEC, LINK_SPEC): Pass ABI switch to
assembler/linker.
* config/xtensa/linux.h (ASM_SPEC, LINK_SPEC): Ditto.
* config/xtensa/uclinux.h (ASM_SPEC, LINK_SPEC): Ditto.
* config/xtensa/xtensa.c (xtensa_option_override): Initialize
xtensa_windowed_abi if needed.
* config/xtensa/xtensa.h (TARGET_WINDOWED_ABI_DEFAULT): New
macro.
(TARGET_WINDOWED_ABI): Redefine to xtensa_windowed_abi.
* config/xtensa/xtensa.opt (xtensa_windowed_abi): New target
option variable.
(mabi=call0, mabi=windowed): New options.
* doc/invoke.texi: Document new -mabi= Xtensa-specific options.
gcc/testsuite/
* gcc.target/xtensa/mabi-call0.c: New test.
* gcc.target/xtensa/mabi-windowed.c: New test.
libgcc/
* configure: Regenerate.
* configure.ac: Use AC_COMPILE_IFELSE instead of manual
preprocessor invocation to check for __XTENSA_CALL0_ABI__.
Diffstat (limited to 'libgcc')
-rwxr-xr-x | libgcc/configure | 24 | ||||
-rw-r--r-- | libgcc/configure.ac | 14 |
2 files changed, 17 insertions, 21 deletions
diff --git a/libgcc/configure b/libgcc/configure index 13548ca..284e4db 100755 --- a/libgcc/configure +++ b/libgcc/configure @@ -5330,19 +5330,17 @@ esac # This is after config.host so we can augment tmake_file. case ${host} in xtensa*-*) - cat > conftest.c <<EOF - #ifdef __XTENSA_CALL0_ABI__ - #error - #endif -EOF - if { ac_try='${CC-cc} -E -o conftest.i conftest.c 1>&5' - { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5 - (eval $ac_try) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; }; then - tmake_file="${tmake_file} xtensa/t-windowed" - fi + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __XTENSA_CALL0_ABI__ + #error + #endif + +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + tmake_file="${tmake_file} xtensa/t-windowed" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ;; esac diff --git a/libgcc/configure.ac b/libgcc/configure.ac index bff6e54..ef0d799 100644 --- a/libgcc/configure.ac +++ b/libgcc/configure.ac @@ -515,14 +515,12 @@ AC_SUBST(solaris_ld_v2_maps) # This is after config.host so we can augment tmake_file. case ${host} in xtensa*-*) - cat > conftest.c <<EOF - #ifdef __XTENSA_CALL0_ABI__ - #error - #endif -EOF - if AC_TRY_COMMAND(${CC-cc} -E -o conftest.i conftest.c 1>&AS_MESSAGE_LOG_FD); then - tmake_file="${tmake_file} xtensa/t-windowed" - fi + AC_COMPILE_IFELSE([AC_LANG_SOURCE( + [#ifdef __XTENSA_CALL0_ABI__ + #error + #endif + ])], + [tmake_file="${tmake_file} xtensa/t-windowed"]) ;; esac |