]> git.pld-linux.org Git - packages/openjdk8.git/blob - gcc6.patch
- gcc6 build fix from https://github.com/gnu-andrew/java-1.8.0-openjdk/blob/master...
[packages/openjdk8.git] / gcc6.patch
1 diff -r 86030362b0c5 common/autoconf/hotspot-spec.gmk.in
2 --- openjdk/common/autoconf/hotspot-spec.gmk.in Mon Feb 29 06:45:20 2016 +0000
3 +++ openjdk/common/autoconf/hotspot-spec.gmk.in Fri Mar 11 18:01:42 2016 +0000
4 @@ -109,7 +109,7 @@
5  MT:=@HOTSPOT_MT@
6  RC:=@HOTSPOT_RC@
7  
8 -EXTRA_CFLAGS=@LEGACY_EXTRA_CFLAGS@
9 +EXTRA_CFLAGS=@LEGACY_EXTRA_CFLAGS@ $(NO_NULL_POINTER_CHECK_FLAG) $(NO_LIFETIME_DSE_CFLAG) $(CXXSTD_CXXFLAG)
10  EXTRA_CXXFLAGS=@LEGACY_EXTRA_CXXFLAGS@
11  EXTRA_LDFLAGS=@LEGACY_EXTRA_LDFLAGS@
12  
13 diff -r 86030362b0c5 common/autoconf/spec.gmk.in
14 --- openjdk/common/autoconf/spec.gmk.in Mon Feb 29 06:45:20 2016 +0000
15 +++ openjdk/common/autoconf/spec.gmk.in Fri Mar 11 18:01:42 2016 +0000
16 @@ -320,6 +320,10 @@
17  C_FLAG_DEPS:=@C_FLAG_DEPS@
18  CXX_FLAG_DEPS:=@CXX_FLAG_DEPS@
19  
20 +NO_NULL_POINTER_CHECK_FLAG=@NO_NULL_POINTER_CHECK_CFLAG@
21 +NO_LIFETIME_DSE_CFLAG=@NO_LIFETIME_DSE_CFLAG@
22 +CXXSTD_CXXFLAG=@CXXSTD_CXXFLAG@
23 +
24  # Tools that potentially need to be cross compilation aware.
25  CC:=@FIXPATH@ @CCACHE@ @CC@
26  
27 diff -r 86030362b0c5 common/autoconf/toolchain.m4
28 --- openjdk/common/autoconf/toolchain.m4        Mon Feb 29 06:45:20 2016 +0000
29 +++ openjdk/common/autoconf/toolchain.m4        Fri Mar 11 18:01:42 2016 +0000
30 @@ -784,6 +784,10 @@
31              CFLAGS_DEBUG_SYMBOLS="-g1"
32              CXXFLAGS_DEBUG_SYMBOLS="-g1"
33            fi
34 +         CXXSTD_CXXFLAG="-std=gnu++98"
35 +         TOOLCHAIN_CXX_COMPILER_CHECK_ARGUMENTS([$CXXSTD_CXXFLAG -Werror], [], [CXXSTD_CXXFLAG=""])
36 +         CXXFLAGS_JDK="${CXXFLAGS_JDK} ${CXXSTD_CXXFLAG}"
37 +         AC_SUBST([CXXSTD_CXXFLAG])
38            ;;
39          ossc )
40            #
41 @@ -973,6 +977,16 @@
42            CFLAGS_JDK="${CFLAGS_JDK} -fno-strict-aliasing"
43            ;;
44        esac
45 +      # These flags are required for GCC 6 builds but may not be available on earlier versions
46 +      NO_NULL_POINTER_CHECK_CFLAG="-fno-delete-null-pointer-checks"
47 +      TOOLCHAIN_COMPILER_CHECK_ARGUMENTS([$NO_NULL_POINTER_CHECK_CFLAG -Werror], [],
48 +                                        [NO_NULL_POINTER_CHECK_CFLAG=""])
49 +      AC_SUBST([NO_NULL_POINTER_CHECK_CFLAG])
50 +      NO_LIFETIME_DSE_CFLAG="-fno-lifetime-dse"
51 +      TOOLCHAIN_COMPILER_CHECK_ARGUMENTS([$NO_LIFETIME_DSE_CFLAG -Werror], [],
52 +                                        [NO_LIFETIME_DSE_CFLAG=""])
53 +      CFLAGS_JDK="${CFLAGS_JDK} ${NO_NULL_POINTER_CHECK_CFLAG} ${NO_LIFETIME_DSE_CFLAG}"
54 +      AC_SUBST([NO_LIFETIME_DSE_CFLAG])
55        ;;
56      ossc )
57        CCXXFLAGS_JDK="$CCXXFLAGS $CCXXFLAGS_JDK -DTRACING -DMACRO_MEMSYS_OPS -DBREAKPTS"
58 @@ -1200,9 +1214,9 @@
59  #                                   [RUN-IF-FALSE])
60  # ------------------------------------------------------------
61  # Check that the c and c++ compilers support an argument
62 -AC_DEFUN([TOOLCHAIN_COMPILER_CHECK_ARGUMENTS],
63 +AC_DEFUN([TOOLCHAIN_C_COMPILER_CHECK_ARGUMENTS],
64  [
65 -  AC_MSG_CHECKING([if compiler supports "$1"])
66 +  AC_MSG_CHECKING([if the C compiler supports "$1"])
67    supports=yes
68  
69    saved_cflags="$CFLAGS"
70 @@ -1213,6 +1227,19 @@
71    AC_LANG_POP([C])
72    CFLAGS="$saved_cflags"
73  
74 +  AC_MSG_RESULT([$supports])
75 +  if test "x$supports" = "xyes" ; then
76 +    m4_ifval([$2], [$2], [:])
77 +  else
78 +    m4_ifval([$3], [$3], [:])
79 +  fi
80 +])
81 +
82 +AC_DEFUN([TOOLCHAIN_CXX_COMPILER_CHECK_ARGUMENTS],
83 +[
84 +  AC_MSG_CHECKING([if the C++ compiler supports "$1"])
85 +  supports=yes
86 +
87    saved_cxxflags="$CXXFLAGS"
88    CXXFLAGS="$CXXFLAG $1"
89    AC_LANG_PUSH([C++])
90 @@ -1220,7 +1247,28 @@
91        [supports=no])
92    AC_LANG_POP([C++])
93    CXXFLAGS="$saved_cxxflags"
94 +  
95 +  AC_MSG_RESULT([$supports])
96 +  if test "x$supports" = "xyes" ; then
97 +    m4_ifval([$2], [$2], [:])
98 +  else
99 +    m4_ifval([$3], [$3], [:])
100 +  fi
101 +])
102  
103 +# TOOLCHAIN_COMPILER_CHECK_ARGUMENTS(ARGUMENT: [ARGUMENT], IF_TRUE: [RUN-IF-TRUE],
104 +#                                   IF_FALSE: [RUN-IF-FALSE])
105 +# ------------------------------------------------------------
106 +# Check that the c and c++ compilers support an argument
107 +AC_DEFUN([TOOLCHAIN_COMPILER_CHECK_ARGUMENTS],
108 +[
109 +  TOOLCHAIN_C_COMPILER_CHECK_ARGUMENTS([$1], [C_COMP_SUPPORTS="yes"], [C_COMP_SUPPORTS="no"])
110 +  TOOLCHAIN_CXX_COMPILER_CHECK_ARGUMENTS([$1], [CXX_COMP_SUPPORTS="yes"], [CXX_COMP_SUPPORTS="no"])
111 +
112 +  AC_MSG_CHECKING([if both compilers support "$1"])
113 +  supports=no
114 +  if test "x$C_COMP_SUPPORTS" = "xyes" -a "x$CXX_COMP_SUPPORTS" = "xyes"; then supports=yes; fi
115 +  
116    AC_MSG_RESULT([$supports])
117    if test "x$supports" = "xyes" ; then
118      m4_ifval([$2], [$2], [:])
This page took 0.057208 seconds and 3 git commands to generate.