From 1fd01b8b7f835e4f22df68f1f291c4c8687c881ac9a173d689cc847bcfa8595c Mon Sep 17 00:00:00 2001 From: Fridrich Strba Date: Mon, 29 Jan 2018 09:46:59 +0000 Subject: [PATCH] Fix build with gcc 7.3 OBS-URL: https://build.opensuse.org/package/show/Java:Factory/java-1_8_0-openjdk?expand=0&rev=270 --- java-1_8_0-openjdk.changes | 7 +++++++ java-1_8_0-openjdk.spec | 14 ++++++++++++-- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/java-1_8_0-openjdk.changes b/java-1_8_0-openjdk.changes index e65ed33..d9aa5a0 100644 --- a/java-1_8_0-openjdk.changes +++ b/java-1_8_0-openjdk.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Mon Jan 29 09:44:55 UTC 2018 - fstrba@suse.com + +- Fix build with gcc 7.3 + * add -fno-delete-null-pointer-checks -fno-lifetime-dse and + -std=gnu++98 + ------------------------------------------------------------------- Fri Nov 3 11:36:40 UTC 2017 - fstrba@suse.com diff --git a/java-1_8_0-openjdk.spec b/java-1_8_0-openjdk.spec index 223f0f5..8cc10e6 100644 --- a/java-1_8_0-openjdk.spec +++ b/java-1_8_0-openjdk.spec @@ -1,7 +1,7 @@ # # spec file for package java-1_8_0-openjdk # -# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -446,8 +446,18 @@ export ZLIB_LIBS="-L/%{_lib} -lz" %endif CFLAGS=$(rpm -E '%{optflags}' | sed 's/-Wall\>//') +CFLAGS="$CFLAGS -Wno-error" +CXXFLAGS=${CFLAGS} +%ifarch ppc64 ppc64le ppc +CFLAGS="$CFLAGS -fno-strict-aliasing" +%endif +%if 0%{?suse_version} >= 1330 +CFLAGS="$CFLAGS -std=gnu++98 -fno-delete-null-pointer-checks -fno-lifetime-dse -fpermissive" +CXXFLAGS="$CXXFLAGS -std=gnu++98 -fno-delete-null-pointer-checks -fno-lifetime-dse" +%endif export CFLAGS -export CXXFLAGS=${CFLAGS} +export CXXFLAGS + %if %{with_sunec} export NSS_SOFTOKN_CFLAGS="`pkg-config --cflags nss` -I`pwd`" export NSS_SOFTOKN_LIBS="-L%{_libdir} -lnssdbm3 -lsoftokn3 -lssl3 -lsmime3 -lnss3 -lnssutil3 -lfreebl -L%{_libdir}/nspr -lplds4 -lplc4 -lnspr4"