openjdk: fix gcc6 build

No revbump because gcc4 options do not change
This commit is contained in:
Juergen Buchmueller 2016-09-21 18:22:36 +02:00
parent 711ff95cee
commit 0b9109d778
2 changed files with 30 additions and 0 deletions

View file

@ -0,0 +1,13 @@
Use ~0u instead of -1 to shift an unsigned value.
--- a/src/share/vm/code/dependencies.hpp 2016-04-25 18:32:00.000000000 +0200
+++ b/src/share/vm/code/dependencies.hpp 2016-09-13 19:46:22.684595758 +0200
@@ -166,7 +166,7 @@
LG2_TYPE_LIMIT = 4, // assert(TYPE_LIMIT <= (1<<LG2_TYPE_LIMIT))
// handy categorizations of dependency types:
- all_types = ((1 << TYPE_LIMIT) - 1) & ((-1) << FIRST_TYPE),
+ all_types = ((1 << TYPE_LIMIT) - 1) & (~0u << FIRST_TYPE),
non_klass_types = (1 << call_site_target_value),
klass_types = all_types & ~non_klass_types,

View file

@ -129,6 +129,13 @@ alternatives="
"
CFLAGS="-Wno-error=deprecated-declarations"
_gccver=$(gcc --version | awk '/^gcc \(GCC\)/ { print $3 }')
if [ "${_gccver%%.*}" -gt 5 ]; then
# Append CFLAGS to set work around code which gcc6 would
# otherwise regard as out-of-specification and allow it
# to produce a working program.
CFLAGS+=" -Wno-error -std=c++98 -fno-delete-null-pointer-checks -fno-lifetime-dse"
fi
do_build() {
# -D_FORTIFY_SOURCE=2 doesn't work with CXX_O_FLAG_NONE="-O0"
@ -138,6 +145,16 @@ do_build() {
}
post_extract() {
if [ "${_gccver%%.*}" -gt 5 ]; then
cd ${XBPS_BUILDDIR}/jdk-${_repo_ver}
# gcc6 complains about the signed shift left
sed -i src/share/native/com/sun/java/util/jar/pack/constants.h \
-e's;(-1)<<13;~0u<<13;g'
# wrong "return false;" instead of "return null;"
sed -i src/share/native/com/sun/java/util/jar/pack/jni.cpp \
-e"295s;false;null;"
cd ${wrksrc}
fi
chmod +x configure
for subrepo in corba hotspot jdk jaxws jaxp langtools nashorn; do
ln -s ../${subrepo}-${_repo_ver} ${subrepo}