Merge pull request #2907 from krytarowski/netbsd-support-7
authorAlexander Köplinger <alex.koeplinger@outlook.com>
Sun, 17 Apr 2016 18:07:38 +0000 (20:07 +0200)
committerAlexander Köplinger <alex.koeplinger@outlook.com>
Sun, 17 Apr 2016 18:07:38 +0000 (20:07 +0200)
Improve NetBSD target handling in ./configure

32 files changed:
configure.ac
external/referencesource
mcs/class/System/Test/System.Net.WebSockets/ClientWebSocketTest.cs
mono/metadata/threads.c
mono/tests/verifier/Makefile
mono/tests/verifier/make_access_test.sh
mono/tests/verifier/make_bad_op_test.sh
mono/tests/verifier/make_bin_test.sh
mono/tests/verifier/make_boxed_genarg_test.sh
mono/tests/verifier/make_branch_test.sh
mono/tests/verifier/make_call_test.sh
mono/tests/verifier/make_cmmp_test.sh
mono/tests/verifier/make_cpobj_test.sh
mono/tests/verifier/make_cross_nested_access_test.sh
mono/tests/verifier/make_ctor_test.sh
mono/tests/verifier/make_delegate_compat_test.sh
mono/tests/verifier/make_double_nesting_test.sh
mono/tests/verifier/make_exception_overlap_test.sh
mono/tests/verifier/make_field_store_test.sh
mono/tests/verifier/make_initobj_test.sh
mono/tests/verifier/make_ldobj_test.sh
mono/tests/verifier/make_localloc_test.sh
mono/tests/verifier/make_nested_access_test.sh
mono/tests/verifier/make_obj_store_test.sh
mono/tests/verifier/make_overlapped_test.sh
mono/tests/verifier/make_stobj_test.sh
mono/tests/verifier/make_switch_test.sh
mono/tests/verifier/make_tail_call_test.sh
mono/tests/verifier/make_tests.sh
mono/utils/mono-proclib.c
mono/utils/mono-sigcontext.h
scripts/ci/run-jenkins.sh

index 4661df1cee390f999ef6d4c5faf7aee4cea4e77e..d1f2fa9287624fa8d1c643307010d39344e06f8e 100644 (file)
@@ -92,11 +92,11 @@ case "$host" in
                host_win32=yes
                mono_cv_clang=no
                if test "x$cross_compiling" = "xno"; then
-                       if test "x$host" == "x$build" -a "x$host" == "x$target"; then
+                       if test "x$host" = "x$build" -a "x$host" = "x$target"; then
                                target_win32=yes
                        fi
                else
-                       if test "x$host" == "x$target"; then
+                       if test "x$host" = "x$target"; then
                                target_win32=yes
                        fi
                fi
@@ -2451,7 +2451,7 @@ fi
 AC_ARG_ENABLE(bcl-opt, [  --disable-bcl-opt    BCL is compiled with no optimizations (allows accurate BCL debugging)], test_bcl_opt=$enableval, test_bcl_opt=yes)
 
 AC_ARG_ENABLE(perf-events, [  --enable-perf-events Enable using `perf` for profiling on Linux], test_perf_events=$enableval, test_perf_events=no)
-if test "x$test_perf_events" == "xyes"; then
+if test "x$test_perf_events" = "xyes"; then
        AC_DEFINE(ENABLE_PERF_EVENTS, 1, [Enable using `perf` for profiling on Linux])
        AC_SUBST(ENABLE_PERF_EVENTS)
 fi
@@ -2613,7 +2613,7 @@ if test "x$enable_llvm" = "xyes"; then
    AC_MSG_CHECKING(LLVM version)
    AC_MSG_RESULT($llvm_version $llvm_api_version)
    if echo $llvm_version | grep -q 'mono'; then
-         if test "x$enable_llvm_version_check" == "xyes"; then
+         if test "x$enable_llvm_version_check" = "xyes"; then
                 if test "$llvm_version" != "$expected_llvm_version"; then
                        AC_MSG_ERROR([Expected llvm version $expected_llvm_version, but llvm-config --version returned $llvm_version"])
                 fi
@@ -2648,7 +2648,7 @@ if test "x$enable_llvm" = "xyes"; then
       llvm_jit_libs=""
    fi
    LLVM_LIBS=`$LLVM_CONFIG --libs analysis core bitwriter $llvm_jit_libs`
-   if test "x$LLVM_LIBS" == "x"; then
+   if test "x$LLVM_LIBS" = "x"; then
          echo "$LLVM_CONFIG --libs failed."
          exit 1
    fi
index 836ed963de7fc898e60062175babeca17e67520b..5b907267935346d2fe110d226bf3a62abcbd0dc6 160000 (submodule)
@@ -1 +1 @@
-Subproject commit 836ed963de7fc898e60062175babeca17e67520b
+Subproject commit 5b907267935346d2fe110d226bf3a62abcbd0dc6
index 715c748d1f5fe0cb703014e012db8fce842f0993..0638cb720b3a57d67b0879d93f72fce0a3bda685 100644 (file)
@@ -17,7 +17,7 @@ namespace MonoTests.System.Net.WebSockets
        [TestFixture]
        public class ClientWebSocketTest
        {
-               const string EchoServerUrl = "ws://echo.websocket.org";
+               const string EchoServerUrl = "ws://corefx-net.cloudapp.net/WebSocket/EchoWebSocket.ashx";
                int Port = NetworkHelpers.FindFreePort ();
                HttpListener listener;
                ClientWebSocket socket;
index 5b287062804ecc9f419b2b82186d9ce2ab9c4c96..b8d8ae5de713d94a86501f4e77931f31d6043165 100644 (file)
@@ -1634,7 +1634,8 @@ gint32 ves_icall_System_Threading_WaitHandle_WaitAll_internal(MonoArray *mono_ha
 
        g_free(handles);
 
-       return ret;
+       /* WAIT_FAILED in waithandle.cs is different from WAIT_FAILED in Win32 API */
+       return ret == WAIT_FAILED ? 0x7fffffff : ret;
 }
 
 /* FIXME: exitContext isnt documented */
@@ -1681,7 +1682,8 @@ gint32 ves_icall_System_Threading_WaitHandle_WaitAny_internal(MonoArray *mono_ha
                return ret - WAIT_ABANDONED_0;
        }
        else {
-               return ret;
+               /* WAIT_FAILED in waithandle.cs is different from WAIT_FAILED in Win32 API */
+               return ret == WAIT_FAILED ? 0x7fffffff : ret;
        }
 }
 
@@ -1705,7 +1707,8 @@ gint32 ves_icall_System_Threading_WaitHandle_WaitOne_internal(HANDLE handle, gin
        
        mono_thread_clr_state (thread, ThreadState_WaitSleepJoin);
        
-       return ret;
+       /* WAIT_FAILED in waithandle.cs is different from WAIT_FAILED in Win32 API */
+       return ret == WAIT_FAILED ? 0x7fffffff : ret;
 }
 
 gint32
@@ -1727,7 +1730,8 @@ ves_icall_System_Threading_WaitHandle_SignalAndWait_Internal (HANDLE toSignal, H
        
        mono_thread_clr_state (thread, ThreadState_WaitSleepJoin);
 
-       return ret;
+       /* WAIT_FAILED in waithandle.cs is different from WAIT_FAILED in Win32 API */
+       return ret == WAIT_FAILED ? 0x7fffffff : ret;
 }
 
 HANDLE ves_icall_System_Threading_Mutex_CreateMutex_internal (MonoBoolean owned, MonoString *name, MonoBoolean *created)
index c170df2714ec8499ac96e8391aaa2f1b8a583a01..b61302fec3a7ab135a8e1d1c19702d42ba60f44e 100644 (file)
@@ -1,19 +1,19 @@
 
 %.exe: %.cil
-       ilasm2 -out:$@ $<
+       ilasm -out:$@ $<
 
 BatchCompiler.exe: BatchCompiler.cs
-       gmcs -r:../../../mcs/class/lib/net_2_0/ilasm.exe BatchCompiler.cs
+       mcs -r:../../../mcs/class/lib/net_4_x/ilasm.exe BatchCompiler.cs
 
 test_lib.dll: test_lib.cs
-       gmcs test_lib.cs -target:library
+       mcs test_lib.cs -target:library
 
 compile-stamp: generate-stamp BatchCompiler.exe test_lib.dll
        for i in *.cs; do \
                EXE="`echo $$i | cut -d. -f1`.exe"; \
                DLL="`echo $$i | cut -d. -f1`.dll"; \
                if ! [ -f $$EXE ] && ! [ -f $$DLL ]; then \
-                       gmcs /unsafe $$i; \
+                       mcs /unsafe $$i; \
                fi \
        done 
        #MONO_PATH=../../../mcs/class/lib/net_2_0/ mono BatchCompiler.exe
@@ -42,7 +42,7 @@ run-test: compile-stamp
                then \
                        RES=3; \
                fi; \
-               if [ "$$FIRST" == "unverifiable" ] || [ "$FIRST" == "typeunverifiable" ]; \
+               if [ "$$FIRST" == "unverifiable" ] || [ "$$FIRST" == "typeunverifiable" ]; \
                then \
                        RES=2; \
                fi; \
@@ -56,37 +56,37 @@ run-test: compile-stamp
                fi; \
                if [ "$$FIRST" == "strict" ]; \
                then \
-                       #in strict more it must fail under strict check and pass under non-strict check \
+                       echo "#in strict more it must fail under strict check and pass under non-strict check" >/dev/null; \
                        ../../metadata/pedump --verify partial-md,error,warn,cls,code $$TEST.exe >/dev/null 2>/dev/null; \
                        R1=$$?; \
                        ../../metadata/pedump --verify partial-md,error,warn,cls,code,non-strict $$TEST.exe >/dev/null 2>/dev/null; \
                        R2=$$?; \
                        if [ $$R1 != 2 ] && [ $$R1 != 3 ]; then \
                                echo "$$TEST is strict but did not fail under strict check, got $${R1} but expected 2 or 3"; \
-                       fi \
-                       #non-strict result \
+                       fi; \
+                       echo "#non-strict result" >/dev/null; \
                        if [ $$R2 != 0 ]; then \
                                echo "$$TEST is strict but did not pass under non-strict check, got $${R2} but expected 0"; \
-                       fi \
+                       fi; \
                elif [ "$$FIRST" == "typeunverifiable" ]; then \
-                       #in type unverifiable more it must fail under verifiable mode but it's ok under valid mode \
+                       echo "#in type unverifiable more it must fail under verifiable mode but it's ok under valid mode" >/dev/null; \
                        ../../metadata/pedump --verify partial-md,error,warn,cls,code $$TEST.exe  >/dev/null 2>/dev/null; \
                        R1=$$?; \
                        ../../metadata/pedump --verify partial-md,error,warn,cls,code,valid-only $$TEST.exe  >/dev/null 2>/dev/null; \
                        R2=$$?; \
                        if [ $$R1 != 3 ]; then \
                                echo "$$TEST is type unverifiable but did not fail under verifiable check, got $${R1} but expected 3"; \
-                       fi \
-                       #type unverifiable result \
+                       fi; \
+                       echo "#type unverifiable result" >/dev/null; \
                        if [ $$R2 != 0 ]; then \
                                echo "$$TEST is type unverifiable but did not pass under non-strict check, got $${R2} but expected 0"; \
-                       fi \
+                       fi; \
                elif [ $$RES != 99 ]; then \
                        ../../metadata/pedump --verify partial-md,error,warn,cls,code $$TEST.exe >/dev/null 2>/dev/null; \
                        R=$$?; \
                        if [ $$R != $$RES ]; then \
                                echo "$$TEST failed expected $$RES but got $$R"; \
-                       fi \
+                       fi; \
                fi; \
        done
 
index bbbf83024848d1e285df2c10417a0125de7f4df8..72be8020ee54eb6d2d34905f68915604e0f0b700 100755 (executable)
@@ -13,7 +13,7 @@ TEST_MEMBER_ACCESS=$5
 TEST_EXTENDS=$6
 TEST_USE_SUB_CLASS=$7
 
-if [ "$TEST_EXTENDS" == "yes" ]; then
+if [ "$TEST_EXTENDS" = "yes" ]; then
        TEST_EXTENDS="extends Class"
        TEST_SUPER_TYPE="Class"
 else
@@ -21,7 +21,7 @@ else
        TEST_SUPER_TYPE="object"
 fi
 
-if [ "$TEST_USE_SUB_CLASS" == "yes" ]; then
+if [ "$TEST_USE_SUB_CLASS" = "yes" ]; then
        TEST_VAR_TYPE="ExampleClass"
 else
        TEST_VAR_TYPE="Class"
@@ -87,4 +87,4 @@ $SED -e "s/SUPER_TYPE/${TEST_SUPER_TYPE}/g" -e "s/VALIDITY/${TEST_VALIDITY}/g" -
                ret
        }
 }
-//EOF
\ No newline at end of file
+//EOF
index 73b79622f5b77461de8f3b3764aa7f87a692368e..4356497ea37651a6a257db532d0607c03b1017e5 100755 (executable)
@@ -11,7 +11,7 @@ TEST_BYTE_0=$3
 TEST_BYTE_1=$4
 
 
-if [ "$TEST_BYTE_1" == "" ] ; then
+if [ "x$TEST_BYTE_1" = "x" ] ; then
        TEST_BYTE_1="0";
 fi
 
index 5ebbbb99416c577541df95516d369ae1137f9e3c..019b453beb181e8a35fb69838eae9bca94dd06c3 100755 (executable)
@@ -12,7 +12,7 @@ TEST_TYPE2=$5
 TEST_INIT_EXP=$6
 TEST_INIT_VAL=$7
 
-if [ "$TEST_INIT_VAL" == "yes" ]; then
+if [ "$TEST_INIT_VAL" = "yes" ]; then
        TEST_INIT="$TEST_INIT_EXP\n\t\stloc.1"
 else
        TEST_INIT=""
@@ -50,4 +50,4 @@ $SED -e "s/INIT/${TEST_INIT}/g" -e "s/VALIDITY/${TEST_VALIDITY}/g" -e "s/TYPE1/$
        ldc.i4.0
        ret
 }
-//EOF
\ No newline at end of file
+//EOF
index 9522718a1c712f2e2d3417a8c7e756ca6a72c702..32428322b688a18ebd061db69c66814d75aa8634 100755 (executable)
@@ -11,7 +11,7 @@ TEST_OP=$3
 TEST_BEFORE_OP=$4
 TEST_CONSTRAINT_TYPE=$5
 
-if [ "$TEST_CONSTRAINT_TYPE" == "" ]; then
+if [ "x$TEST_CONSTRAINT_TYPE" = "x" ]; then
        TEST_CONSTRAINT_TYPE="IFace";
 fi
 
index 5ae54d3cafff22dcadeadfb4ba441fd7bc11e0e5..9ea87a414cfec29ca8edbf1d2964a82ff7eb7bde 100755 (executable)
@@ -11,7 +11,7 @@ TEST_POS=$3
 TEST_OP=$4
 TEST_FIN=$5
 
-if [ "$TEST_FIN" == "" ]; then
+if [ "x$TEST_FIN" = "x" ]; then
        TEST_FIN="finally";
 fi
 
index 884333b2accd748873009ebb8d6765c31824e362..08605a0f9cf29fca1648d502bb1e73b3d6839df4 100755 (executable)
@@ -12,7 +12,7 @@ TEST_LOAD_ARGS=$4
 TEST_INSTANCE_METHOD=$5
 TEST_EXTRA_STUFF=$6
 
-if [ "$TEST_INSTANCE_METHOD" == "instance" ]; then
+if [ "$TEST_INSTANCE_METHOD" = "instance" ]; then
        MEMBER_TEST_OP=$TEST_OP
        MEMBER_TEST_LOAD_ARGS=$TEST_LOAD_ARGS
        MEMBER_TEST_EXTRA_STUFF=$6
index 9e8894a709eb9ce5637d6cb040e5c37b59ad7e90..2687f0dfe687b95c2adf7b5a67b38d5de4cb7c9b 100755 (executable)
@@ -14,7 +14,7 @@ TEST_BEFORE_OP=$6
 
 echo $TEST_OP | grep unbox > /dev/null;
 
-if [ "$?" == "0" ]; then
+if [ $? -eq 0 ]; then
        TEST_CODE="
        ldloc.0
        box $TEST_TYPE";
index 008d485bedfb405f73a80212d3b7e52366041a33..5110b563ff63b3ca8c0b4f0cf2afcf2bf49c57e1 100755 (executable)
@@ -15,7 +15,7 @@ TEST_EXTRA_OPS=$6
 ZZ=`echo $TEST_TYPE1 | grep "\&"`
 T1_REF=$?
 
-if [ "$T1_REF" == "0" ]; then
+if [ $T1_REF -eq 0 ]; then
        T1_NO_REF=`echo $TEST_TYPE1 | cut -d '\' -f 1`
        INIT_LOCS=", $T1_NO_REF V_2"
        INIT_IL="ldloca.s 2\n\tstloc.0"
@@ -24,9 +24,9 @@ fi
 ZZ=`echo $TEST_TYPE2 | grep "\&"`
 T2_REF=$?
 
-if [ "$T2_REF" == "0" ]; then
+if [ $T2_REF -eq 0 ]; then
        T2_NO_REF=`echo $TEST_TYPE2 | cut -d '\' -f 1`
-       if [ "$T1_REF" == "0" ]; then
+       if [ $T1_REF -eq 0 ]; then
                INIT_LOCS="$INIT_LOCS , $T2_NO_REF V_3"
                INIT_IL="$INIT_IL \n\tldloca.s 3\n\tstloc.1"
        else
index e34c2fbe360238f2b8b8f28bf086f67327a50fee..b94b7e960bf38c25add04f1ed2177ab46c1e9c6e 100755 (executable)
@@ -14,7 +14,7 @@ TEST_EXTENDS=$6
 TEST_LOAD_BASE=$7
 
 
-if [ "$TEST_EXTENDS" == "yes" ]; then
+if [ "$TEST_EXTENDS" = "yes" ]; then
        TEST_EXTENDS="extends Owner\/Nested"
        TEST_CONSTRUCTOR="call instance void Owner\/Nested::.ctor()"
 else
@@ -22,7 +22,7 @@ else
        TEST_CONSTRUCTOR="call instance void object::.ctor()"
 fi
 
-if [ "$TEST_LOAD_BASE" == "yes" ]; then
+if [ "$TEST_LOAD_BASE" = "yes" ]; then
        TEST_LOAD_REF="ldarg.0"
 else
        TEST_LOAD_REF="call class Owner\/Nested Owner::Create ()"
index 81febde0c3046a92dd2316c866233f8d3b756ff8..6325f6167971059efb0444b3b09071e0ca490f70 100755 (executable)
@@ -13,7 +13,7 @@ TEST_TARGET_TYPE=$4
 TARGET_TYPE="Test"
 TEST_OTHER_CODE="call instance void TestClass::'.ctor'()"
 
-if [ "$TEST_TARGET_TYPE" == "other" ]; then
+if [ "$TEST_TARGET_TYPE" = "other" ]; then
        TARGET_TYPE="TestSubClass"
        TEST_OTHER_CODE=$TEST_CODE
        TEST_CODE=""
index a12b82c373a3279f9c89a3ed90403f7ee7f0d48c..31b8581fbe7f68025fde4127eb10511e796ab093 100755 (executable)
@@ -26,7 +26,7 @@ fi
 RET_2_LOCAL="$TEST_RET_TYPE2"
 RET_2_OP="ldloc 0"
 
-if [ "$TEST_RET_TYPE2" == "void" ]; then
+if [ "$TEST_RET_TYPE2" = "void" ]; then
        RET_2_LOCAL="int32"
        RET_2_OP="nop"
 fi
@@ -47,7 +47,7 @@ MANAGED_METHOD="
        }
 "
 
-if [ "$TEST_USE_NATIVE" == "pinvoke" ]; then
+if [ "$TEST_USE_NATIVE" = "pinvoke" ]; then
        LDFTN="ldftn $TCONV_2 ${TEST_RET_TYPE2} Driver::NativeMethod(${TEST_PARAM_TYPE2})"
        CALLVIRT="nop"
        MANAGED_METHOD=""
index 68bc551cf9fef66fbd3d9c291fb70dec22dc6daf..f6271e2fb9599ab7706dca36622187cf145fd1fc 100755 (executable)
@@ -16,7 +16,7 @@ TEST_NESTED_EXTENDS=$8
 TEST_LOAD_BASE=$9
 
 
-if [ "$TEST_BASE_EXTENDS" == "yes" ]; then
+if [ "$TEST_BASE_EXTENDS" = "yes" ]; then
        TEST_BASE_EXTENDS="extends Root"
        TEST_BASE_CONSTRUCTOR="call instance void Root::.ctor()"
 else
@@ -24,7 +24,7 @@ else
        TEST_BASE_CONSTRUCTOR="call instance void object::.ctor()"
 fi
 
-if [ "$TEST_NESTED_EXTENDS" == "yes" ]; then
+if [ "$TEST_NESTED_EXTENDS" = "yes" ]; then
        TEST_NESTED_EXTENDS="extends Root\/Nested"
        TEST_NESTED_CONSTRUCTOR="call instance void Root\/Nested::.ctor()"
 else
@@ -32,7 +32,7 @@ else
        TEST_NESTED_CONSTRUCTOR="call instance void object::.ctor()"
 fi
 
-if [ "$TEST_LOAD_BASE" == "yes" ]; then
+if [ "$TEST_LOAD_BASE" = "yes" ]; then
        TEST_LOAD_REF="ldarg.0"
 else
        TEST_LOAD_REF="call class Root\/Nested Root::Create ()"
index 284fadfd7e6d81c92e8bfb7c4ef7dc0887bbe103..0647eed5b19b73bad74a5401a8d7469b508a0dc7 100755 (executable)
@@ -12,7 +12,7 @@ TEST_BLOCK_2=$4
 TEST_WITH_FILTER_BLOCK=$5
 TEST_WITH_FINALLY_BLOCK=$6
 
-if [ "$TEST_WITH_FILTER_BLOCK" == "yes" ]; then
+if [ "$TEST_WITH_FILTER_BLOCK" = "yes" ]; then
        FILTER_BLOCK="
 FILTER_BLOCK_3:
        nop
@@ -35,7 +35,7 @@ else
        FILTER_BLOCK="";
 fi
 
-if [ "$TEST_WITH_FINALLY_BLOCK" == "yes" ]; then
+if [ "$TEST_WITH_FINALLY_BLOCK" = "yes" ]; then
        FINALLY_BLOCK="
 FINALLY_BLOCK_1:
        nop
index a50a5f4385c692cdc1fdf7068b681172c4cb40c9..8d72117ffc2918268a9c31695a832234e63e1f5f 100755 (executable)
@@ -11,7 +11,7 @@ TEST_OP=$3
 TEST_TYPE1=$4
 TEST_TYPE2=$5
 TEST_EMIT_CSTOR=$6
-if [ "${TEST_EMIT_CSTOR}" == "yes" ]; then
+if [ "${TEST_EMIT_CSTOR}" = "yes" ]; then
        TEST_CSTOR="newobj instance void ${TEST_TYPE2}::.ctor()";
 else
        TEST_CSTOR="ldloc.0";
index 3382ff99d6e279d332f4f7e4e5b312ca3a35330d..5b1e064afaa1862cffca7723282e622fcd79131f 100755 (executable)
@@ -14,7 +14,7 @@ ZZ=`echo $TEST_TYPE1 | grep "\&"`
 T1_REF=$?
 
 LOCAL_INIT="";
-if [ "$T1_REF" == "0" ]; then
+if [ $T1_REF -eq 0 ]; then
        T1_NO_REF=`echo $TEST_TYPE1 | cut -d '\' -f 1`
        INIT_LOCS=", $T1_NO_REF V_0"
        INIT_IL="ldloca.s 1\n\tstloc.0"
index c314cf297020215183136ba7073d23d29d2d9091..4a2f84a1ed6bd0796a57d3071e6bc7127ebf404d 100755 (executable)
@@ -13,7 +13,7 @@ ZZ=`echo $TEST_TYPE1 | grep "\&"`
 T1_REF=$?
 
 LOCAL_INIT="";
-if [ "$T1_REF" == "0" ]; then
+if [ $T1_REF -eq 0 ]; then
        T1_NO_REF=`echo $TEST_TYPE1 | cut -d '\' -f 1`
        INIT_LOCS=", $T1_NO_REF V_0"
        INIT_IL="ldloca.s 1\n\tstloc.0"
index 8a5016a7fd1d9b05af28ec1c5f38dd24f09d037c..e53849cf18cdf7ef5c216834689978a169786f81 100755 (executable)
@@ -16,14 +16,14 @@ TRY_END="
                leave END
        }"
 
-if [ "$TEST_BLOCK" == "catch" ]; then
+if [ "$TEST_BLOCK" = "catch" ]; then
        TRY_MIDDLE="
                leave END
        } catch [mscorlib]System.NullReferenceException {"
        TRY_END="
                leave END
        }"
-elif [ "$TEST_BLOCK" == "filter" ]; then
+elif [ "$TEST_BLOCK" = "filter" ]; then
        TRY_MIDDLE="
                leave END
        } filter {"
@@ -34,7 +34,7 @@ elif [ "$TEST_BLOCK" == "filter" ]; then
        } {
                leave END
        }"
-elif [ "$TEST_BLOCK" == "handler" ]; then
+elif [ "$TEST_BLOCK" = "handler" ]; then
        TRY_MIDDLE="
                leave END
        } filter {
@@ -45,14 +45,14 @@ elif [ "$TEST_BLOCK" == "handler" ]; then
        TRY_END="
                leave END
        }"
-elif [ "$TEST_BLOCK" == "finally" ]; then
+elif [ "$TEST_BLOCK" = "finally" ]; then
        TRY_MIDDLE="
                leave END
        } finally {"
        TRY_END="
                endfinally
        }"
-elif [ "$TEST_BLOCK" == "fault" ]; then
+elif [ "$TEST_BLOCK" = "fault" ]; then
        TRY_MIDDLE="
                leave END
        } fault {"
index d096e85256619db690df7a107f9561fe4fbc7fe1..5fd41668a68d9a3de2ddd20729a57698a6822095 100755 (executable)
@@ -12,7 +12,7 @@ TEST_CLASS_ACCESS=$4
 TEST_MEMBER_ACCESS=$5
 TEST_EXTENDS=$6
 
-if [ "$TEST_EXTENDS" == "yes" ]; then
+if [ "$TEST_EXTENDS" = "yes" ]; then
        TEST_EXTENDS="extends Owner"
        TEST_CONSTRUCTOR="call instance void Owner::.ctor()"
 else
@@ -108,4 +108,4 @@ $SED -e "s/VALIDITY/${TEST_VALIDITY}/g" -e "s/OPCODE/${TEST_OP}/g" -e "s/CONSTRU
        ldc.i4.0
        ret
 }
-//EOF
\ No newline at end of file
+//EOF
index f0d53366c87aead38e91afaadbbe1f8353553b04..6390c65695cdd7145260c10e6adae930871ced95 100755 (executable)
@@ -18,7 +18,7 @@ echo $TEST_FILE
 TEST_TYPE1=`echo $TEST_TYPE1 | $SED -s 's/&/\\\&/'`
 TEST_TYPE2=`echo $TEST_TYPE2 | $SED -s 's/&/\\\&/'`
 
-if [ "$TEST_CREATE_FIELD" == "no" ]; then
+if [ "$TEST_CREATE_FIELD" = "no" ]; then
        CLASS_FIELDS="";
 else
        CLASS_FIELDS=".field public ${TEST_TYPE1} fld\n .field public static ${TEST_TYPE1} sfld";
index baa46d38ae6d56e4973925cadeb8f8089763783c..239e27dc3b94c1fc0637879f4b3a655bbc46f86c 100755 (executable)
@@ -12,7 +12,7 @@ TEST_POS_1=$4
 TEST_POS_2=$5
 TEST_TYPE_0=$6
 
-if [ "$TEST_TYPE_0" == "" ] ; then
+if [ "x$TEST_TYPE_0" = "x" ] ; then
        TEST_TYPE_0="int32";
 fi
 
index 1bf078b35dd01625e2ca7b2c5a77be047a346a5e..d1859623b24e494a819f8769bf3e8fb7998d4b4f 100755 (executable)
@@ -16,7 +16,7 @@ ZZ=`echo $TEST_TYPE2 | grep "\&"`
 T2_REF=$?
 
 LOCAL_INIT="";
-if [ "$T2_REF" == "0" ]; then
+if [ $T2_REF -eq 0 ]; then
        T2_NO_REF=`echo $TEST_TYPE2 | cut -d '\' -f 1`
        INIT_LOCS=", $T2_NO_REF V_2"
        INIT_IL="ldloca.s 2\n\tstloc.1"
index 1767aa4816631a4d8c28061df434dab841a41e45..face162ef8ee56ef18209a364c00119c1f8c2f43 100755 (executable)
@@ -12,7 +12,7 @@ TEST_EXTRA=$4
 TEST_OP=$5
 TEST_FIN=$6
 
-if [ "$TEST_FIN" == "" ]; then
+if [ "x$TEST_FIN" = "x" ]; then
        TEST_FIN="finally";
 fi
 
index de58fa79f35f1a48a4231b067adf06ebb88a9061..82bdccdf81dedc4cb923d7e986e153440d03388d 100755 (executable)
@@ -12,7 +12,7 @@ TEST_LOAD_OP=$4
 TEST_TYPE=$5
 TEST_RET_TYPE=$6
 
-if [ "$TEST_RET_TYPE" == "" ]; then
+if [ "x$TEST_RET_TYPE" = "x" ]; then
        TEST_RET_TYPE="void"
 else
        LD_RET_CODE="ldloc.0"
index 270c2677b865aa6ed8f5c8ef218186c33b2ba785..25dd54a92576e995e679a27356d15ee6c9f19bea 100755 (executable)
@@ -25,7 +25,7 @@ done
 I=1
 for OP in add div mul rem sub
 do
-  if [ "$OP" == "div" ] || [ "$OP" == "rem" ]; then
+  if [ "$OP" = "div" ] || [ "$OP" = "rem" ]; then
        INIT="yes";
   else
        INIT="no";
@@ -92,7 +92,7 @@ done
 I=1
 for OP in div mul rem
 do
-  if [ "$OP" == "div" ] || [ "$OP" == "div" ]; then
+  if [ "$OP" = "div" ] || [ "$OP" = "div" ]; then
        INIT="yes";
   else
        INIT="no";
@@ -112,7 +112,7 @@ done
 I=1
 for OP in div mul rem add
 do
-  if [ "$OP" == "div" ] || [ "$OP" == "div" ]; then
+  if [ "$OP" = "div" ] || [ "$OP" = "div" ]; then
        INIT="yes";
   else
        INIT="no";
@@ -503,9 +503,9 @@ function fix () {
                A=$1;
        fi
 
-       if [ "$A" == "bool&" ]; then
+       if [ "$A" = "bool&" ]; then
                A="int8&";
-       elif [ "$A" == "char&" ]; then
+       elif [ "$A" = "char&" ]; then
                A="int16&";
        fi
 
@@ -522,11 +522,11 @@ do
                do
                        TA="$(fix $TYPE1)"
                        TB="$(fix $TYPE2)"
-                       if [ "$TA" == "$TB" ]; then
+                       if [ "$TA" = "$TB" ]; then
                                ./make_store_test.sh ref_coercion_${I} valid "$OP" "$TYPE1" "$TYPE2"
-                       elif [ "$TA" == "int32&" ] && [ "$TB" == "int&" ]; then
+                       elif [ "$TA" = "int32&" ] && [ "$TB" = "int&" ]; then
                                ./make_store_test.sh ref_coercion_${I} valid "$OP" "$TYPE1" "$TYPE2"
-                       elif [ "$TA" == "int&" ] && [ "$TB" == "int32&" ]; then
+                       elif [ "$TA" = "int&" ] && [ "$TB" = "int32&" ]; then
                                ./make_store_test.sh ref_coercion_${I} valid "$OP" "$TYPE1" "$TYPE2"
                        else
                                ./make_store_test.sh ref_coercion_${I} unverifiable "$OP" "$TYPE1" "$TYPE2"
@@ -545,7 +545,7 @@ do
                do
                        TA="$(fix $TYPE1)"
                        TB="$(fix $TYPE2)"
-                       if [ "$TA" == "$TB" ]; then
+                       if [ "$TA" = "$TB" ]; then
                                ./make_store_test.sh ref_coercion_${I} valid "$OP" "$TYPE1" "$TYPE2"
                        else
                                ./make_store_test.sh ref_coercion_${I} unverifiable "$OP" "$TYPE1" "$TYPE2"
@@ -561,7 +561,7 @@ do
        do
                for TYPE2 in 'class ClassA&' 'class ClassB&' 'class InterfaceA&' 'class InterfaceB&' 'class ValueType&'
                do
-                       if [ "$TYPE1" == "$TYPE2" ]; then
+                       if [ "$TYPE1" = "$TYPE2" ]; then
                                ./make_store_test.sh ref_coercion_${I} valid "$OP" "$TYPE1" "$TYPE2"
                        else
                                ./make_store_test.sh ref_coercion_${I} unverifiable "$OP" "$TYPE1" "$TYPE2"
@@ -791,17 +791,17 @@ do
        ZZ=`echo $TYPE2 | grep "*";`
        T2_PTR=$?
        
-    if (($T1_PTR == 0  ||  $T2_PTR == 0)); then
+    if [ $T1_PTR -eq 0 ] || [ $T2_PTR -eq 0 ]; then
                ./make_stack_merge_test.sh stack_merge_${I} unverifiable "$TYPE1" "$TYPE2"
-    elif [ "$TYPE1" == "$TYPE2" ]; then
+    elif [ "$TYPE1" = "$TYPE2" ]; then
                ./make_stack_merge_test.sh stack_merge_${I} valid "$TYPE1" "$TYPE2"
-       elif [ "$TYPE1" == "int32" ] && [ "$TYPE2" == "native int" ]; then
+       elif [ "$TYPE1" = "int32" ] && [ "$TYPE2" = "native int" ]; then
                ./make_stack_merge_test.sh stack_merge_${I} valid "$TYPE1" "$TYPE2"
-       elif [ "$TYPE1" == "native int" ] && [ "$TYPE2" == "int32" ]; then
+       elif [ "$TYPE1" = "native int" ] && [ "$TYPE2" = "int32" ]; then
                ./make_stack_merge_test.sh stack_merge_${I} valid "$TYPE1" "$TYPE2"
-       elif [ "$TYPE1" == "int32&" ] && [ "$TYPE2" == "native int&" ]; then
+       elif [ "$TYPE1" = "int32&" ] && [ "$TYPE2" = "native int&" ]; then
                ./make_stack_merge_test.sh stack_merge_${I} valid "$TYPE1" "$TYPE2"
-       elif [ "$TYPE1" == "native int&" ] && [ "$TYPE2" == "int32&" ]; then
+       elif [ "$TYPE1" = "native int&" ] && [ "$TYPE2" = "int32&" ]; then
                ./make_stack_merge_test.sh stack_merge_${I} valid "$TYPE1" "$TYPE2"
        else
                ./make_stack_merge_test.sh stack_merge_${I} unverifiable "$TYPE1" "$TYPE2"
@@ -1335,7 +1335,7 @@ do
        MAX_PARAM_RESULT="unverifiable"
        POPS="pop\npop\npop\npop\npop\npop\npop\npop\n"
        
-       if [ "$OP" == "ldloc" ]; then
+       if [ "$OP" = "ldloc" ]; then
                MAX_PARAM_RESULT="invalid"
 
                LOCALS_1=$ARGS_1
@@ -1892,7 +1892,7 @@ function create_nesting_test_same_result () {
       do
         for LOAD in yes no
         do
-          if ! ( [ "$NESTED" == "no" ] && [ "$LOAD" == "yes" ] ) ; then
+          if ! ( [ "$NESTED" = "no" ] && [ "$LOAD" = "yes" ] ) ; then
             ./make_double_nesting_test.sh double_nesting_access_check_${K}_$I $2 "$OP" $3 $4 $5 "$BASE" "$NESTED" "$LOAD"
             K=`expr $K + 1`
           fi
@@ -1910,9 +1910,9 @@ function create_nesting_test_only_first_ok () {
       do
         for LOAD in yes no
         do
-          if ! ( [ "$NESTED" == "no" ] && [ "$LOAD" == "yes" ] ) ; then
+          if ! ( [ "$NESTED" = "no" ] && [ "$LOAD" = "yes" ] ) ; then
               EXPECT=unverifiable
-           if [ "$FIRST" == "$K" ]; then
+           if [ "$FIRST" = "$K" ]; then
               EXPECT=valid
            fi
            ./make_double_nesting_test.sh double_nesting_access_check_${K}_$I $EXPECT "$OP" $2 $3 $4 "$BASE" "$NESTED" "$LOAD"
@@ -2065,7 +2065,7 @@ function create_nesting_test_strips_result_static () {
     for NESTED in yes no
       do
         EXPECT=unverifiable
-        if [ "$NESTED" == "yes" ]; then
+        if [ "$NESTED" = "yes" ]; then
           EXPECT=valid
         fi
         ./make_double_nesting_test.sh double_nesting_access_check_${K}_$I $EXPECT "$OP" $2 $3 $4 "$BASE" "$NESTED" yes
@@ -2188,9 +2188,9 @@ function fix_ldobj () {
                A=$1;
        fi
 
-       if [ "$A" == "bool" ]; then
+       if [ "$A" = "bool" ]; then
                A="int8";
-       elif [ "$A" == "char" ]; then
+       elif [ "$A" = "char" ]; then
                A="int16";
        fi
 
@@ -2207,7 +2207,7 @@ do
        do
                TYPE1="$(fix_ldobj $T1)"
                TYPE2="$(fix_ldobj $T2)"
-               if [ "$TYPE1" == "$TYPE2" ] ; then
+               if [ "$TYPE1" = "$TYPE2" ] ; then
                        ./make_ldobj_test.sh ldobj_${I} valid "${T1}\&" "${T2}"
                else
                        ./make_ldobj_test.sh ldobj_${I} unverifiable "${T1}\&" "${T2}"
@@ -2564,7 +2564,7 @@ I=1
 for TYPE1 in "int8" "bool" "int16" "char" "int32" "int64" "float64" "native int" "object" "string" "class Class" "valuetype MyStruct"  "int32[]" "int32[,]" "int32*" "method int32 *(int32)"  "class Template\`1<object>"
 do
        ./make_store_indirect_test.sh indirect_store_bad_addr_r4_${I} unverifiable "stind.r4" "${TYPE1}\&" "float32"
-       if [ "$TYPE1" == "float64" ]; then
+       if [ "$TYPE1" = "float64" ]; then
                ./make_store_indirect_test.sh indirect_store_good_val_r4_${I} valid "stind.r4" "float32\&" "${TYPE1}"
        else
                ./make_store_indirect_test.sh indirect_store_bad_val_r4_${I} unverifiable "stind.r4" "float32\&" "${TYPE1}"
@@ -2577,7 +2577,7 @@ I=1
 for TYPE1 in "int8" "bool" "int16" "char" "int32" "int64" "float32" "native int" "object" "string" "class Class" "valuetype MyStruct"  "int32[]" "int32[,]" "int32*" "method int32 *(int32)"  "class Template\`1<object>"
 do
        ./make_store_indirect_test.sh indirect_store_bad_addr_r8_${I} unverifiable "stind.r8" "${TYPE1}\&" "float64"
-       if [ "$TYPE1" == "float32" ]; then
+       if [ "$TYPE1" = "float32" ]; then
                ./make_store_indirect_test.sh indirect_store_good_val_r8_${I} valid "stind.r8" "float64\&" "${TYPE1}";
        else
                ./make_store_indirect_test.sh indirect_store_bad_val_r8_${I} unverifiable "stind.r8" "float64\&" "${TYPE1}";
@@ -3223,30 +3223,34 @@ done
 
 # Exception block branch tests (see 2.19)
 
-for I in {1..2};
+I=1; while [ $I -le 2 ]
 do
        ./make_rethrow_test.sh rethrow_from_catch_${I} invalid ${I}
+       I=$((I + 1))
 done
 
-for I in {3..10};
+I=3; while [ $I -le 10 ]
 do
        ./make_rethrow_test.sh rethrow_from_catch_${I} valid ${I}
+       I=$((I + 1))
 done
 
 
 
 # endfinally / endfault
 
-for I in {1..7};
+I=1; while [ $I -le 7 ]
 do
        ./make_endfinally_test.sh endfinally_block_${I} invalid finally ${I}
        ./make_endfinally_test.sh endfault_block_${I} invalid fault ${I}
+       I=$((I + 1))
 done
 
-for I in {8..9};
+I=8; while [ $I -le 9 ]
 do
        ./make_endfinally_test.sh endfinally_block_${I} valid finally ${I}
        ./make_endfinally_test.sh endfault_block_${I} valid fault ${I}
+       I=$((I + 1))
 done
 
 #stack can have stuff and endfinally or endfault will just empty it
@@ -3268,7 +3272,7 @@ done
 ./make_endfilter_test.sh endfilter_inside_protected_block_3 invalid 3 "ldc.i4.1\n\t\tendfilter"
 ./make_endfilter_test.sh endfilter_inside_protected_block_5 strict 5 "ldc.i4.1\n\t\tendfilter"
 
-for I in {2,4,6};
+for I in 2 4 6;
 do
        ./make_endfilter_test.sh endfilter_inside_protected_block_${I} unverifiable ${I} "ldc.i4.1\n\t\tendfilter"
 done
@@ -3302,9 +3306,9 @@ EXTRA="ldloc.0\n\tbrfalse END"
 ./make_leave_test.sh "filter_block_test_1" valid "1" "leave END" "$EXTRA"
 
 #but not ok to leave finally or filter
-for I in {2..3};
-do
+I=2; while [ $I -le 3 ]; do
        ./make_leave_test.sh "filter_block_test_${I}" unverifiable "${I}" "leave END" "${EXTRA}_${I}"
+       I=$((I + 1))
 done
 
 #neither is to branch to invalid regions of code
@@ -3314,24 +3318,27 @@ done
 
 # br.X
 #valid tests
-for I in {1..6}; do
+I=1; while [ $I -le 6 ]; do
        ./make_branch_test.sh branch_inside_same_block_${I} valid ${I} "br BLOCK_${I}";
        ./make_branch_test.sh branch_inside_same_block_${I}_s valid ${I} "br.s BLOCK_${I}";
+       I=$((I + 1))
 done
 
 #branching outside of the protected block
-for I in {2..6}; do
+I=2; while [ $I -le 6 ]; do
        ./make_branch_test.sh branch_outside_protected_block_${I} unverifiable ${I} "br END";
+       I=$((I + 1))
 done
 
 #branching to a protected block from the outside
-for I in {2..6}; do
-       if [ "$I" == "4" ]; then
+I=2; while [ $I -le 6 ]; do
+       if [ $I -eq 4 ]; then
                ./make_branch_test.sh branch_inside_protected_block_from_outside_${I}_finally invalid 1 "br BLOCK_${I}" "finally";
                ./make_branch_test.sh branch_inside_protected_block_from_outside_${I}_fault invalid 1 "br BLOCK_${I}" "fault";
        else
                ./make_branch_test.sh branch_inside_protected_block_from_outside_${I} unverifiable 1 "br BLOCK_${I}";
        fi
+       I=$((I + 1))
 done
 
 
@@ -3349,25 +3356,28 @@ done
 #TODO test the encoding of the switch table
 # switch
 #valid tests
-for I in {1..6}; do
+I=1; while [ $I -le 6 ]; do
        ./make_switch_test.sh switch_inside_same_block_${I} valid ${I} "ldloc.0" "switch (BLOCK_${I}, BLOCK_${I}_B)";
+       I=$((I + 1))
 done
 
 ./make_switch_test.sh switch_with_native_int_on_stack valid 1 "ldloc.1" "switch (BLOCK_1, BLOCK_1_B)";
 
 #branching outside of the protected block
-for I in {2..6}; do
+I=2; while [ $I -le 6 ]; do
        ./make_switch_test.sh switch_outside_protected_block_${I} unverifiable ${I} "ldloc.0" "switch (END, BLOCK_1, BLOCK_1_B)";
+       I=$((I + 1))
 done
 
 #branching to a protected block from the outside
-for I in {2..6}; do
-       if [ "$I" == "4" ]; then
+I=2; while [ $I -le 6 ]; do
+       if [ $I -eq 4 ]; then
                ./make_switch_test.sh switch_inside_protected_block_from_outside_${I}_finally invalid 1 "ldloc.0" "switch (BLOCK_${I}, BLOCK_${I}_B)" "finally";
                ./make_switch_test.sh switch_inside_protected_block_from_outside_${I}_fault invalid 1 "ldloc.0" "switch (BLOCK_${I}, BLOCK_${I}_B)" "fault";
        else
                ./make_switch_test.sh switch_inside_protected_block_from_outside_${I} unverifiable 1 "ldloc.0" "switch (BLOCK_${I}, BLOCK_${I}_B)";
        fi
+       I=$((I + 1))
 done
 
 #TODO branching out of range (FIX ilasm first)
@@ -4893,33 +4903,38 @@ done
 ./make_overlapped_test.sh ref_only_overlapping_5 invalid 0 0 8 int32
 
 #invalid opcodes
-for I in {166..178}
+I=166; while [ $I -le 178 ]
 do
        ./make_bad_op_test.sh bad_op_$I invalid $I
+       I=$((I + 1))
 done
 
 
-for I in {187..193}
+I=187; while [ $I -le 193 ]
 do
        ./make_bad_op_test.sh bad_op_$I invalid $I
+       I=$((I + 1))
 done
 
-for I in {196..207}
+I=196; while [ $I -le 207 ]
 do
        ./make_bad_op_test.sh bad_op_$I invalid $I
+       I=$((I + 1))
 done
 
-for I in {225..253}
+I=225; while [ $I -le 253 ]
 do
        ./make_bad_op_test.sh bad_op_$I invalid $I
+       I=$((I + 1))
 done
 
 ./make_bad_op_test.sh bad_op_xff invalid 255
 
 
-for I in {35..255}
+I=35; while [ $I -le 255 ]
 do
        ./make_bad_op_test.sh bad_op_with_prefix_$I invalid 0xFE $I
+       I=$((I + 1))
 done
 
 
@@ -5148,5 +5163,3 @@ done
 
 ./make_generic_argument_constraints_test.sh type_mixed_3 valid "" "(IfaceA)"
 ./make_generic_argument_constraints_test.sh type_mixed_4 valid "" "class (IfaceA)"
-
-
index 479655189b519be4c51a7b7c274679e8111970f5..7a4a02e39a3f7fea5ca4a441251215d75d406bf8 100644 (file)
@@ -27,6 +27,7 @@
 #if defined(_POSIX_VERSION)
 #include <sys/errno.h>
 #include <sys/param.h>
+#include <errno.h>
 #ifdef HAVE_SYS_TYPES_H
 #include <sys/types.h>
 #endif
index 15106129b7212e85ba809c4a9a13b16332e0d18e..3c2f79b58c37e99ac92e90325b6f603118182aaa 100644 (file)
@@ -201,6 +201,10 @@ typedef struct ucontext {
        #define UCONTEXT_REG_RSI(ctx) (((ucontext_t*)(ctx))->uc_mcontext.__gregs [_REG_RSI])
        #define UCONTEXT_REG_RDI(ctx) (((ucontext_t*)(ctx))->uc_mcontext.__gregs [_REG_RDI])
        #define UCONTEXT_REG_RIP(ctx) (((ucontext_t*)(ctx))->uc_mcontext.__gregs [_REG_RIP])
+       #define UCONTEXT_REG_R8(ctx)  (((ucontext_t*)(ctx))->uc_mcontext.__gregs [_REG_R8])
+       #define UCONTEXT_REG_R9(ctx)  (((ucontext_t*)(ctx))->uc_mcontext.__gregs [_REG_R9])
+       #define UCONTEXT_REG_R10(ctx) (((ucontext_t*)(ctx))->uc_mcontext.__gregs [_REG_R10])
+       #define UCONTEXT_REG_R11(ctx) (((ucontext_t*)(ctx))->uc_mcontext.__gregs [_REG_R11])
        #define UCONTEXT_REG_R12(ctx) (((ucontext_t*)(ctx))->uc_mcontext.__gregs [_REG_R12])
        #define UCONTEXT_REG_R13(ctx) (((ucontext_t*)(ctx))->uc_mcontext.__gregs [_REG_R13])
        #define UCONTEXT_REG_R14(ctx) (((ucontext_t*)(ctx))->uc_mcontext.__gregs [_REG_R14])
@@ -351,6 +355,27 @@ typedef struct ucontext {
        #define UCONTEXT_REG_R11(ctx) (((arm_ucontext*)(ctx))->sig_ctx.arm_fp)
        #define UCONTEXT_REG_R12(ctx) (((arm_ucontext*)(ctx))->sig_ctx.arm_ip)
        #define UCONTEXT_REG_CPSR(ctx) (((arm_ucontext*)(ctx))->sig_ctx.arm_cpsr)
+#elif defined(__NetBSD__)
+       typedef ucontext_t arm_ucontext;
+
+       #define UCONTEXT_REG_PC(ctx) (((ucontext_t*)(ctx))->uc_mcontext.__gregs[_REG_PC])
+       #define UCONTEXT_REG_SP(ctx) (((ucontext_t*)(ctx))->uc_mcontext.__gregs[_REG_SP])
+       #define UCONTEXT_REG_LR(ctx) (((ucontext_t*)(ctx))->uc_mcontext.__gregs[_REG_LR])
+       #define UCONTEXT_REG_R0(ctx) (((ucontext_t*)(ctx))->uc_mcontext.__gregs[_REG_R0])
+       #define UCONTEXT_REG_R1(ctx) (((ucontext_t*)(ctx))->uc_mcontext.__gregs[_REG_R1])
+       #define UCONTEXT_REG_R2(ctx) (((ucontext_t*)(ctx))->uc_mcontext.__gregs[_REG_R2])
+       #define UCONTEXT_REG_R3(ctx) (((ucontext_t*)(ctx))->uc_mcontext.__gregs[_REG_R3])
+       #define UCONTEXT_REG_R4(ctx) (((ucontext_t*)(ctx))->uc_mcontext.__gregs[_REG_R4])
+       #define UCONTEXT_REG_R5(ctx) (((ucontext_t*)(ctx))->uc_mcontext.__gregs[_REG_R5])
+       #define UCONTEXT_REG_R6(ctx) (((ucontext_t*)(ctx))->uc_mcontext.__gregs[_REG_R6])
+       #define UCONTEXT_REG_R7(ctx) (((ucontext_t*)(ctx))->uc_mcontext.__gregs[_REG_R7])
+       #define UCONTEXT_REG_R8(ctx) (((ucontext_t*)(ctx))->uc_mcontext.__gregs[_REG_R8])
+       #define UCONTEXT_REG_R9(ctx) (((ucontext_t*)(ctx))->uc_mcontext.__gregs[_REG_R9])
+       #define UCONTEXT_REG_R10(ctx) (((ucontext_t*)(ctx))->uc_mcontext.__gregs[_REG_R10])
+       #define UCONTEXT_REG_R11(ctx) (((ucontext_t*)(ctx))->uc_mcontext.__gregs[_REG_R11])
+       #define UCONTEXT_REG_R12(ctx) (((ucontext_t*)(ctx))->uc_mcontext.__gregs[_REG_R12])
+       #define UCONTEXT_REG_CPSR(ctx) (((ucontext_t*)(ctx))->uc_mcontext.__gregs[_REG_CPSR])
+       #define UCONTEXT_REG_VFPREGS(ctx) (((ucontext_t*)(ctx))->uc_mcontext.__gregs[_REG_VFPREGS])
 #endif
 
 #elif defined(TARGET_ARM64)
index 7e999c540bf90dfba14b4919b15239ca685b8a39..81945bfc56e397dffa4f02476da4351f7c5b4024 100755 (executable)
@@ -15,6 +15,12 @@ if [[ ${label} != w* ]] && [[ ${label} != 'debian-ppc64el' ]] && [[ ${label} !=
     # only enable the mobile profiles and mobile_static on the main architectures
 fi
 
+if [ -x "/usr/bin/dpkg-architecture" ];
+       then
+       EXTRA_CONF_FLAGS="$EXTRA_CONF_FLAGS --host=`/usr/bin/dpkg-architecture -qDEB_HOST_GNU_TYPE`"
+       #force build arch = dpkg arch, sometimes misdetected
+fi
+
 ${TESTCMD} --label=configure --timeout=60m --fatal ./autogen.sh $EXTRA_CONF_FLAGS
 if [[ ${label} == w* ]];
     then