< prev index next >

make/autoconf/flags-cflags.m4

Print this page

        

*** 1,7 **** # ! # Copyright (c) 2011, 2019, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License version 2 only, as # published by the Free Software Foundation. Oracle designates this --- 1,7 ---- # ! # Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License version 2 only, as # published by the Free Software Foundation. Oracle designates this
*** 217,237 **** # Additional warnings that are not activated by -Wall and -Wextra WARNINGS_ENABLE_ADDITIONAL="-Wpointer-arith -Wsign-compare -Wreorder \ -Wunused-function -Wundef -Wunused-value -Woverloaded-virtual" WARNINGS_ENABLE_ALL="-Wall -Wextra -Wformat=2 $WARNINGS_ENABLE_ADDITIONAL" ! DISABLED_WARNINGS="unknown-warning-option unused-parameter unused" if test "x$OPENJDK_TARGET_OS" = xmacosx; then # missing-method-return-type triggers in JavaNativeFoundation framework DISABLED_WARNINGS="$DISABLED_WARNINGS missing-method-return-type" fi ;; xlc) ! DISABLE_WARNING_PREFIX="-Wno-" CFLAGS_WARNINGS_ARE_ERRORS="-qhalt=w" # Possibly a better subset than "all" is "lan:trx:ret:zea:cmp:ret" WARNINGS_ENABLE_ALL="-qinfo=all -qformat=all" DISABLED_WARNINGS="" --- 217,237 ---- # Additional warnings that are not activated by -Wall and -Wextra WARNINGS_ENABLE_ADDITIONAL="-Wpointer-arith -Wsign-compare -Wreorder \ -Wunused-function -Wundef -Wunused-value -Woverloaded-virtual" WARNINGS_ENABLE_ALL="-Wall -Wextra -Wformat=2 $WARNINGS_ENABLE_ADDITIONAL" ! DISABLED_WARNINGS="unused-parameter unused" if test "x$OPENJDK_TARGET_OS" = xmacosx; then # missing-method-return-type triggers in JavaNativeFoundation framework DISABLED_WARNINGS="$DISABLED_WARNINGS missing-method-return-type" fi ;; xlc) ! DISABLE_WARNING_PREFIX="-qsuppress=" CFLAGS_WARNINGS_ARE_ERRORS="-qhalt=w" # Possibly a better subset than "all" is "lan:trx:ret:zea:cmp:ret" WARNINGS_ENABLE_ALL="-qinfo=all -qformat=all" DISABLED_WARNINGS=""
*** 298,321 **** C_O_FLAG_NORM="-O2" C_O_FLAG_SIZE="-Os" C_O_FLAG_DEBUG="-O0" C_O_FLAG_DEBUG_JVM="-O0" C_O_FLAG_NONE="-O0" - # -D_FORTIFY_SOURCE=2 hardening option needs optimization (at least -O1) enabled - # set for lower O-levels -U_FORTIFY_SOURCE to overwrite previous settings - if test "x$OPENJDK_TARGET_OS" = xlinux -a "x$DEBUG_LEVEL" = "xfastdebug"; then - ENABLE_FORTIFY_CFLAGS="-D_FORTIFY_SOURCE=2" - DISABLE_FORTIFY_CFLAGS="-U_FORTIFY_SOURCE" - C_O_FLAG_HIGHEST_JVM="${C_O_FLAG_HIGHEST_JVM} ${ENABLE_FORTIFY_CFLAGS}" - C_O_FLAG_HIGHEST="${C_O_FLAG_HIGHEST} ${ENABLE_FORTIFY_CFLAGS}" - C_O_FLAG_HI="${C_O_FLAG_HI} ${ENABLE_FORTIFY_CFLAGS}" - C_O_FLAG_NORM="${C_O_FLAG_NORM} ${ENABLE_FORTIFY_CFLAGS}" - C_O_FLAG_SIZE="${C_O_FLAG_SIZE} ${DISABLE_FORTIFY_CFLAGS}" - C_O_FLAG_DEBUG="${C_O_FLAG_DEBUG} ${DISABLE_FORTIFY_CFLAGS}" - C_O_FLAG_DEBUG_JVM="${C_O_FLAG_DEBUG_JVM} ${DISABLE_FORTIFY_CFLAGS}" - C_O_FLAG_NONE="${C_O_FLAG_NONE} ${DISABLE_FORTIFY_CFLAGS}" - fi elif test "x$TOOLCHAIN_TYPE" = xclang; then if test "x$OPENJDK_TARGET_OS" = xmacosx; then # On MacOSX we optimize for size, something # we should do for all platforms? C_O_FLAG_HIGHEST_JVM="-Os" --- 298,307 ----
*** 548,572 **** # src/hotspot/cpu/*/globalDefinitions_*.hpp files, but this value currently # works for all platforms. TOOLCHAIN_CFLAGS_JVM="$TOOLCHAIN_CFLAGS_JVM -mno-omit-leaf-frame-pointer -mstack-alignment=16" if test "x$OPENJDK_TARGET_OS" = xlinux; then - if test "x$DEBUG_LEVEL" = xrelease; then - # Clang does not inline as much as GCC does for functions with "inline" keyword by default. - # This causes noticeable slowdown in pause time for G1, and possibly in other areas. - # Increasing the inline hint threshold avoids the slowdown for Clang-built JVM. - TOOLCHAIN_CFLAGS_JVM="$TOOLCHAIN_CFLAGS_JVM -mllvm -inlinehint-threshold=100000" - fi TOOLCHAIN_CFLAGS_JDK="-pipe" TOOLCHAIN_CFLAGS_JDK_CONLY="-fno-strict-aliasing" # technically NOT for CXX fi elif test "x$TOOLCHAIN_TYPE" = xsolstudio; then TOOLCHAIN_FLAGS="-errtags -errfmt" TOOLCHAIN_CFLAGS="-errshort=tags" TOOLCHAIN_CFLAGS_JDK="-mt $TOOLCHAIN_FLAGS" ! TOOLCHAIN_CFLAGS_JDK_CONLY="-W0,-noglobal $TOOLCHAIN_CFLAGS" # C only TOOLCHAIN_CFLAGS_JDK_CXXONLY="-features=no%except -norunpath -xnolib" # CXX only TOOLCHAIN_CFLAGS_JVM="-template=no%extdef -features=no%split_init \ -library=stlport4 -mt -features=no%except $TOOLCHAIN_FLAGS" if test "x$DEBUG_LEVEL" = xslowdebug; then # Previously -g was used instead of -g0 for slowdebug; this is equivalent --- 534,552 ---- # src/hotspot/cpu/*/globalDefinitions_*.hpp files, but this value currently # works for all platforms. TOOLCHAIN_CFLAGS_JVM="$TOOLCHAIN_CFLAGS_JVM -mno-omit-leaf-frame-pointer -mstack-alignment=16" if test "x$OPENJDK_TARGET_OS" = xlinux; then TOOLCHAIN_CFLAGS_JDK="-pipe" TOOLCHAIN_CFLAGS_JDK_CONLY="-fno-strict-aliasing" # technically NOT for CXX fi elif test "x$TOOLCHAIN_TYPE" = xsolstudio; then TOOLCHAIN_FLAGS="-errtags -errfmt" TOOLCHAIN_CFLAGS="-errshort=tags" TOOLCHAIN_CFLAGS_JDK="-mt $TOOLCHAIN_FLAGS" ! TOOLCHAIN_CFLAGS_JDK_CONLY="-xCC -Xa -W0,-noglobal $TOOLCHAIN_CFLAGS" # C only TOOLCHAIN_CFLAGS_JDK_CXXONLY="-features=no%except -norunpath -xnolib" # CXX only TOOLCHAIN_CFLAGS_JVM="-template=no%extdef -features=no%split_init \ -library=stlport4 -mt -features=no%except $TOOLCHAIN_FLAGS" if test "x$DEBUG_LEVEL" = xslowdebug; then # Previously -g was used instead of -g0 for slowdebug; this is equivalent
*** 574,616 **** TOOLCHAIN_CFLAGS_JVM="$TOOLCHAIN_CFLAGS_JVM +d" fi elif test "x$TOOLCHAIN_TYPE" = xxlc; then # Suggested additions: -qsrcmsg to get improved error reporting ! # set -qtbtable=full for a better traceback table/better stacks in hs_err when xlc16 is used ! TOOLCHAIN_CFLAGS_JDK="-qtbtable=full -qchars=signed -qfullpath -qsaveopt -qstackprotect" # add on both CFLAGS ! TOOLCHAIN_CFLAGS_JVM="-qtbtable=full -qtune=balanced \ ! -qalias=noansi -qstrict -qtls=default -qnortti -qnoeh -qignerrno -qstackprotect" elif test "x$TOOLCHAIN_TYPE" = xmicrosoft; then TOOLCHAIN_CFLAGS_JVM="-nologo -MD -MP" TOOLCHAIN_CFLAGS_JDK="-nologo -MD -Zc:wchar_t-" fi - # CFLAGS C language level for JDK sources (hotspot only uses C++) - # Ideally we would have a common level across all toolchains so that all sources - # are sure to conform to the same standard. Unfortunately neither our sources nor - # our toolchains are in a condition to support that. But what we loosely aim for is - # C99 level. - if test "x$TOOLCHAIN_TYPE" = xgcc || test "x$TOOLCHAIN_TYPE" = xclang || test "x$TOOLCHAIN_TYPE" = xxlc; then - # This raises the language level for older 4.8 gcc, while lowering it for later - # versions. clang and xlclang support the same flag. - LANGSTD_CFLAGS="-std=c99" - elif test "x$TOOLCHAIN_TYPE" = xsolstudio; then - # We can't turn on -std=c99 without breaking compilation of the splashscreen/png - # utilities. But we can enable c99 as below (previously achieved by using -Xa). - # It is the no_lib that makes the difference. - LANGSTD_CFLAGS="-xc99=all,no_lib" - elif test "x$TOOLCHAIN_TYPE" = xmicrosoft; then - # MSVC doesn't support C99/C11 explicitly, unless you compile as C++: - # LANGSTD_CFLAGS="/TP" - # but that requires numerous changes to the sources files. So we are limited - # to C89/C90 plus whatever extensions Visual Studio has decided to implement. - # This is the lowest bar for shared code. - LANGSTD_CFLAGS="" - fi - TOOLCHAIN_CFLAGS_JDK_CONLY="$LANGSTD_CFLAGS $TOOLCHAIN_CFLAGS_JDK_CONLY" - # CFLAGS WARNINGS STUFF # Set JVM_CFLAGS warning handling if test "x$TOOLCHAIN_TYPE" = xgcc; then WARNING_CFLAGS_JDK_CONLY="$WARNINGS_ENABLE_ALL_CFLAGS" WARNING_CFLAGS_JDK_CXXONLY="$WARNINGS_ENABLE_ALL_CXXFLAGS" --- 554,572 ---- TOOLCHAIN_CFLAGS_JVM="$TOOLCHAIN_CFLAGS_JVM +d" fi elif test "x$TOOLCHAIN_TYPE" = xxlc; then # Suggested additions: -qsrcmsg to get improved error reporting ! TOOLCHAIN_CFLAGS_JDK="-qchars=signed -qfullpath -qsaveopt -qstackprotect" # add on both CFLAGS ! TOOLCHAIN_CFLAGS_JVM="-qtune=balanced \ ! -qalias=noansi -qstrict -qtls=default -qlanglvl=c99vla \ ! -qlanglvl=noredefmac -qnortti -qnoeh -qignerrno -qstackprotect" elif test "x$TOOLCHAIN_TYPE" = xmicrosoft; then TOOLCHAIN_CFLAGS_JVM="-nologo -MD -MP" TOOLCHAIN_CFLAGS_JDK="-nologo -MD -Zc:wchar_t-" fi # CFLAGS WARNINGS STUFF # Set JVM_CFLAGS warning handling if test "x$TOOLCHAIN_TYPE" = xgcc; then WARNING_CFLAGS_JDK_CONLY="$WARNINGS_ENABLE_ALL_CFLAGS" WARNING_CFLAGS_JDK_CXXONLY="$WARNINGS_ENABLE_ALL_CXXFLAGS"
*** 841,873 **** $1_TOOLCHAIN_CFLAGS="${$1_GCC6_CFLAGS}" $1_WARNING_CFLAGS_JVM="-Wno-format-zero-length -Wtype-limits -Wuninitialized" fi - if test "x$TOOLCHAIN_TYPE" = xgcc || test "x$TOOLCHAIN_TYPE" = xclang; then - # Check if compiler supports -fmacro-prefix-map. If so, use that to make - # the __FILE__ macro resolve to paths relative to the workspace root. - workspace_root_trailing_slash="${WORKSPACE_ROOT%/}/" - FILE_MACRO_CFLAGS="-fmacro-prefix-map=${workspace_root_trailing_slash}=" - FLAGS_COMPILER_CHECK_ARGUMENTS(ARGUMENT: [${FILE_MACRO_CFLAGS}], - PREFIX: $3, - IF_FALSE: [ - FILE_MACRO_CFLAGS= - ] - ) - fi - # EXPORT to API CFLAGS_JVM_COMMON="$ALWAYS_CFLAGS_JVM $ALWAYS_DEFINES_JVM \ $TOOLCHAIN_CFLAGS_JVM ${$1_TOOLCHAIN_CFLAGS_JVM} \ $OS_CFLAGS $OS_CFLAGS_JVM $CFLAGS_OS_DEF_JVM $DEBUG_CFLAGS_JVM \ ! $WARNING_CFLAGS $WARNING_CFLAGS_JVM $JVM_PICFLAG $FILE_MACRO_CFLAGS" CFLAGS_JDK_COMMON="$ALWAYS_CFLAGS_JDK $ALWAYS_DEFINES_JDK $TOOLCHAIN_CFLAGS_JDK \ $OS_CFLAGS $CFLAGS_OS_DEF_JDK $DEBUG_CFLAGS_JDK $DEBUG_OPTIONS_FLAGS_JDK \ ! $WARNING_CFLAGS $WARNING_CFLAGS_JDK $DEBUG_SYMBOLS_CFLAGS_JDK \ ! $FILE_MACRO_CFLAGS" # Use ${$2EXTRA_CFLAGS} to block EXTRA_CFLAGS to be added to build flags. # (Currently we don't have any OPENJDK_BUILD_EXTRA_CFLAGS, but that might # change in the future.) --- 797,815 ---- $1_TOOLCHAIN_CFLAGS="${$1_GCC6_CFLAGS}" $1_WARNING_CFLAGS_JVM="-Wno-format-zero-length -Wtype-limits -Wuninitialized" fi # EXPORT to API CFLAGS_JVM_COMMON="$ALWAYS_CFLAGS_JVM $ALWAYS_DEFINES_JVM \ $TOOLCHAIN_CFLAGS_JVM ${$1_TOOLCHAIN_CFLAGS_JVM} \ $OS_CFLAGS $OS_CFLAGS_JVM $CFLAGS_OS_DEF_JVM $DEBUG_CFLAGS_JVM \ ! $WARNING_CFLAGS $WARNING_CFLAGS_JVM $JVM_PICFLAG" CFLAGS_JDK_COMMON="$ALWAYS_CFLAGS_JDK $ALWAYS_DEFINES_JDK $TOOLCHAIN_CFLAGS_JDK \ $OS_CFLAGS $CFLAGS_OS_DEF_JDK $DEBUG_CFLAGS_JDK $DEBUG_OPTIONS_FLAGS_JDK \ ! $WARNING_CFLAGS $WARNING_CFLAGS_JDK $DEBUG_SYMBOLS_CFLAGS_JDK" # Use ${$2EXTRA_CFLAGS} to block EXTRA_CFLAGS to be added to build flags. # (Currently we don't have any OPENJDK_BUILD_EXTRA_CFLAGS, but that might # change in the future.)
< prev index next >