From cac97c41c20c9866baecefbdc53976af1475f0a1 Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Mon, 14 Mar 2022 15:38:04 -0700 Subject: gprofng: Skip jsynprog with a broken javac On CET enabled Linux/x86-64 machines, one can get $ javac simple.java Error: dl failure on line 894 Error: failed /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.322.b06-6.fc35.x86_64/jre/lib/amd64/server/libjvm.so, because /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.322.b06-6.fc35.x86_64/jre/lib/amd64/server/libjvm.so: rebuild shared object with SHSTK support enabled Set GPROFNG_BROKEN_JAVAC to "yes" only with a broken javac and skip the jsynprog test with a broken javac. PR gprofng/28965 * Makefile.am (GPROFNG_BROKEN_JAVAC): New. (check-DEJAGNU): Pass GPROFNG_BROKEN_JAVAC to runtest. * configure.ac (GPROFNG_BROKEN_JAVAC): New AC_SUBST. Set to yes with a broken javac. * Makefile.in: Regenerate. * configure: Likewise. * testsuite/gprofng.display/display.exp: Skip jsynprog with a broken javac. --- gprofng/configure | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) (limited to 'gprofng/configure') diff --git a/gprofng/configure b/gprofng/configure index 23a5dd8..983150f 100755 --- a/gprofng/configure +++ b/gprofng/configure @@ -645,6 +645,7 @@ TCL_TRY_FALSE TCL_TRY_TRUE EXPECT jdk_inc +GPROFNG_BROKEN_JAVAC JAVA JAVAC PTHREAD_CFLAGS @@ -12135,7 +12136,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 12138 "configure" +#line 12139 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -12241,7 +12242,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 12244 "configure" +#line 12245 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -16528,6 +16529,7 @@ fi fi +GPROFNG_BROKEN_JAVAC=no if test "x$enable_gprofng_jp" = x; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Cannot find the JDK include directory. gprofng will be build without support for profiling Java applications. @@ -16539,9 +16541,30 @@ else $as_echo "#define GPROFNG_JAVA_PROFILING 1" >>confdefs.h + if test "x$JAVAC" != x; then + cat > configtest.java << EOF +class Simple{ + public static void main(String args){ + System.out.println("Hello Java"); + } +} +EOF + if { ac_try='$JAVAC conftest.java &5 2>&1' + { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5 + (eval $ac_try) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then + GPROFNG_BROKEN_JAVAC=no + else + GPROFNG_BROKEN_JAVAC=yes + fi + rm -f configtest.* + fi fi + DEBUG= # Check whether --enable-gprofng-debug was given. if test "${enable_gprofng_debug+set}" = set; then : -- cgit v1.1