common/autoconf/generated-configure.sh

Print this page
rev 977 : JDK-8019470: Changes needed to compile JDK8 on MacOS with clang compiler
Reviewed-by:


4203 
4204 # Check if the VS env variables were setup prior to running configure.
4205 # If not, then find vcvarsall.bat and run it automatically, and integrate
4206 # the set env variables into the spec file.
4207 
4208 
4209 
4210 
4211 
4212 
4213 
4214 
4215 
4216 
4217 # This line needs to be here, verbatim, after all includes and the dummy hook
4218 # definitions. It is replaced with custom functionality when building
4219 # custom sources.
4220 #CUSTOM_AUTOCONF_INCLUDE
4221 
4222 # Do not change or remove the following line, it is needed for consistency checks:
4223 DATE_WHEN_GENERATED=1393327380
4224 
4225 ###############################################################################
4226 #
4227 # Initialization / Boot-strapping
4228 #
4229 # The bootstrapping process needs to solve the "chicken or the egg" problem,
4230 # thus it jumps back and forth, each time gaining something needed later on.
4231 #
4232 ###############################################################################
4233 
4234 # If we are requested to print additional help, do that and then exit.
4235 # This must be the very first call.
4236 
4237   if test "x$CONFIGURE_PRINT_TOOLCHAIN_LIST" != x; then
4238     $PRINTF "The following toolchains are available as arguments to --with-toolchain-type.\n"
4239     $PRINTF "Which are valid to use depends on the build platform.\n"
4240     for toolchain in $VALID_TOOLCHAINS_all; do
4241       # Use indirect variable referencing
4242       toolchain_var_name=TOOLCHAIN_DESCRIPTION_$toolchain
4243       TOOLCHAIN_DESCRIPTION=${!toolchain_var_name}


26269 
26270 ###############################################################################
26271 #
26272 # Setup the toolchain (compilers etc), i.e. tools used to compile and process
26273 # native code.
26274 #
26275 ###############################################################################
26276 
26277 # First determine the toolchain type (compiler family)
26278 
26279 
26280 # Check whether --with-toolchain-type was given.
26281 if test "${with_toolchain_type+set}" = set; then :
26282   withval=$with_toolchain_type;
26283 fi
26284 
26285 
26286   # Use indirect variable referencing
26287   toolchain_var_name=VALID_TOOLCHAINS_$OPENJDK_BUILD_OS
26288   VALID_TOOLCHAINS=${!toolchain_var_name}



















26289   # First toolchain type in the list is the default
26290   DEFAULT_TOOLCHAIN=${VALID_TOOLCHAINS%% *}

26291 
26292   if test "x$with_toolchain_type" = xlist; then
26293     # List all toolchains
26294     { $as_echo "$as_me:${as_lineno-$LINENO}: The following toolchains are valid on this platform:" >&5
26295 $as_echo "$as_me: The following toolchains are valid on this platform:" >&6;}
26296     for toolchain in $VALID_TOOLCHAINS; do
26297       toolchain_var_name=TOOLCHAIN_DESCRIPTION_$toolchain
26298       TOOLCHAIN_DESCRIPTION=${!toolchain_var_name}
26299       $PRINTF "  %-10s  %s\n" $toolchain "$TOOLCHAIN_DESCRIPTION"
26300     done
26301 
26302     exit 0
26303   elif test "x$with_toolchain_type" != x; then
26304     # User override; check that it is valid
26305     if test "x${VALID_TOOLCHAINS/$with_toolchain_type/}" = "x${VALID_TOOLCHAINS}"; then
26306       { $as_echo "$as_me:${as_lineno-$LINENO}: Toolchain type $with_toolchain_type is not valid on this platform." >&5
26307 $as_echo "$as_me: Toolchain type $with_toolchain_type is not valid on this platform." >&6;}
26308       { $as_echo "$as_me:${as_lineno-$LINENO}: Valid toolchains: $VALID_TOOLCHAINS." >&5
26309 $as_echo "$as_me: Valid toolchains: $VALID_TOOLCHAINS." >&6;}
26310       as_fn_error $? "Cannot continue." "$LINENO" 5


41208   if test "x$TOOLCHAIN_TYPE" = xgcc; then
41209     PICFLAG="-fPIC"
41210     C_FLAG_REORDER=''
41211     CXX_FLAG_REORDER=''
41212 
41213     if test "x$OPENJDK_TARGET_OS" = xmacosx; then
41214       # Linking is different on MacOSX
41215       SHARED_LIBRARY_FLAGS="-dynamiclib -compatibility_version 1.0.0 -current_version 1.0.0 $PICFLAG"
41216       SET_EXECUTABLE_ORIGIN='-Xlinker -rpath -Xlinker @loader_path/.'
41217       SET_SHARED_LIBRARY_ORIGIN="$SET_EXECUTABLE_ORIGIN"
41218       SET_SHARED_LIBRARY_NAME='-Xlinker -install_name -Xlinker @rpath/$1'
41219       SET_SHARED_LIBRARY_MAPFILE=''
41220     else
41221       # Default works for linux, might work on other platforms as well.
41222       SHARED_LIBRARY_FLAGS='-shared'
41223       SET_EXECUTABLE_ORIGIN='-Xlinker -rpath -Xlinker \$$$$ORIGIN$1'
41224       SET_SHARED_LIBRARY_ORIGIN="-Xlinker -z -Xlinker origin $SET_EXECUTABLE_ORIGIN"
41225       SET_SHARED_LIBRARY_NAME='-Xlinker -soname=$1'
41226       SET_SHARED_LIBRARY_MAPFILE='-Xlinker -version-script=$1'
41227     fi




















41228   elif test "x$TOOLCHAIN_TYPE" = xsolstudio; then
41229     PICFLAG="-KPIC"
41230     C_FLAG_REORDER='-xF'
41231     CXX_FLAG_REORDER='-xF'
41232     SHARED_LIBRARY_FLAGS="-G"
41233     SET_EXECUTABLE_ORIGIN='-R\$$$$ORIGIN$1'
41234     SET_SHARED_LIBRARY_ORIGIN="$SET_EXECUTABLE_ORIGIN"
41235     SET_SHARED_LIBRARY_NAME=''
41236     SET_SHARED_LIBRARY_MAPFILE='-M$1'
41237   elif test "x$TOOLCHAIN_TYPE" = xxlc; then
41238     PICFLAG="-qpic=large"
41239     C_FLAG_REORDER=''
41240     CXX_FLAG_REORDER=''
41241     SHARED_LIBRARY_FLAGS="-qmkshrobj"
41242     SET_EXECUTABLE_ORIGIN=""
41243     SET_SHARED_LIBRARY_ORIGIN=''
41244     SET_SHARED_LIBRARY_NAME=''
41245     SET_SHARED_LIBRARY_MAPFILE=''
41246   elif test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
41247     PICFLAG=""


41269   fi
41270   # The (cross) compiler is now configured, we can now test capabilities
41271   # of the target platform.
41272 
41273 
41274 
41275   ###############################################################################
41276   #
41277   # Setup the opt flags for different compilers
41278   # and different operating systems.
41279   #
41280 
41281   # FIXME: this was indirectly the old default, but just inherited.
41282   # if test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
41283   #   C_FLAG_DEPS="-MMD -MF"
41284   # fi
41285 
41286   # Generate make dependency files
41287   if test "x$TOOLCHAIN_TYPE" = xgcc; then
41288     C_FLAG_DEPS="-MMD -MF"


41289   elif test "x$TOOLCHAIN_TYPE" = xsolstudio; then
41290     C_FLAG_DEPS="-xMMD -xMF"
41291   elif test "x$TOOLCHAIN_TYPE" = xxlc; then
41292     C_FLAG_DEPS="-qmakedep=gcc -MF"
41293   fi
41294   CXX_FLAG_DEPS="$C_FLAG_DEPS"
41295 
41296 
41297 
41298   # Debug symbols
41299   if test "x$TOOLCHAIN_TYPE" = xgcc; then
41300     if test "x$OPENJDK_TARGET_CPU_BITS" = "x64" && test "x$DEBUG_LEVEL" = "xfastdebug"; then
41301       CFLAGS_DEBUG_SYMBOLS="-g1"
41302       CXXFLAGS_DEBUG_SYMBOLS="-g1"
41303     else
41304       CFLAGS_DEBUG_SYMBOLS="-g"
41305       CXXFLAGS_DEBUG_SYMBOLS="-g"
41306     fi



41307   elif test "x$TOOLCHAIN_TYPE" = xsolstudio; then
41308     CFLAGS_DEBUG_SYMBOLS="-g -xs"
41309     CXXFLAGS_DEBUG_SYMBOLS="-g0 -xs"
41310   elif test "x$TOOLCHAIN_TYPE" = xxlc; then
41311     CFLAGS_DEBUG_SYMBOLS="-g"
41312     CXXFLAGS_DEBUG_SYMBOLS="-g"
41313   fi
41314 
41315 
41316 
41317   # Optimization levels
41318   if test "x$TOOLCHAIN_TYPE" = xsolstudio; then
41319     CC_HIGHEST="$CC_HIGHEST -fns -fsimple -fsingle -xalias_level=basic -xbuiltin=%all -xdepend -xrestrict -xlibmil"
41320 
41321     if test "x$OPENJDK_TARGET_CPU_ARCH" = "xx86"; then
41322       # FIXME: seems we always set -xregs=no%frameptr; put it elsewhere more global?
41323       C_O_FLAG_HIGHEST="-xO4 -Wu,-O4~yz $CC_HIGHEST -xregs=no%frameptr"
41324       C_O_FLAG_HI="-xO4 -Wu,-O4~yz -xregs=no%frameptr"
41325       C_O_FLAG_NORM="-xO2 -Wu,-O2~yz -xregs=no%frameptr"
41326       C_O_FLAG_NONE="-xregs=no%frameptr"


41329       CXX_O_FLAG_NORM="-xO2 -Qoption ube -O2~yz -xregs=no%frameptr"
41330       CXX_O_FLAG_NONE="-xregs=no%frameptr"
41331       if test "x$OPENJDK_TARGET_CPU_BITS" = "x32"; then
41332         C_O_FLAG_HIGHEST="$C_O_FLAG_HIGHEST -xchip=pentium"
41333         CXX_O_FLAG_HIGHEST="$CXX_O_FLAG_HIGHEST -xchip=pentium"
41334       fi
41335     elif test "x$OPENJDK_TARGET_CPU_ARCH" = "xsparc"; then
41336       C_O_FLAG_HIGHEST="-xO4 -Wc,-Qrm-s -Wc,-Qiselect-T0 $CC_HIGHEST -xprefetch=auto,explicit -xchip=ultra"
41337       C_O_FLAG_HI="-xO4 -Wc,-Qrm-s -Wc,-Qiselect-T0"
41338       C_O_FLAG_NORM="-xO2 -Wc,-Qrm-s -Wc,-Qiselect-T0"
41339       C_O_FLAG_NONE=""
41340       CXX_O_FLAG_HIGHEST="-xO4 -Qoption cg -Qrm-s -Qoption cg -Qiselect-T0 $CC_HIGHEST -xprefetch=auto,explicit -xchip=ultra"
41341       CXX_O_FLAG_HI="-xO4 -Qoption cg -Qrm-s -Qoption cg -Qiselect-T0"
41342       CXX_O_FLAG_NORM="-xO2 -Qoption cg -Qrm-s -Qoption cg -Qiselect-T0"
41343       CXX_O_FLAG_NONE=""
41344     fi
41345   else
41346     # The remaining toolchains share opt flags between CC and CXX;
41347     # setup for C and duplicate afterwards.
41348     if test "x$TOOLCHAIN_TYPE" = xgcc; then














41349       if test "x$OPENJDK_TARGET_OS" = xmacosx; then
41350         # On MacOSX we optimize for size, something
41351         # we should do for all platforms?
41352         C_O_FLAG_HIGHEST="-Os"
41353         C_O_FLAG_HI="-Os"
41354         C_O_FLAG_NORM="-Os"
41355         C_O_FLAG_NONE=""
41356       else
41357         C_O_FLAG_HIGHEST="-O3"
41358         C_O_FLAG_HI="-O3"
41359         C_O_FLAG_NORM="-O2"
41360         C_O_FLAG_NONE="-O0"
41361       fi
41362     elif test "x$TOOLCHAIN_TYPE" = xxlc; then
41363       C_O_FLAG_HIGHEST="-O3"
41364       C_O_FLAG_HI="-O3 -qstrict"
41365       C_O_FLAG_NORM="-O2"
41366       C_O_FLAG_NONE=""
41367     elif test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
41368       C_O_FLAG_HIGHEST="-O2"




4203 
4204 # Check if the VS env variables were setup prior to running configure.
4205 # If not, then find vcvarsall.bat and run it automatically, and integrate
4206 # the set env variables into the spec file.
4207 
4208 
4209 
4210 
4211 
4212 
4213 
4214 
4215 
4216 
4217 # This line needs to be here, verbatim, after all includes and the dummy hook
4218 # definitions. It is replaced with custom functionality when building
4219 # custom sources.
4220 #CUSTOM_AUTOCONF_INCLUDE
4221 
4222 # Do not change or remove the following line, it is needed for consistency checks:
4223 DATE_WHEN_GENERATED=1393396458
4224 
4225 ###############################################################################
4226 #
4227 # Initialization / Boot-strapping
4228 #
4229 # The bootstrapping process needs to solve the "chicken or the egg" problem,
4230 # thus it jumps back and forth, each time gaining something needed later on.
4231 #
4232 ###############################################################################
4233 
4234 # If we are requested to print additional help, do that and then exit.
4235 # This must be the very first call.
4236 
4237   if test "x$CONFIGURE_PRINT_TOOLCHAIN_LIST" != x; then
4238     $PRINTF "The following toolchains are available as arguments to --with-toolchain-type.\n"
4239     $PRINTF "Which are valid to use depends on the build platform.\n"
4240     for toolchain in $VALID_TOOLCHAINS_all; do
4241       # Use indirect variable referencing
4242       toolchain_var_name=TOOLCHAIN_DESCRIPTION_$toolchain
4243       TOOLCHAIN_DESCRIPTION=${!toolchain_var_name}


26269 
26270 ###############################################################################
26271 #
26272 # Setup the toolchain (compilers etc), i.e. tools used to compile and process
26273 # native code.
26274 #
26275 ###############################################################################
26276 
26277 # First determine the toolchain type (compiler family)
26278 
26279 
26280 # Check whether --with-toolchain-type was given.
26281 if test "${with_toolchain_type+set}" = set; then :
26282   withval=$with_toolchain_type;
26283 fi
26284 
26285 
26286   # Use indirect variable referencing
26287   toolchain_var_name=VALID_TOOLCHAINS_$OPENJDK_BUILD_OS
26288   VALID_TOOLCHAINS=${!toolchain_var_name}
26289 
26290   if test "x$OPENJDK_TARGET_OS" = xmacosx; then
26291     # On Mac OS X, default toolchain to clang after Xcode 5
26292     XCODE_VERSION_OUTPUT=`xcodebuild -version 2>&1 | $HEAD -n 1`
26293     $ECHO "$XCODE_VERSION_OUTPUT" | $GREP "Xcode " > /dev/null
26294     if test $? -ne 0; then
26295       as_fn_error $? "Failed to determine Xcode version." "$LINENO" 5
26296     fi
26297     XCODE_MAJOR_VERSION=`$ECHO $XCODE_VERSION_OUTPUT | \
26298         $SED -e 's/^Xcode \([1-9][0-9.]*\)/\1/' | \
26299         $CUT -f 1 -d .`
26300     { $as_echo "$as_me:${as_lineno-$LINENO}: Xcode major version: $XCODE_MAJOR_VERSION" >&5
26301 $as_echo "$as_me: Xcode major version: $XCODE_MAJOR_VERSION" >&6;}
26302     if test $XCODE_MAJOR_VERSION -ge 5; then
26303         DEFAULT_TOOLCHAIN="clang"
26304     else
26305         DEFAULT_TOOLCHAIN="gcc"
26306     fi
26307   else
26308     # First toolchain type in the list is the default
26309     DEFAULT_TOOLCHAIN=${VALID_TOOLCHAINS%% *}
26310   fi
26311 
26312   if test "x$with_toolchain_type" = xlist; then
26313     # List all toolchains
26314     { $as_echo "$as_me:${as_lineno-$LINENO}: The following toolchains are valid on this platform:" >&5
26315 $as_echo "$as_me: The following toolchains are valid on this platform:" >&6;}
26316     for toolchain in $VALID_TOOLCHAINS; do
26317       toolchain_var_name=TOOLCHAIN_DESCRIPTION_$toolchain
26318       TOOLCHAIN_DESCRIPTION=${!toolchain_var_name}
26319       $PRINTF "  %-10s  %s\n" $toolchain "$TOOLCHAIN_DESCRIPTION"
26320     done
26321 
26322     exit 0
26323   elif test "x$with_toolchain_type" != x; then
26324     # User override; check that it is valid
26325     if test "x${VALID_TOOLCHAINS/$with_toolchain_type/}" = "x${VALID_TOOLCHAINS}"; then
26326       { $as_echo "$as_me:${as_lineno-$LINENO}: Toolchain type $with_toolchain_type is not valid on this platform." >&5
26327 $as_echo "$as_me: Toolchain type $with_toolchain_type is not valid on this platform." >&6;}
26328       { $as_echo "$as_me:${as_lineno-$LINENO}: Valid toolchains: $VALID_TOOLCHAINS." >&5
26329 $as_echo "$as_me: Valid toolchains: $VALID_TOOLCHAINS." >&6;}
26330       as_fn_error $? "Cannot continue." "$LINENO" 5


41228   if test "x$TOOLCHAIN_TYPE" = xgcc; then
41229     PICFLAG="-fPIC"
41230     C_FLAG_REORDER=''
41231     CXX_FLAG_REORDER=''
41232 
41233     if test "x$OPENJDK_TARGET_OS" = xmacosx; then
41234       # Linking is different on MacOSX
41235       SHARED_LIBRARY_FLAGS="-dynamiclib -compatibility_version 1.0.0 -current_version 1.0.0 $PICFLAG"
41236       SET_EXECUTABLE_ORIGIN='-Xlinker -rpath -Xlinker @loader_path/.'
41237       SET_SHARED_LIBRARY_ORIGIN="$SET_EXECUTABLE_ORIGIN"
41238       SET_SHARED_LIBRARY_NAME='-Xlinker -install_name -Xlinker @rpath/$1'
41239       SET_SHARED_LIBRARY_MAPFILE=''
41240     else
41241       # Default works for linux, might work on other platforms as well.
41242       SHARED_LIBRARY_FLAGS='-shared'
41243       SET_EXECUTABLE_ORIGIN='-Xlinker -rpath -Xlinker \$$$$ORIGIN$1'
41244       SET_SHARED_LIBRARY_ORIGIN="-Xlinker -z -Xlinker origin $SET_EXECUTABLE_ORIGIN"
41245       SET_SHARED_LIBRARY_NAME='-Xlinker -soname=$1'
41246       SET_SHARED_LIBRARY_MAPFILE='-Xlinker -version-script=$1'
41247     fi
41248   elif test "x$TOOLCHAIN_TYPE" = xclang; then
41249     PICFLAG=''
41250     C_FLAG_REORDER=''
41251     CXX_FLAG_REORDER=''
41252 
41253     if test "x$OPENJDK_TARGET_OS" = xmacosx; then
41254       # Linking is different on MacOSX
41255       SHARED_LIBRARY_FLAGS="-dynamiclib -compatibility_version 1.0.0 -current_version 1.0.0 $PICFLAG"
41256       SET_EXECUTABLE_ORIGIN='-Xlinker -rpath -Xlinker @loader_path/.'
41257       SET_SHARED_LIBRARY_ORIGIN="$SET_EXECUTABLE_ORIGIN"
41258       SET_SHARED_LIBRARY_NAME='-Xlinker -install_name -Xlinker @rpath/$1'
41259       SET_SHARED_LIBRARY_MAPFILE=''
41260     else
41261       # Default works for linux, might work on other platforms as well.
41262       SHARED_LIBRARY_FLAGS='-shared'
41263       SET_EXECUTABLE_ORIGIN='-Xlinker -rpath -Xlinker \$$$$ORIGIN$1'
41264       SET_SHARED_LIBRARY_ORIGIN="-Xlinker -z -Xlinker origin $SET_EXECUTABLE_ORIGIN"
41265       SET_SHARED_LIBRARY_NAME='-Xlinker -soname=$1'
41266       SET_SHARED_LIBRARY_MAPFILE='-Xlinker -version-script=$1'
41267     fi
41268   elif test "x$TOOLCHAIN_TYPE" = xsolstudio; then
41269     PICFLAG="-KPIC"
41270     C_FLAG_REORDER='-xF'
41271     CXX_FLAG_REORDER='-xF'
41272     SHARED_LIBRARY_FLAGS="-G"
41273     SET_EXECUTABLE_ORIGIN='-R\$$$$ORIGIN$1'
41274     SET_SHARED_LIBRARY_ORIGIN="$SET_EXECUTABLE_ORIGIN"
41275     SET_SHARED_LIBRARY_NAME=''
41276     SET_SHARED_LIBRARY_MAPFILE='-M$1'
41277   elif test "x$TOOLCHAIN_TYPE" = xxlc; then
41278     PICFLAG="-qpic=large"
41279     C_FLAG_REORDER=''
41280     CXX_FLAG_REORDER=''
41281     SHARED_LIBRARY_FLAGS="-qmkshrobj"
41282     SET_EXECUTABLE_ORIGIN=""
41283     SET_SHARED_LIBRARY_ORIGIN=''
41284     SET_SHARED_LIBRARY_NAME=''
41285     SET_SHARED_LIBRARY_MAPFILE=''
41286   elif test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
41287     PICFLAG=""


41309   fi
41310   # The (cross) compiler is now configured, we can now test capabilities
41311   # of the target platform.
41312 
41313 
41314 
41315   ###############################################################################
41316   #
41317   # Setup the opt flags for different compilers
41318   # and different operating systems.
41319   #
41320 
41321   # FIXME: this was indirectly the old default, but just inherited.
41322   # if test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
41323   #   C_FLAG_DEPS="-MMD -MF"
41324   # fi
41325 
41326   # Generate make dependency files
41327   if test "x$TOOLCHAIN_TYPE" = xgcc; then
41328     C_FLAG_DEPS="-MMD -MF"
41329   elif test "x$TOOLCHAIN_TYPE" = xclang; then
41330     C_FLAG_DEPS="-MMD -MF"
41331   elif test "x$TOOLCHAIN_TYPE" = xsolstudio; then
41332     C_FLAG_DEPS="-xMMD -xMF"
41333   elif test "x$TOOLCHAIN_TYPE" = xxlc; then
41334     C_FLAG_DEPS="-qmakedep=gcc -MF"
41335   fi
41336   CXX_FLAG_DEPS="$C_FLAG_DEPS"
41337 
41338 
41339 
41340   # Debug symbols
41341   if test "x$TOOLCHAIN_TYPE" = xgcc; then
41342     if test "x$OPENJDK_TARGET_CPU_BITS" = "x64" && test "x$DEBUG_LEVEL" = "xfastdebug"; then
41343       CFLAGS_DEBUG_SYMBOLS="-g1"
41344       CXXFLAGS_DEBUG_SYMBOLS="-g1"
41345     else
41346       CFLAGS_DEBUG_SYMBOLS="-g"
41347       CXXFLAGS_DEBUG_SYMBOLS="-g"
41348     fi
41349   elif test "x$TOOLCHAIN_TYPE" = xclang; then
41350     CFLAGS_DEBUG_SYMBOLS="-g"
41351     CXXFLAGS_DEBUG_SYMBOLS="-g"
41352   elif test "x$TOOLCHAIN_TYPE" = xsolstudio; then
41353     CFLAGS_DEBUG_SYMBOLS="-g -xs"
41354     CXXFLAGS_DEBUG_SYMBOLS="-g0 -xs"
41355   elif test "x$TOOLCHAIN_TYPE" = xxlc; then
41356     CFLAGS_DEBUG_SYMBOLS="-g"
41357     CXXFLAGS_DEBUG_SYMBOLS="-g"
41358   fi
41359 
41360 
41361 
41362   # Optimization levels
41363   if test "x$TOOLCHAIN_TYPE" = xsolstudio; then
41364     CC_HIGHEST="$CC_HIGHEST -fns -fsimple -fsingle -xalias_level=basic -xbuiltin=%all -xdepend -xrestrict -xlibmil"
41365 
41366     if test "x$OPENJDK_TARGET_CPU_ARCH" = "xx86"; then
41367       # FIXME: seems we always set -xregs=no%frameptr; put it elsewhere more global?
41368       C_O_FLAG_HIGHEST="-xO4 -Wu,-O4~yz $CC_HIGHEST -xregs=no%frameptr"
41369       C_O_FLAG_HI="-xO4 -Wu,-O4~yz -xregs=no%frameptr"
41370       C_O_FLAG_NORM="-xO2 -Wu,-O2~yz -xregs=no%frameptr"
41371       C_O_FLAG_NONE="-xregs=no%frameptr"


41374       CXX_O_FLAG_NORM="-xO2 -Qoption ube -O2~yz -xregs=no%frameptr"
41375       CXX_O_FLAG_NONE="-xregs=no%frameptr"
41376       if test "x$OPENJDK_TARGET_CPU_BITS" = "x32"; then
41377         C_O_FLAG_HIGHEST="$C_O_FLAG_HIGHEST -xchip=pentium"
41378         CXX_O_FLAG_HIGHEST="$CXX_O_FLAG_HIGHEST -xchip=pentium"
41379       fi
41380     elif test "x$OPENJDK_TARGET_CPU_ARCH" = "xsparc"; then
41381       C_O_FLAG_HIGHEST="-xO4 -Wc,-Qrm-s -Wc,-Qiselect-T0 $CC_HIGHEST -xprefetch=auto,explicit -xchip=ultra"
41382       C_O_FLAG_HI="-xO4 -Wc,-Qrm-s -Wc,-Qiselect-T0"
41383       C_O_FLAG_NORM="-xO2 -Wc,-Qrm-s -Wc,-Qiselect-T0"
41384       C_O_FLAG_NONE=""
41385       CXX_O_FLAG_HIGHEST="-xO4 -Qoption cg -Qrm-s -Qoption cg -Qiselect-T0 $CC_HIGHEST -xprefetch=auto,explicit -xchip=ultra"
41386       CXX_O_FLAG_HI="-xO4 -Qoption cg -Qrm-s -Qoption cg -Qiselect-T0"
41387       CXX_O_FLAG_NORM="-xO2 -Qoption cg -Qrm-s -Qoption cg -Qiselect-T0"
41388       CXX_O_FLAG_NONE=""
41389     fi
41390   else
41391     # The remaining toolchains share opt flags between CC and CXX;
41392     # setup for C and duplicate afterwards.
41393     if test "x$TOOLCHAIN_TYPE" = xgcc; then
41394       if test "x$OPENJDK_TARGET_OS" = xmacosx; then
41395         # On MacOSX we optimize for size, something
41396         # we should do for all platforms?
41397         C_O_FLAG_HIGHEST="-Os"
41398         C_O_FLAG_HI="-Os"
41399         C_O_FLAG_NORM="-Os"
41400         C_O_FLAG_NONE=""
41401       else
41402         C_O_FLAG_HIGHEST="-O3"
41403         C_O_FLAG_HI="-O3"
41404         C_O_FLAG_NORM="-O2"
41405         C_O_FLAG_NONE="-O0"
41406       fi
41407     elif test "x$TOOLCHAIN_TYPE" = xclang; then
41408       if test "x$OPENJDK_TARGET_OS" = xmacosx; then
41409         # On MacOSX we optimize for size, something
41410         # we should do for all platforms?
41411         C_O_FLAG_HIGHEST="-Os"
41412         C_O_FLAG_HI="-Os"
41413         C_O_FLAG_NORM="-Os"
41414         C_O_FLAG_NONE=""
41415       else
41416         C_O_FLAG_HIGHEST="-O3"
41417         C_O_FLAG_HI="-O3"
41418         C_O_FLAG_NORM="-O2"
41419         C_O_FLAG_NONE="-O0"
41420       fi
41421     elif test "x$TOOLCHAIN_TYPE" = xxlc; then
41422       C_O_FLAG_HIGHEST="-O3"
41423       C_O_FLAG_HI="-O3 -qstrict"
41424       C_O_FLAG_NORM="-O2"
41425       C_O_FLAG_NONE=""
41426     elif test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
41427       C_O_FLAG_HIGHEST="-O2"