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.
This commit is contained in:
H.J. Lu 2022-03-14 15:38:04 -07:00
parent 0e30a3b0f2
commit cac97c41c2
5 changed files with 53 additions and 3 deletions

View File

@ -41,6 +41,7 @@ LD_NO_AS_NEEDED = @LD_NO_AS_NEEDED@
GPROFNG_CFLAGS = @GPROFNG_CFLAGS@
GPROFNG_CPPFLAGS = @GPROFNG_CPPFLAGS@
GPROFNG_LIBDIR = @GPROFNG_LIBDIR@
GPROFNG_BROKEN_JAVAC = @GPROFNG_BROKEN_JAVAC@
AM_MAKEFLAGS = \
jdk_inc="$(jdk_inc)" \
@ -59,6 +60,7 @@ check-DEJAGNU: site.exp development.exp
runtest=$(RUNTEST); \
if $(SHELL) -c "$$runtest --version" > /dev/null 2>&1; then \
$$runtest --tool $(DEJATOOL) --srcdir $${srcroot}/testsuite \
GPROFNG_BROKEN_JAVAC="$(GPROFNG_BROKEN_JAVAC)" \
MAKE="$(MAKE)" CC="$(CC)" CFLAGS="$(CFLAGS) $(PTHREAD_CFLAGS)" \
LDFLAGS="$(LDFLAGS)" LIBS="$(PTHREAD_LIBS) $(LIBS)" \
BUILDDIR="$(abs_top_builddir)" $(RUNTESTFLAGS); \

View File

@ -262,6 +262,7 @@ EXEEXT = @EXEEXT@
# Setup the testing framework, if you have one
EXPECT = expect
FGREP = @FGREP@
GPROFNG_BROKEN_JAVAC = @GPROFNG_BROKEN_JAVAC@
GPROFNG_CFLAGS = @GPROFNG_CFLAGS@
GPROFNG_CPPFLAGS = @GPROFNG_CPPFLAGS@
GPROFNG_LIBADD = @GPROFNG_LIBADD@
@ -934,6 +935,7 @@ uninstall-am:
@TCL_TRY_TRUE@ runtest=$(RUNTEST); \
@TCL_TRY_TRUE@ if $(SHELL) -c "$$runtest --version" > /dev/null 2>&1; then \
@TCL_TRY_TRUE@ $$runtest --tool $(DEJATOOL) --srcdir $${srcroot}/testsuite \
@TCL_TRY_TRUE@ GPROFNG_BROKEN_JAVAC="$(GPROFNG_BROKEN_JAVAC)" \
@TCL_TRY_TRUE@ MAKE="$(MAKE)" CC="$(CC)" CFLAGS="$(CFLAGS) $(PTHREAD_CFLAGS)" \
@TCL_TRY_TRUE@ LDFLAGS="$(LDFLAGS)" LIBS="$(PTHREAD_LIBS) $(LIBS)" \
@TCL_TRY_TRUE@ BUILDDIR="$(abs_top_builddir)" $(RUNTESTFLAGS); \

27
gprofng/configure vendored
View File

@ -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 :

View File

@ -128,13 +128,30 @@ fi
if test "x$enable_gprofng_jp" = x; then
AC_CHECK_HEADER([jni.h], [ enable_gprofng_jp=yes ], [], [] )
fi
GPROFNG_BROKEN_JAVAC=no
if test "x$enable_gprofng_jp" = x; then
AC_MSG_WARN([ Cannot find the JDK include directory.
gprofng will be build without support for profiling Java applications.
Use --with-jdk=PATH to specify directory for the installed JDK])
else
AC_DEFINE(GPROFNG_JAVA_PROFILING, 1, [Enable java profiling])
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_COMMAND($JAVAC conftest.java &AS_MESSAGE_LOG_FD 2>&1); then
GPROFNG_BROKEN_JAVAC=no
else
GPROFNG_BROKEN_JAVAC=yes
fi
rm -f configtest.*
fi
fi
AC_SUBST(GPROFNG_BROKEN_JAVAC)
AC_SUBST(jdk_inc)
DEBUG=

View File

@ -68,6 +68,8 @@ switch $pltf {
}
}
global GPROFNG_BROKEN_JAVAC
foreach line $table {
set dir [lindex $line 0]
set cflags [lindex $line 1]
@ -75,7 +77,11 @@ foreach line $table {
verbose [file rootname $line]
verbose running display test $line
run_display_test $dir $cflags $gprofflags
if { $GPROFNG_BROKEN_JAVAC == "yes" && $dir == "jsynprog" } {
unsupported $dir
} else {
run_display_test $dir $cflags $gprofflags
}
}