From: Ivan Maidanski Date: Mon, 9 Jun 2014 22:25:31 +0000 (+0400) Subject: Fix 'illegal option -xassembler-with-cpp' error (Oracle SunCC) X-Git-Tag: gc7_6_0~235 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=625391460ba18da2927fc17e38eec4c7cfdfab27;p=gc Fix 'illegal option -xassembler-with-cpp' error (Oracle SunCC) * Makefile.am (ASM_CPP_OPTIONS): Move comment to configure.ac. * Makefile.am (COMPILER_XLC): Rename to ASM_WITH_CPP_UNSUPPORTED. * configure.ac (COMPILER_XLC): Likewise. * configure.ac (compiler_suncc): New variable (set to "yes" if Solaris Sun C compiler). * configure.ac (ASM_WITH_CPP_UNSUPPORTED): Define not only for compiler_xlc but also for compiler_suncc. --- diff --git a/Makefile.am b/Makefile.am index 2aacca29..ce91bf07 100644 --- a/Makefile.am +++ b/Makefile.am @@ -141,14 +141,12 @@ AM_CFLAGS = @GC_CFLAGS@ ## FIXME: we shouldn't have to do this, but automake forces us to. ## We use -Wp,-P to strip #line directives. Irix `as' chokes on ## these. -if COMPILER_XLC - ## XLC neither requires nor tolerates the unnecessary assembler goop +if ASM_WITH_CPP_UNSUPPORTED ASM_CPP_OPTIONS = else - ## We use -Wp,-P to strip #line directives. Irix `as' chokes on - ## these. ASM_CPP_OPTIONS = -Wp,-P -x assembler-with-cpp endif + .s.lo: $(LTCOMPILE) $(ASM_CPP_OPTIONS) -c $< diff --git a/configure.ac b/configure.ac index 9539f0de..32982b0f 100644 --- a/configure.ac +++ b/configure.ac @@ -377,6 +377,7 @@ AM_CONDITIONAL(PTHREADS, test x$THREADS = xposix) AM_CONDITIONAL(DARWIN_THREADS, test x$darwin_threads = xtrue) AM_CONDITIONAL(WIN32_THREADS, test x$win32_threads = xtrue) +compiler_suncc=no case "$host" in powerpc-*-darwin*) powerpc_darwin=true @@ -384,6 +385,7 @@ case "$host" in *-*-solaris*) if test "$GCC" != yes; then # Solaris SunCC + compiler_suncc=yes CFLAGS="-O $CFLAGS" fi ;; @@ -414,12 +416,16 @@ AC_TRY_COMPILE([],[ #endif ], [compiler_xlc=yes], [compiler_xlc=no]) AC_MSG_RESULT($compiler_xlc) -AM_CONDITIONAL(COMPILER_XLC,test $compiler_xlc = yes) if test $compiler_xlc = yes -a "$powerpc_darwin" = true; then # the darwin stack-frame-walking code is completely broken on xlc AC_DEFINE([DARWIN_DONT_PARSE_STACK], 1, [See doc/README.macros.]) fi +# XLC neither requires nor tolerates the unnecessary assembler goop. +# Similar for the Sun C compiler. +AM_CONDITIONAL([ASM_WITH_CPP_UNSUPPORTED], + [test $compiler_xlc = yes -o $compiler_suncc = yes]) + if test "$GCC" = yes; then # Disable aliasing optimization unless forced to. AC_MSG_CHECKING([whether gcc supports -fno-strict-aliasing])