aboutsummaryrefslogtreecommitdiff
path: root/test/runtime/7107135/Test7107135.sh
diff options
context:
space:
mode:
Diffstat (limited to 'test/runtime/7107135/Test7107135.sh')
-rw-r--r--test/runtime/7107135/Test7107135.sh11
1 files changed, 10 insertions, 1 deletions
diff --git a/test/runtime/7107135/Test7107135.sh b/test/runtime/7107135/Test7107135.sh
index c28345643..d8ccbad19 100644
--- a/test/runtime/7107135/Test7107135.sh
+++ b/test/runtime/7107135/Test7107135.sh
@@ -27,6 +27,7 @@
##
## @test Test7107135.sh
## @bug 7107135
+## @bug 8021296
## @summary Stack guard pages lost after loading library with executable stack.
## @run shell Test7107135.sh
##
@@ -45,6 +46,11 @@ OS=`uname -s`
case "$OS" in
Linux)
echo "Testing on Linux"
+ gcc_cmd=`which gcc`
+ if [ "x$gcc_cmd" == "x" ]; then
+ echo "WARNING: gcc not found. Cannot execute test." 2>&1
+ exit 0;
+ fi
;;
*)
NULL=NUL
@@ -62,7 +68,10 @@ THIS_DIR=.
cp ${TESTSRC}${FS}*.java ${THIS_DIR}
${TESTJAVA}${FS}bin${FS}javac *.java
-gcc -fPIC -shared -c -o test.o -I${TESTJAVA}${FS}include -I${TESTJAVA}${FS}include${FS}linux ${TESTSRC}${FS}test.c
+$gcc_cmd -fPIC -shared -c -o test.o \
+ -I${TESTJAVA}${FS}include -I${TESTJAVA}${FS}include${FS}linux \
+ ${TESTSRC}${FS}test.c
+
ld -shared -z execstack -o libtest-rwx.so test.o
ld -shared -z noexecstack -o libtest-rw.so test.o