-
Bug
-
Resolution: Fixed
-
P4
-
None
-
b69
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8098598 | emb-9 | Omair Majid | P4 | Resolved | Fixed | team |
JDK-8130947 | 8u65 | Omair Majid | P4 | Resolved | Fixed | b05 |
JDK-8121932 | 8u60 | Omair Majid | P4 | Resolved | Fixed | b22 |
JDK-8137357 | emb-8u65 | Unassigned | P4 | Resolved | Fixed | b05 |
JDK-8130547 | emb-8u60 | Omair Majid | P4 | Resolved | Fixed | b22 |
The SetupNativeCompilation macro's documentation states:
# CFLAGS the compiler flags to be used, used both for C and C++.
# CXXFLAGS the compiler flags to be used for c++, if set overrides CFLAGS.
Unfortunately, this doesn't work in all case. This is the code that implements what is described above (the relevant code is the last bit, but the code that comes before it causes a problem):
ifeq ($$($1_DEBUG_SYMBOLS), true)
ifeq ($(ENABLE_DEBUG_SYMBOLS), true)
ifdef OPENJDK
# Always add debug symbols
$1_EXTRA_CFLAGS+=$(CFLAGS_DEBUG_SYMBOLS)
$1_EXTRA_CXXFLAGS+=$(CXXFLAGS_DEBUG_SYMBOLS)
else
# Programs don't get the debug symbols added in the old build. It's not clear if
# this is intentional.
ifeq ($$($1_PROGRAM),)
$1_EXTRA_CFLAGS+=$(CFLAGS_DEBUG_SYMBOLS)
$1_EXTRA_CXXFLAGS+=$(CXXFLAGS_DEBUG_SYMBOLS)
endif
endif
endif
endif
# If no C++ flags are explicitly set, default to using the C flags.
# After that, we can set additional C++ flags that should not interfere
# with the mechanism for copying the C flags by default.
ifeq ($$($1_CXXFLAGS),)
$1_CXXFLAGS:=$$($1_CFLAGS)
endif
ifeq ($$(strip $$($1_EXTRA_CXXFLAGS)),)
$1_EXTRA_CXXFLAGS:=$$($1_EXTRA_CFLAGS)
endif
The code only sets $1_EXTRA_CXXFLAGS if it is empty. But depending on the debugging settings, it may have been initialized in the code just above it (with only debugging-related options)
The fix is to only set debugging options in $1_EXTRA_CXXFLAGS after initializing it with $1_EXTRA_CFLAGS.
# CFLAGS the compiler flags to be used, used both for C and C++.
# CXXFLAGS the compiler flags to be used for c++, if set overrides CFLAGS.
Unfortunately, this doesn't work in all case. This is the code that implements what is described above (the relevant code is the last bit, but the code that comes before it causes a problem):
ifeq ($$($1_DEBUG_SYMBOLS), true)
ifeq ($(ENABLE_DEBUG_SYMBOLS), true)
ifdef OPENJDK
# Always add debug symbols
$1_EXTRA_CFLAGS+=$(CFLAGS_DEBUG_SYMBOLS)
$1_EXTRA_CXXFLAGS+=$(CXXFLAGS_DEBUG_SYMBOLS)
else
# Programs don't get the debug symbols added in the old build. It's not clear if
# this is intentional.
ifeq ($$($1_PROGRAM),)
$1_EXTRA_CFLAGS+=$(CFLAGS_DEBUG_SYMBOLS)
$1_EXTRA_CXXFLAGS+=$(CXXFLAGS_DEBUG_SYMBOLS)
endif
endif
endif
endif
# If no C++ flags are explicitly set, default to using the C flags.
# After that, we can set additional C++ flags that should not interfere
# with the mechanism for copying the C flags by default.
ifeq ($$($1_CXXFLAGS),)
$1_CXXFLAGS:=$$($1_CFLAGS)
endif
ifeq ($$(strip $$($1_EXTRA_CXXFLAGS)),)
$1_EXTRA_CXXFLAGS:=$$($1_EXTRA_CFLAGS)
endif
The code only sets $1_EXTRA_CXXFLAGS if it is empty. But depending on the debugging settings, it may have been initialized in the code just above it (with only debugging-related options)
The fix is to only set debugging options in $1_EXTRA_CXXFLAGS after initializing it with $1_EXTRA_CFLAGS.
- backported by
-
JDK-8098598 SetupNativeCompilation ignores CFLAGS_release for cpp files
-
- Resolved
-
-
JDK-8121932 SetupNativeCompilation ignores CFLAGS_release for cpp files
-
- Resolved
-
-
JDK-8130547 SetupNativeCompilation ignores CFLAGS_release for cpp files
-
- Resolved
-
-
JDK-8130947 SetupNativeCompilation ignores CFLAGS_release for cpp files
-
- Resolved
-
-
JDK-8137357 SetupNativeCompilation ignores CFLAGS_release for cpp files
-
- Resolved
-