Mercurial > hg > truffle
comparison test/runtime/jsig/Test8017498.sh @ 14244:d85f79f0c476
8022301: [TESTBUG] runtime/jsig/Test8017498.sh incorrectly compiles native code
Summary: added the '-m32' compile option and the '-z noexecstack' link option
Reviewed-by: mseledtsov, zgu
author | ccheung |
---|---|
date | Thu, 09 Jan 2014 15:48:00 -0800 |
parents | e567d5afd4dd |
children | 5e7eb4244604 |
comparison
equal
deleted
inserted
replaced
14243:2cfad8cc3bab | 14244:d85f79f0c476 |
---|---|
1 #!/bin/sh | 1 #!/bin/sh |
2 | 2 |
3 # | 3 # |
4 # Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. | 4 # Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved. |
5 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. | 5 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
6 # | 6 # |
7 # This code is free software; you can redistribute it and/or modify it | 7 # This code is free software; you can redistribute it and/or modify it |
8 # under the terms of the GNU General Public License version 2 only, as | 8 # under the terms of the GNU General Public License version 2 only, as |
9 # published by the Free Software Foundation. | 9 # published by the Free Software Foundation. |
27 ## @ignore 8028806 | 27 ## @ignore 8028806 |
28 ## @test Test8017498.sh | 28 ## @test Test8017498.sh |
29 ## @bug 8017498 | 29 ## @bug 8017498 |
30 ## @bug 8020791 | 30 ## @bug 8020791 |
31 ## @bug 8021296 | 31 ## @bug 8021296 |
32 ## @bug 8022301 | |
32 ## @summary sigaction(sig) results in process hang/timed-out if sig is much greater than SIGRTMAX | 33 ## @summary sigaction(sig) results in process hang/timed-out if sig is much greater than SIGRTMAX |
33 ## @run shell/timeout=30 Test8017498.sh | 34 ## @run shell/timeout=30 Test8017498.sh |
34 ## | 35 ## |
35 | 36 |
36 if [ "${TESTSRC}" = "" ] | 37 if [ "${TESTSRC}" = "" ] |
39 echo "TESTSRC not set. Using "${TESTSRC}" as default" | 40 echo "TESTSRC not set. Using "${TESTSRC}" as default" |
40 fi | 41 fi |
41 echo "TESTSRC=${TESTSRC}" | 42 echo "TESTSRC=${TESTSRC}" |
42 ## Adding common setup Variables for running shell tests. | 43 ## Adding common setup Variables for running shell tests. |
43 . ${TESTSRC}/../../test_env.sh | 44 . ${TESTSRC}/../../test_env.sh |
45 | |
46 EXTRA_CFLAG= | |
44 | 47 |
45 # set platform-dependent variables | 48 # set platform-dependent variables |
46 OS=`uname -s` | 49 OS=`uname -s` |
47 case "$OS" in | 50 case "$OS" in |
48 Linux) | 51 Linux) |
55 if [ "$VM_BITS" = "64" ] | 58 if [ "$VM_BITS" = "64" ] |
56 then | 59 then |
57 MY_LD_PRELOAD=${TESTJAVA}${FS}jre${FS}lib${FS}amd64${FS}libjsig.so | 60 MY_LD_PRELOAD=${TESTJAVA}${FS}jre${FS}lib${FS}amd64${FS}libjsig.so |
58 else | 61 else |
59 MY_LD_PRELOAD=${TESTJAVA}${FS}jre${FS}lib${FS}i386${FS}libjsig.so | 62 MY_LD_PRELOAD=${TESTJAVA}${FS}jre${FS}lib${FS}i386${FS}libjsig.so |
63 EXTRA_CFLAG=-m32 | |
60 fi | 64 fi |
61 echo MY_LD_PRELOAD = ${MY_LD_PRELOAD} | 65 echo MY_LD_PRELOAD = ${MY_LD_PRELOAD} |
62 ;; | 66 ;; |
63 *) | 67 *) |
64 echo "Test passed; only valid for Linux" | 68 echo "Test passed; only valid for Linux" |
70 | 74 |
71 cp ${TESTSRC}${FS}*.java ${THIS_DIR} | 75 cp ${TESTSRC}${FS}*.java ${THIS_DIR} |
72 ${TESTJAVA}${FS}bin${FS}javac *.java | 76 ${TESTJAVA}${FS}bin${FS}javac *.java |
73 | 77 |
74 $gcc_cmd -DLINUX -fPIC -shared \ | 78 $gcc_cmd -DLINUX -fPIC -shared \ |
79 ${EXTRA_CFLAG} -z noexecstack \ | |
75 -o ${TESTSRC}${FS}libTestJNI.so \ | 80 -o ${TESTSRC}${FS}libTestJNI.so \ |
76 -I${TESTJAVA}${FS}include \ | 81 -I${TESTJAVA}${FS}include \ |
77 -I${TESTJAVA}${FS}include${FS}linux \ | 82 -I${TESTJAVA}${FS}include${FS}linux \ |
78 ${TESTSRC}${FS}TestJNI.c | 83 ${TESTSRC}${FS}TestJNI.c |
79 | 84 |