Description of problem: Build of java-openjdk with newest sources (jdk12+30) is failing due -Wformat flag, that is being added as extra cflag in our spec file, but being removed by another make file jdk12/make/common/TestFilesCompilation.gmk during the build. Line 100: DISABLED_WARNINGS_gcc := format undef unused-function unused-value This causes error during compilation of some test libraries (e.g. libTestJNIWeakG1.c), because the -Wformat flag is needed by -Werror=format-security flag. Due to that, we are unable to build the JDK without omitting the -Werror=format-security flag. When I patch the file, removing the "format" from the line, the build then passes. Version-Release number of selected component (if applicable): java-openjdk-12.0.0.30-0.ea.1.rolling Actual results: Compilation fails: Compiling libTestJNIWeakG1.c (for libTestJNIWeakG1.so) ( /usr/bin/rm -f /builddir/build/BUILD/java-12-openjdk-12.0.0.30-0.ea.1.rolling.fc29.1.x86_64/openjdk/build/support/test/hotspot/jtreg/native/support/libTestJNIWeakG1/libTestJNIWeakG1.o.log && /usr/bin/gcc -MMD -MF /builddir/build/BUILD/java-12-openjdk-12.0.0.30-0.ea.1.rolling.fc29.1.x86_64/openjdk/build/support/test/hotspot/jtreg/native/support/libTestJNIWeakG1/libTestJNIWeakG1.d -I/builddir/build/BUILD/java-12-openjdk-12.0.0.30-0.ea.1.rolling.fc29.1.x86_64/openjdk/build/support/modules_include/java.base -I/builddir/build/BUILD/java-12-openjdk-12.0.0.30-0.ea.1.rolling.fc29.1.x86_64/openjdk/build/support/modules_include/java.base/linux -I/builddir/build/BUILD/java-12-openjdk-12.0.0.30-0.ea.1.rolling.fc29.1.x86_64/openjdk/src/java.base/share/native/libjava -I/builddir/build/BUILD/java-12-openjdk-12.0.0.30-0.ea.1.rolling.fc29.1.x86_64/openjdk/src/java.base/unix/native/libjava -I/builddir/build/BUILD/java-12-openjdk-12.0.0.30-0.ea.1.rolling.fc29.1.x86_64/openjdk/src/hotspot/share/include -I/builddir/build/BUILD/java-12-openjdk-12.0.0.30-0.ea.1.rolling.fc29.1.x86_64/openjdk/src/hotspot/os/posix/include -pipe -fstack-protector -D_GNU_SOURCE -D_REENTRANT -D_LARGEFILE64_SOURCE -DLINUX -DNDEBUG -fno-strict-aliasing -Wall -Wextra -Wformat=2 -Wpointer-arith -Wsign-compare -Wunused-function -Wundef -Wunused-value -Wreturn-type -Wtrampolines -m64 -g -pipe -Wformat -Wno-cpp -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -std=gnu++98 -Wno-error -fno-delete-null-pointer-checks -fno-lifetime-dse -D_LITTLE_ENDIAN -DARCH='"amd64"' -Damd64 -D_LP64=1 -fno-omit-frame-pointer -fno-delete-null-pointer-checks -fno-lifetime-dse -fPIC -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -g -Wno-unused-parameter -Wno-unused -Wno-format -Wno-undef -Wno-unused-function -Wno-unused-value -O2 -DTHIS_FILE='"libTestJNIWeakG1.c"' -c -o /builddir/build/BUILD/java-12-openjdk-12.0.0.30-0.ea.1.rolling.fc29.1.x86_64/openjdk/build/support/test/hotspot/jtreg/native/support/libTestJNIWeakG1/libTestJNIWeakG1.o /builddir/build/BUILD/java-12-openjdk-12.0.0.30-0.ea.1.rolling.fc29.1.x86_64/openjdk/test/hotspot/jtreg/gc/g1/TestJNIWeakG1/libTestJNIWeakG1.c > >(/usr/bin/tee -a /builddir/build/BUILD/java-12-openjdk-12.0.0.30-0.ea.1.rolling.fc29.1.x86_64/openjdk/build/support/test/hotspot/jtreg/native/support/libTestJNIWeakG1/libTestJNIWeakG1.o.log) 2> >(/usr/bin/tee -a /builddir/build/BUILD/java-12-openjdk-12.0.0.30-0.ea.1.rolling.fc29.1.x86_64/openjdk/build/support/test/hotspot/jtreg/native/support/libTestJNIWeakG1/libTestJNIWeakG1.o.log >&2) || ( exitcode=$? && /usr/bin/cp /builddir/build/BUILD/java-12-openjdk-12.0.0.30-0.ea.1.rolling.fc29.1.x86_64/openjdk/build/support/test/hotspot/jtreg/native/support/libTestJNIWeakG1/libTestJNIWeakG1.o.log /builddir/build/BUILD/java-12-openjdk-12.0.0.30-0.ea.1.rolling.fc29.1.x86_64/openjdk/build/make-support/failure-logs/support_test_hotspot_jtreg_native_support_libTestJNIWeakG1_libTestJNIWeakG1.o.log && /usr/bin/cp /builddir/build/BUILD/java-12-openjdk-12.0.0.30-0.ea.1.rolling.fc29.1.x86_64/openjdk/build/support/test/hotspot/jtreg/native/support/libTestJNIWeakG1/libTestJNIWeakG1.o.cmdline /builddir/build/BUILD/java-12-openjdk-12.0.0.30-0.ea.1.rolling.fc29.1.x86_64/openjdk/build/make-support/failure-logs/support_test_hotspot_jtreg_native_support_libTestJNIWeakG1_libTestJNIWeakG1.o.cmdline && exit $exitcode ) ) BUILDSTDERR: JtregNativeHotspot.gmk:1518: Building /builddir/build/BUILD/java-12-openjdk-12.0.0.30-0.ea.1.rolling.fc29.1.x86_64/openjdk/build/support/test/hotspot/jtreg/native/support/libTestJNIWeakG1/libTestJNIWeakG1.o (from /builddir/build/BUILD/java-12-openjdk-12.0.0.30-0.ea.1.rolling.fc29.1.x86_64/openjdk/test/hotspot/jtreg/gc/g1/TestJNIWeakG1/libTestJNIWeakG1.c) (/builddir/build/BUILD/java-12-openjdk-12.0.0.30-0.ea.1.rolling.fc29.1.x86_64/openjdk/test/hotspot/jtreg/gc/g1/TestJNIWeakG1/libTestJNIWeakG1.c /builddir/build/BUILD/java-12-openjdk-12.0.0.30-0.ea.1.rolling.fc29.1.x86_64/openjdk/build/support/test/hotspot/jtreg/native/support/libTestJNIWeakG1/libTestJNIWeakG1.comp.vardeps newer) + /usr/bin/cp /builddir/build/BUILD/java-12-openjdk-12.0.0.30-0.ea.1.rolling.fc29.1.x86_64/openjdk/build/support/test/jdk/jtreg/native/support/libstringPlatformChars/libstringPlatformChars.o.cmdline /builddir/build/BUILD/java-12-openjdk-12.0.0.30-0.ea.1.rolling.fc29.1.x86_64/openjdk/build/make-support/failure-logs/support_test_jdk_jtreg_native_support_libstringPlatformChars_libstringPlatformChars.o.cmdline Compiling libCriticalNative.c (for libCriticalNative.so) + exit 1 BUILDSTDERR: gmake[3]: *** [JtregNativeJdk.gmk:87: /builddir/build/BUILD/java-12-openjdk-12.0.0.30-0.ea.1.rolling.fc29.1.x86_64/openjdk/build/support/test/jdk/jtreg/native/support/libstringPlatformChars/libstringPlatformChars.o] Error 1 .... cc1: warning: command line option '-std=gnu++98' is valid for C++/ObjC++ but not for C cc1: error: -Wformat-security ignored without -Wformat [-Werror=format-security] cc1: some warnings being treated as errors Removal of -Werror=format-security helps, however, it is considered a security risk, since we might miss some important warnings when omitting the flag. Expected results: Build is successful, no compilation errors. Additional info:
Is this failure happening in rawhide only? So far I don't seem to be able to reproduce on F29.
(In reply to Severin Gehwolf from comment #1) > Is this failure happening in rawhide only? So far I don't seem to be able to > reproduce on F29. OK, reproduced on F29. Somewhat expected it fails for the "test-image" target when configured with extra cflags like so: $ bash configure [...] --with-extra-cflags="-Wformat -Werror=format-security" --with-extra-cxxflags="-Wformat -Werror=format-security" [...] $ make [...] test-image It makes we wonder why we build these targets: 'bootcycle-images all docs'. I'd think 'bootcycle-images docs' would be sufficient? Do we actually package anything test image related? Doc for "all" target says: make all # Create all images: product, test, docs # (alias for all-images)
Nope. nothig test related is packed
Here is an alternative (possible) solution to this problem. Don't build the test image: https://src.fedoraproject.org/fork/jerboaa/rpms/java-openjdk/c/4b97f4ea5da579cd0c9d53f9fe7b4dbffc19a00a?branch=pr23-alt-fix Currently building here: https://koji.fedoraproject.org/koji/taskinfo?taskID=32742439 We'll see how that goes :)
It is hiding the issue :)
(In reply to jiri vanek from comment #5) > It is hiding the issue :) Sure. I agree. Though, it's unclear whether it's common for somebody to compile test libs with '-Wformat -Werror=format-security'. JDK libs, yes. Test libs, not sure. It might be that it'll get dismissed upstream. What I'm questioning here is whether it makes sense to compile the test image during the build as it's not being packaged anyway. That increases compile time for no good reason (test libs are then thrown away post-build).
(In reply to Severin Gehwolf from comment #4) > Currently building here: > https://koji.fedoraproject.org/koji/taskinfo?taskID=32742439 That failed on i686 with an unrelated failure. Trying again here: https://koji.fedoraproject.org/koji/taskinfo?taskID=32759135
FWIW, I'd go with the work-around for the following reasons: a) It reduces build time a bit (no longer compiles test libs needlessly) b) Bug filed upstream as https://bugs.openjdk.java.net/browse/JDK-8218814 So issue has been reported.
I'll close this bug as it has been worked around by not compiling the test image during build. See: https://koji.fedoraproject.org/koji/buildinfo?buildID=1209090 Feel free to re-open if you feel otherwise.