Merge "Make dt_runpath work for libraries opened from apk"
diff --git a/libc/arch-x86/bionic/setjmp.S b/libc/arch-x86/bionic/setjmp.S
index 8a2f30c..86e6e3c 100644
--- a/libc/arch-x86/bionic/setjmp.S
+++ b/libc/arch-x86/bionic/setjmp.S
@@ -151,9 +151,11 @@
 
   PIC_PROLOGUE
   pushl %eax
+  pushl %ecx
   pushl (_JB_SIGFLAG * 4)(%edx)
   call PIC_PLT(__bionic_setjmp_cookie_check)
   addl $4,%esp
+  popl %ecx
   popl %eax
   PIC_EPILOGUE
 
diff --git a/libc/arch-x86_64/bionic/setjmp.S b/libc/arch-x86_64/bionic/setjmp.S
index 09d61f5..56ebb07 100644
--- a/libc/arch-x86_64/bionic/setjmp.S
+++ b/libc/arch-x86_64/bionic/setjmp.S
@@ -159,8 +159,10 @@
 
   // Check the cookie.
   pushq %rax
+  pushq %r11
   movq %rcx, %rdi
   call PIC_PLT(__bionic_setjmp_cookie_check)
+  popq %r11
   popq %rax
 
   // Return 1 if value is 0.
diff --git a/tests/Android.mk b/tests/Android.mk
index 262be64..e2c4fb4 100644
--- a/tests/Android.mk
+++ b/tests/Android.mk
@@ -255,11 +255,6 @@
 
 libBionicCtsGtestMain_cppflags := $(test_cppflags) -DUSING_GTEST_OUTPUT_FORMAT \
 
-# Temporarily fix the job count to 1 for CTS since on some devices the
-# number of online cores is incorrectly read as the total number of cores
-# in the system. When b/24376925 is fixed, this should be removed.
-libBionicCtsGtestMain_cppflags += -DJOB_COUNT_FIXED=1
-
 module := libBionicCtsGtestMain
 module_tag := optional
 build_type := target
diff --git a/tests/gtest_main.cpp b/tests/gtest_main.cpp
index b79c8aa..3b9f6b9 100644
--- a/tests/gtest_main.cpp
+++ b/tests/gtest_main.cpp
@@ -100,7 +100,7 @@
          "      Don't use isolation mode, run all tests in a single process.\n"
          "  --deadline=[TIME_IN_MS]\n"
          "      Run each test in no longer than [TIME_IN_MS] time.\n"
-         "      It takes effect only in isolation mode. Deafult deadline is 60000 ms.\n"
+         "      It takes effect only in isolation mode. Deafult deadline is 90000 ms.\n"
          "  --warnline=[TIME_IN_MS]\n"
          "      Test running longer than [TIME_IN_MS] will be warned.\n"
          "      It takes effect only in isolation mode. Default warnline is 2000 ms.\n"
@@ -878,11 +878,7 @@
 }
 
 static size_t GetDefaultJobCount() {
-#if defined(JOB_COUNT_FIXED)
-  return JOB_COUNT_FIXED;
-#else
   return static_cast<size_t>(sysconf(_SC_NPROCESSORS_ONLN));
-#endif
 }
 
 static void AddPathSeparatorInTestProgramPath(std::vector<char*>& args) {
diff --git a/tests/time_test.cpp b/tests/time_test.cpp
index 052997a..c685e94 100644
--- a/tests/time_test.cpp
+++ b/tests/time_test.cpp
@@ -296,8 +296,8 @@
   Counter counter(Counter::CountAndDisarmNotifyFunction);
   ASSERT_EQ(0, counter.Value());
 
-  counter.SetTime(0, 1, 1, 0);
-  usleep(500000);
+  counter.SetTime(0, 500000000, 1, 0);
+  sleep(1);
 
   // The count should just be 1 because we disarmed the timer the first time it fired.
   ASSERT_EQ(1, counter.Value());
@@ -381,8 +381,8 @@
   ASSERT_EQ(0, counter2.Value());
   ASSERT_EQ(0, counter3.Value());
 
-  counter2.SetTime(0, 1, 0, 0);
-  usleep(500000);
+  counter2.SetTime(0, 500000000, 0, 0);
+  sleep(1);
 
   EXPECT_EQ(0, counter1.Value());
   EXPECT_EQ(1, counter2.Value());