diff options
author | Ivan Maidanski <ivmai@mail.ru> | 2022-07-30 09:49:11 +0300 |
---|---|---|
committer | Ivan Maidanski <ivmai@mail.ru> | 2022-07-30 09:49:11 +0300 |
commit | 56d79d8c4374eee437d3b18b414887d215a5a372 (patch) | |
tree | 5372b8ff9506907c7032cf1a990a6156378cd530 /configure.ac | |
parent | 44eaa29556120c93aa00672235755f337c02cc43 (diff) | |
download | bdwgc-56d79d8c4374eee437d3b18b414887d215a5a372.tar.gz |
Eliminate 'extension used' clang warning in sparc_mach_dep.S (configure)
A number of .S (asm) files to be compiled when targeting sparc.
Option -Wno-language-extension-token should be passed to clang to
suppress a warning about passing asm files to the compiler.
* configure.ac (compile_asm): New variable.
* configure.ac [$host==sparc-*] (compile_asm): Set to true.
* configure.ac [$compile_asm==true && $GCC==yes]
(ac_cv_lang_ext_token): Set to yes if compiler supports -Werror and
-Wno-language-extension-token options.
* configure.ac [$compile_asm==true && $ac_cv_lang_ext_token==yes
&& $GCC==yes] (CFLAGS): Append -Wno-language-extension-token.
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac index 88f85d9f..2a9e3898 100644 --- a/configure.ac +++ b/configure.ac @@ -190,6 +190,7 @@ CFLAGS="$old_CFLAGS" THREADDLLIBS= need_atomic_ops_asm=false +compile_asm=false use_parallel_mark=no use_thread_local_alloc=no # Libraries needed to support dynamic loading and/or threads. @@ -590,17 +591,21 @@ case "$host" in ;; sparc-*-netbsd*) machdep="sparc_netbsd_mach_dep.lo" + compile_asm=true ;; sparc*-*-linux* | sparc*-*-openbsd* | sparc64-*-freebsd* | sparc64-*-netbsd*) machdep="sparc_mach_dep.lo" + compile_asm=true ;; sparc-sun-solaris2.3) machdep="sparc_mach_dep.lo" + compile_asm=true AC_DEFINE(SUNOS53_SHARED_LIB, 1, [Define to work around a Solaris 5.3 bug (see dyn_load.c).]) ;; sparc*-sun-solaris2*) machdep="sparc_mach_dep.lo" + compile_asm=true ;; ia64-*-*) machdep="ia64_save_regs_in_stack.lo" @@ -611,6 +616,19 @@ addobjs="$addobjs $machdep" AC_SUBST(addobjs) AC_SUBST(addlibs) +# Suppress "extension used" clang warning (when compiling .S files). +if test x$compile_asm = xtrue -a "$GCC" = yes; then + AC_MSG_CHECKING([whether compiler supports -Wno-language-extension-token]) + old_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -Werror -Wno-language-extension-token" + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [])], + [ac_cv_lang_ext_token=yes], [ac_cv_lang_ext_token=no]) + CFLAGS="$old_CFLAGS" + AS_IF([test "$ac_cv_lang_ext_token" = yes], + [CFLAGS="$CFLAGS -Wno-language-extension-token"]) + AC_MSG_RESULT($ac_cv_lang_ext_token) +fi + dnl We use these options to decide which functions to include. AC_ARG_WITH(target-subdir, [ --with-target-subdir=SUBDIR |