-
Bug
-
Resolution: Fixed
-
P3
-
9
-
b07
-
generic
-
generic
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8242988 | 11.0.8 | Erik Joelsson | P3 | Resolved | Fixed | b01 |
JDK-8242749 | 11.0.7 | Erik Joelsson | P3 | Resolved | Fixed | b10 |
configure checks whether the compiler supports particular arguments e.g.
FLAGS_COMPILER_CHECK_ARGUMENTS(ARGUMENT: [$STACK_PROTECTOR_CFLAG -Werror], IF_FALSE: [STACK_PROTECTOR_CFLAG=""])
However, in situations where there is both a build and a target compiler, the only one that is checked is the one that is the current value of CXX.
One case specifically works around this by calling FLAGS_COMPILER_CHECK_ARGUMENTS twice:
FLAGS_COMPILER_CHECK_ARGUMENTS(ARGUMENT: [-Wno-this-is-a-warning-that-do-not-exist],
IF_TRUE: [GCC_CAN_DISABLE_WARNINGS=true],
IF_FALSE: [GCC_CAN_DISABLE_WARNINGS=false]
)
...
# Repeate the check for the BUILD_CC and BUILD_CXX. Need to also reset
# CFLAGS since any target specific flags will likely not work with the
# build compiler
CC_OLD="$CC"
CXX_OLD="$CXX"
CC="$BUILD_CC"
CXX="$BUILD_CXX"
CFLAGS_OLD="$CFLAGS"
CFLAGS=""
FLAGS_COMPILER_CHECK_ARGUMENTS(ARGUMENT: [-Wno-this-is-a-warning-that-do-not-exist],
IF_TRUE: [BUILD_CC_CAN_DISABLE_WARNINGS=true],
IF_FALSE: [BUILD_CC_CAN_DISABLE_WARNINGS=false]
)
This really needs to be generalised into a macro that all such cases can use, to ensure both compilers are checked.
The output should also make it clear that the two checks are different. Currently, it looks like this:
checking if the C compiler supports "-Wno-this-is-a-warning-that-do-not-exist"... yes
checking if the C++ compiler supports "-Wno-this-is-a-warning-that-do-not-exist"... yes
checking if both compilers support "-Wno-this-is-a-warning-that-do-not-exist"... yes
checking if the C compiler supports "-Wno-this-is-a-warning-that-do-not-exist"... yes
checking if the C++ compiler supports "-Wno-this-is-a-warning-that-do-not-exist"... yes
checking if both compilers support "-Wno-this-is-a-warning-that-do-not-exist"... yes
which appears erroneous.
FLAGS_COMPILER_CHECK_ARGUMENTS(ARGUMENT: [$STACK_PROTECTOR_CFLAG -Werror], IF_FALSE: [STACK_PROTECTOR_CFLAG=""])
However, in situations where there is both a build and a target compiler, the only one that is checked is the one that is the current value of CXX.
One case specifically works around this by calling FLAGS_COMPILER_CHECK_ARGUMENTS twice:
FLAGS_COMPILER_CHECK_ARGUMENTS(ARGUMENT: [-Wno-this-is-a-warning-that-do-not-exist],
IF_TRUE: [GCC_CAN_DISABLE_WARNINGS=true],
IF_FALSE: [GCC_CAN_DISABLE_WARNINGS=false]
)
...
# Repeate the check for the BUILD_CC and BUILD_CXX. Need to also reset
# CFLAGS since any target specific flags will likely not work with the
# build compiler
CC_OLD="$CC"
CXX_OLD="$CXX"
CC="$BUILD_CC"
CXX="$BUILD_CXX"
CFLAGS_OLD="$CFLAGS"
CFLAGS=""
FLAGS_COMPILER_CHECK_ARGUMENTS(ARGUMENT: [-Wno-this-is-a-warning-that-do-not-exist],
IF_TRUE: [BUILD_CC_CAN_DISABLE_WARNINGS=true],
IF_FALSE: [BUILD_CC_CAN_DISABLE_WARNINGS=false]
)
This really needs to be generalised into a macro that all such cases can use, to ensure both compilers are checked.
The output should also make it clear that the two checks are different. Currently, it looks like this:
checking if the C compiler supports "-Wno-this-is-a-warning-that-do-not-exist"... yes
checking if the C++ compiler supports "-Wno-this-is-a-warning-that-do-not-exist"... yes
checking if both compilers support "-Wno-this-is-a-warning-that-do-not-exist"... yes
checking if the C compiler supports "-Wno-this-is-a-warning-that-do-not-exist"... yes
checking if the C++ compiler supports "-Wno-this-is-a-warning-that-do-not-exist"... yes
checking if both compilers support "-Wno-this-is-a-warning-that-do-not-exist"... yes
which appears erroneous.
- backported by
-
JDK-8242749 FLAGS_COMPILER_CHECK_ARGUMENTS doesn't handle cross-compilation
-
- Resolved
-
-
JDK-8242988 FLAGS_COMPILER_CHECK_ARGUMENTS doesn't handle cross-compilation
-
- Resolved
-
- duplicates
-
JDK-8210551 FLAGS_COMPILER_CHECK_ARGUMENTS does not work with build compiler
-
- Closed
-
- relates to
-
JDK-8152666 The new Hotspot Build System
-
- Resolved
-