Merge "Fix ndk-build warning in windows"
diff --git a/build/core/clear-vars.mk b/build/core/clear-vars.mk
index e9ad319..08c3b19 100644
--- a/build/core/clear-vars.mk
+++ b/build/core/clear-vars.mk
@@ -20,3 +20,6 @@
# Note: As a special exception, we don't want to clear LOCAL_PATH
$(call clear-vars, $(filter-out LOCAL_PATH,$(modules-LOCALS:%=LOCAL_%)))
+
+# strip LOCAL_PATH
+LOCAL_PATH := $(strip $(LOCAL_PATH))
diff --git a/build/tools/build-host-perl.sh b/build/tools/build-host-perl.sh
index 9a7e5c0..27fefa4 100755
--- a/build/tools/build-host-perl.sh
+++ b/build/tools/build-host-perl.sh
@@ -91,6 +91,8 @@
run copy_directory "$SRC_DIR/perl/perl-$PERL_VERSION" "$BUILD_OUT"
fail_panic "Could not copy perl source $SRC_DIR/perl/perl-$PERL_VERSION to build directory $BUILD_OUT"
+LIBS_SEARCH=`$CC -print-search-dirs | grep libraries | sed ' s/^.*=// ' | sed ' s/:/ /g '`
+
cd $BUILD_OUT &&
CFLAGS=$HOST_CFLAGS" -O2 -s" &&
run ./Configure \
@@ -99,6 +101,7 @@
-Dcc="$CC" \
-Dcc_as_ld \
-Dccflags="$CFLAGS" \
+ -A prepend:libpth="$LIBS_SEARCH" \
fail_panic "Failed to configure the perl-$PERL_VERSION build!"
log "Building perl"
diff --git a/build/tools/dev-cleanup.sh b/build/tools/dev-cleanup.sh
index 2c123dc..ea52b83 100755
--- a/build/tools/dev-cleanup.sh
+++ b/build/tools/dev-cleanup.sh
@@ -35,7 +35,6 @@
# Remove generated directories
rm -rf $DIR/platforms
rm -rf $DIR/toolchains/*/prebuilt
-rm -rf $DIR/toolchains/llvm*
rm -rf $DIR/samples
rm -rf $DIR/prebuilt
diff --git a/build/tools/download-toolchain-sources.sh b/build/tools/download-toolchain-sources.sh
index ff222d2..68d7e49 100755
--- a/build/tools/download-toolchain-sources.sh
+++ b/build/tools/download-toolchain-sources.sh
@@ -147,7 +147,7 @@
run ln -s "$GITPREFIX/$1" $CLONE_DIR/$1.git
else
log "cloning $GITPREFIX/$1.git"
- (cd $CLONE_DIR && run git clone $GITFLAGS $GITPREFIX/$1.git)
+ (cd $CLONE_DIR && run $GITCMD clone $GITFLAGS $GITPREFIX/$1.git)
fi
fail_panic "Could not clone $GITPREFIX/$1.git ?"
}
@@ -168,16 +168,16 @@
log "Checking out $BRANCH branch of $NAME.git: $@"
local REVISION=origin/$BRANCH
if [ -n "$GIT_DATE" ] ; then
- REVISION=`git $GITOPTS rev-list -n 1 --until="$GIT_DATE" $REVISION`
+ REVISION=`$GITCMD $GITOPTS rev-list -n 1 --until="$GIT_DATE" $REVISION`
fi
- (mkdir -p $TMPDIR/$SUBDIR/$NAME && cd $TMPDIR/$SUBDIR/$NAME && run git $GITOPTS checkout $REVISION "$@")
+ (mkdir -p $TMPDIR/$SUBDIR/$NAME && cd $TMPDIR/$SUBDIR/$NAME && run $GITCMD $GITOPTS checkout $REVISION "$@")
fail_panic "Could not checkout $NAME / $@ ?"
if [ "$BRANCH" = "master" ]; then
BRANCH=
else
BRANCH="($BRANCH)"
fi
- (printf "%-32s " "toolchain/$NAME.git $BRANCH"; git $GITOPTS log -1 --format=oneline $REVISION) >> $SOURCES_LIST
+ (printf "%-32s " "toolchain/$NAME.git $BRANCH"; $GITCMD $GITOPTS log -1 --format=oneline $REVISION) >> $SOURCES_LIST
}
cd $TMPDIR
diff --git a/docs/CHANGES.html b/docs/CHANGES.html
index 7e43198..2273f35 100644
--- a/docs/CHANGES.html
+++ b/docs/CHANGES.html
@@ -1,6 +1,294 @@
<html><body><pre>Android NDK ChangeLog:
-------------------------------------------------------------------------------
+android-ndk-r8e
+
+IMPORTANT CHANGES:
+
+- NDK now delivers additional 64-bit host toolchain set (package name suffix
+ *-x86_64.*)
+ 1. The ndk-build script uses 64-bit toolchain if it's present and your OS
+ supports it. If you install both 32-bit and 64-bit toolchain on 64-bit
+ OS, you may export NDK_HOST_32BIT=1 or add it to the command-line to
+ always use the 32-bit host toolchain.
+ 2. For standalone: add to make-standalone-toolchain.sh "--system=linux-x86_64"
+ on Linux or "--system=darwin-x86_64" on MacOSX to generate 64-bit host
+ toolchain instead of the default 32-bit
+
+ See NDK-BUILD.html
+
+- Added Clang 3.2 compiler. Since GCC 4.6 is still the default, you need to
+ explicitly enable it:
+ 1. For ndk-build: Either export NDK_TOOLCHAIN_VERSION=clang3.2 (or
+ NDK_TOOLCHAIN_VERSION=clang which picks the most recent among the
+ clang compilers in the package) or add it in Application.mk.
+ 2. For standalone: Add "--llvm-version=3.2" to make-standalone-toolchain.sh
+ and replace CC and CXX in your makefile with <tool-path>/bin/clang
+ and <tool-path>/bin/clang++.
+
+- Added static code analyzer for Linux/MacOSX hosts
+ 1. For ndk-build, either export NDK_ANALYZE=1 or add it to the command-line.
+ 2. For standalone, please refer to ndk-build for example to run scan-build
+ using /path/to/standalone/bin/<arch>/analyzer.
+
+ This feature is experimental now but welcome to try and report issues.
+
+- Added MCLinker for for Linux/MacOSX hosts. Since ld.gold is the default
+ where available, you need to add -fuse-ld=mcld in LOCAL_LDFLAGS or
+ APP_LDFLAGS to explicitly enable it.
+
+ This feature is experimental now but welcome to try and report issues.
+ Please find project page: https://code.google.com/p/mclinker/
+
+- Enabled OpenMP for GCC 4.4.3/4.6/4.7: Add the following flags
+ LOCAL_CFLAGS += -fopenmp
+ LOCAL_LDFLAGS += -fopenmp
+
+ Please find examples in tests/device/test-openmp
+
+- ndk-build now uses topological sort for module dependencies, ie.
+ it automatically sorts out the order of libraries specified in
+ LOCAL_STATIC_LIBRARIES, LOCAL_WHOLE_STATIC_LIBRARIES and
+ LOCAL_SHARED_LIBRARIES.
+
+ See http://b.android.com/39378
+ and an example in tests/build/topological-sort.
+
+
+IMPORTANT BUG FIXES:
+
+- Fixed build script to build all toolchains in -O2. Toolchains
+ in previous releases were incorrectly built without optimization.
+
+- Fixed build script which unconditionally builds Clang/llvm for MacOSX
+ in 64-bit
+
+- Fixed GCC 4.6/4.7 ICE gen_thumb_movhi_clobber at config/arm/arm.md:5832
+ See http://b.android.com/52732
+
+- Fixed GCC/ARM 4.6/4.7 fails to link code using 64-bit atomic built-in
+ See http://b.android.com/41297
+
+- Fixed GCC 4.7 linker error reads like
+ .../arm-linux-androideabi/bin/ld: error: DIV usage mismatch between
+ out/target/product/generic/obj/STATIC_LIBRARIES/ds_intermediates/ds.a(ak.o)
+ and output
+
+ See http://sourceware.org/ml/binutils/2012-12/msg00202.html
+
+- Fixed GCC 4.7 ICE in build_data_member_initialization, at
+ cp/semantics.c:5790
+
+- Fixed GCC 4.7 ICE in redirect_eh_edge_1, at tree-eh.c:2214
+ See http://b.android.com/52909
+
+- Fixed a GCC 4.7 segfault
+ See http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55245
+
+- Fixed to <chrono> clock resolution and enable steady_clock
+ See http://b.android.com/39680
+
+- Fixed to enable _GLIBCXX_HAS_GTHREADS for GCC 4.7 libstdc++
+ See http://b.android.com/41770 and http://b.android.com/41859
+
+- Fixed X86 MXX/SSE code fails to link due to missing posix_memalign
+ See https://android-review.googlesource.com/#/c/51872
+
+- Fixed GCC4.7/X86 segfault in i386.c distance_non_agu_define_in_bb()
+ See https://android-review.googlesource.com/#/c/50383
+
+- Fixed GCC4.7/X86 to resotre earlier cmov behavior
+ See http://gcc.gnu.org/viewcvs?view=revision&revision=193554
+
+- More fixes to handle NULL return value of setlocale() in
+ libstdc++/GCC4.7
+ See http://b.android.com/46718
+
+- Fixed ld.gold runtime undefined reference to __exidx_start/_end
+ See https://android-review.googlesource.com/#/c/52134
+
+- Fixed Clang3.1 ICE using Eigen library
+ See http://b.android.com/41246
+
+- Fixed Clang3.1 ICE including <chrono> in C++11 mode
+ See http://b.android.com/39600
+
+- Fixed Clang3.1 ICE when generating object code for a method
+ call to a uniform initialized rvalue
+ See http://b.android.com/41387
+
+- Fixed Clang3.1/X86 stack realignment
+ See https://android-review.googlesource.com/#/c/52154
+
+- Fixed GDB SIGILL when debugging on platform 4.1.2
+ See http://b.android.com/40941
+
+- Fixed GDB cannot set "source:line" breakpoints when symbols contain
+ frankenpaths
+ See http://b.android.com/42448
+
+- Fixed GDB read_program_header for MIPS PIE executables
+ See https://android-review.googlesource.com/#/c/49592
+
+- Fixed STLport segfault in uncaught_exception()
+ See https://android-review.googlesource.com/#/c/50236
+
+- Fixed STLport Bus error in exception handling due
+ to unaligned access of DW_EH_PE_udata2, 4 and 8.
+
+- Fixed Gabi++ nothrow new[] infinite recursion.
+ See http://b.android.com/52833
+
+- Fixed Gabi++ wrong offset to EH pointer
+ See https://android-review.googlesource.com/#/c/53446
+
+- Removed Gabi++ redundant free on exception object
+ See https://android-review.googlesource.com/#/c/53447
+
+
+OTHER BUG FIXES:
+
+- Fix NDK headers
+ 1. Remove redundant definitions of size_t, ssize_t, and ptrdiff_t
+ 2. Fixed MIPS and ARM fenv.h
+ 3. Fixed stddef.h to not re-define offsetof already exists
+ in toolchain
+ 4. Fixed elf.h to contain Elf32_auxv_t and Elf64_auxv_t
+ See http://b.android.com/38441
+ 5. Fixed the #ifdef C++ in OpenSLES_AndroidConfiguration.h
+ See http://b.android.com/53163
+
+- Fixed STLport to abort after OOM instead of (silent) exit
+
+- Fixed 'system' and 'Gabi++' headers to be able to compile
+ with API level < 9
+
+- Fixed cpufeatures to not parse /proc/self/auxv
+ See http://b.android.com/43055
+
+- Fixed ld.gold to not depending on host libstdc++, and in case
+ of windows, library libgcc_sjlj_1.dll
+
+- Fixed Clang3.1 which emits inconsistent register list in .vsave
+ and fails assembler. eg.
+ .vsave {d8, d9, d10, d11, d12, d13, d14, s20, s21, s22}
+ See https://android-review.googlesource.com/#/c/49930
+
+- Fixed Clang3.1 to be able to compile libgabi++ and pass test-stlport
+ on MIPS
+ See https://android-review.googlesource.com/#/c/51961
+
+- Fixed Clang3.1 to only enable exception by default for C++,
+ not for C
+
+- Misc fixes in Clang3.1 to pass most GNU exception tests
+
+- Fixed script clang/clang++ in standalone NDK compiler to
+ detect -cc1 and don't specify "-target" when found
+
+- Fixed ndk-build to observe NDK_APP_OUT set in Application.mk
+
+- Fixed X86 libc.so/lib.a missing sigsetjmp/siglongjmp already
+ declared in setjmp.h
+ See http://b.android.com/19851
+
+- Patched GCC 4.4.3/4.6/4.7 libstdc++ to work with Clang in C++11
+ See http://clang.llvm.org/cxx_status.html
+
+- Fixed cygwin path in argument passed to HOST_AWK
+
+- Fixed ndk-build warning in windows when running from project's jni/
+ directory.
+ See See http://b.android.com/40192
+
+- Fixed ndk-build won't build if makefile has tailing whitespace in
+ LOCAL_PATH definition
+ See See http://b.android.com/42841
+
+
+OTHER CHANGES:
+
+- Enabled threading support in GCC/MIPS toolchain
+
+- Unhided GCC EH helpers __cxa_begin_cleanup and __cxa_type_match
+ in GNU libstdc++
+
+ See tests/build/b8247455-hidden-cxa/jni/Android.mk
+
+- Gabi++ and STLport static libraries are now built with hidden
+ visibility except for EH helpers
+
+- STLport in ARM is now built with thumb
+
+- Added support for std::set_new_handler in Gabi++
+ See http://b.android.com/52805
+
+- Enabled FUTEX in GNU libstdc++
+
+- ndk-build no longer copies prebuilt static library to project's
+ obj/local/<abi>/directory
+ See http://b.android.com/40302
+
+- Removed __ARM_ARCH_5*__ from ARM toolchains/*/setup.mk
+ See http://b.android.com/21132
+
+- Built additional GNU libstdc++ libaries in thumb for ARM
+
+- Enabled MIPS floating-point madd/msub/nmadd/nmsub/recip/rsqrt
+ instructions with 32-bit FPU
+
+- Enabled graphite in GCC 4.6 and 4.7. Allow more loop optimizations:
+ -fgraphite, -fgraphite-identity, -floop-block, -floop-flatten,
+ -floop-interchange, -floop-strip-mine, -floop-parallelize-all,
+ and -ftree-loop-linear
+
+ See http://gcc.gnu.org/onlinedocs/gcc/Optimize-Options.html
+
+- Enabled polly for clang3.1/3.2 on Linux/MacOSX 32-bit hosts which analyzes
+ and optimizes memory access pattern
+
+ See http://polly.llvm.org
+
+- Enabled -flto in GCC 4.7, 4.6, clang3.2 and Clang3.1 on linux (Clang LTO
+ via LLVMgold.so, ie. no MIPS because it doesn't have ld.gold)
+
+- Enabled --plugin and --plugin-opt for ld.gold in GCC 4.6/4.7
+
+- Enabled --text-reorder for ld.gold in GCC 4.7
+
+- GNU libstdc++ is now configured with _GLIBCXX_USE_C99_MATH which will undef
+ isinf, etc (*1), in bionic header. If you have code which does the following
+ #include <math.h>
+ ... use isinf
+ #include <cmath>
+ #include <math.h>
+ ... use isinf // fails
+ The 2nd use of isinf may fail because cmath undefined isinf
+
+ (*1) Math macro in bionic undefined by cmath: fpclassify, isfinite, isinf,
+ isnan, isnormal, isgreater, isgreaterequal, isless, islessequal,
+ islessgreater, isunordered, signbit
+
+- Added APP_LDFLAGS. See ANDROID-MK.html.
+
+- Allow NDK_LOG=0, NDK_HOST_32BIT=0 to disable NDK_LOG and host 32-bit toolchain,
+ respectively.
+
+- Changed the default GCC/X86 -march=/-mtune= from pentiumpro/generic to i686/atom
+
+- Misc toolchain build script enhancements:
+ 1. Fixed a race condition in build-gcc.sh mingw build which used to prevent
+ high degree of parallel build
+ 2. build-gabi++.sh and build-stlport.sh can now run from NDK package
+ See http://b.android.com/52835
+ 3. Fixed run-tests.sh in MSys
+ 4. Better 64-bit host toolchain and canadian build supports
+ 5. Updated build-mingw64-toolchain.sh for modern versions
+ 6. Option to build libgnustl_static.a and stlport_static.a without hidden
+ visibility
+
+
+-------------------------------------------------------------------------------
android-ndk-r8d
IMPORTANT CHANGES:
@@ -27,7 +315,7 @@
This feature is experimental now and works better with GCC 4.6/4.7
than with GCC 4.4.3 and clang3.1. Welcome to try and report issues.
-- Add -mstack-protector-guard option for x86 to choose between "global"
+- Add -mstack-protector-guard= option for x86 to choose between "global"
(default, compatible with older bionic) and "tls" (new %gs:20) for
-fstack-protector, -fstack-protector-all, and -fstack-protector-strong
(GCC 4.6+). Note that this alone doesn't enable any -fstack-protector*
@@ -91,7 +379,7 @@
1. Fixed __WINT_TYPE__ and wint_t to be the same type
2. Corrected typo in <android/bitmap.h>
See http://code.google.com/p/android/issues/detail?id=15134
- 3. Corrected typo in <errono.h>
+ 3. Corrected typo in <errno.h>
See http://code.google.com/p/android/issues/detail?id=15134
4. Check the presence of __STDC_VERSION__ in <sys/cdefs.h>
See http://code.google.com/p/android/issues/detail?id=14627
diff --git a/tests/build/issue38441-Elf32_auxv_t/jni/Android.mk b/tests/build/issue38441-Elf32_auxv_t/jni/Android.mk
new file mode 100644
index 0000000..ca7b1c7
--- /dev/null
+++ b/tests/build/issue38441-Elf32_auxv_t/jni/Android.mk
@@ -0,0 +1,6 @@
+LOCAL_PATH := $(call my-dir)
+
+include $(CLEAR_VARS)
+LOCAL_MODULE := issue38441-Elf32_auxv_t
+LOCAL_SRC_FILES := issue38441-Elf32_auxv_t.c
+include $(BUILD_EXECUTABLE)
diff --git a/tests/build/issue38441-Elf32_auxv_t/jni/Application.mk b/tests/build/issue38441-Elf32_auxv_t/jni/Application.mk
new file mode 100644
index 0000000..a252a72
--- /dev/null
+++ b/tests/build/issue38441-Elf32_auxv_t/jni/Application.mk
@@ -0,0 +1 @@
+APP_ABI := all
diff --git a/tests/build/issue38441-Elf32_auxv_t/jni/issue38441-Elf32_auxv_t.c b/tests/build/issue38441-Elf32_auxv_t/jni/issue38441-Elf32_auxv_t.c
new file mode 100644
index 0000000..fa3b229
--- /dev/null
+++ b/tests/build/issue38441-Elf32_auxv_t/jni/issue38441-Elf32_auxv_t.c
@@ -0,0 +1,25 @@
+/*
+ * Copyright (C) 2010 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <stdint.h>
+#include <elf.h>
+
+Elf32_auxv_t auxv32;
+Elf64_auxv_t auxv64;
+
+int main()
+{
+}
diff --git a/tests/build/issue42841-LOCAL_PATH/jni/Android.mk b/tests/build/issue42841-LOCAL_PATH/jni/Android.mk
new file mode 100644
index 0000000..696dad2
--- /dev/null
+++ b/tests/build/issue42841-LOCAL_PATH/jni/Android.mk
@@ -0,0 +1,12 @@
+# Note that the line LOCAL_PATH ends with trailing space and
+# cause strange error message reads:
+#
+# make: *** No rule to make target /issue42841-LOCAL_PATH.c', needed by
+# obj/local/armeabi/objs/issue42841-LOCAL_PATH/issue42841-LOCAL_PATH.o'. Stop.
+#
+LOCAL_PATH := $(call my-dir)
+
+include $(CLEAR_VARS)
+LOCAL_MODULE := issue42841-LOCAL_PATH
+LOCAL_SRC_FILES := issue42841-LOCAL_PATH.c
+include $(BUILD_EXECUTABLE)
diff --git a/tests/build/issue42841-LOCAL_PATH/jni/Application.mk b/tests/build/issue42841-LOCAL_PATH/jni/Application.mk
new file mode 100644
index 0000000..a252a72
--- /dev/null
+++ b/tests/build/issue42841-LOCAL_PATH/jni/Application.mk
@@ -0,0 +1 @@
+APP_ABI := all
diff --git a/tests/build/issue42841-LOCAL_PATH/jni/issue42841-LOCAL_PATH.c b/tests/build/issue42841-LOCAL_PATH/jni/issue42841-LOCAL_PATH.c
new file mode 100644
index 0000000..c829b4e
--- /dev/null
+++ b/tests/build/issue42841-LOCAL_PATH/jni/issue42841-LOCAL_PATH.c
@@ -0,0 +1,18 @@
+/*
+ * Copyright (C) 2010 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+int main()
+{
+}
diff --git a/tests/build/issue53163-OpenSLES_AndroidConfiguration/jni/Android.mk b/tests/build/issue53163-OpenSLES_AndroidConfiguration/jni/Android.mk
new file mode 100644
index 0000000..1d144be
--- /dev/null
+++ b/tests/build/issue53163-OpenSLES_AndroidConfiguration/jni/Android.mk
@@ -0,0 +1,6 @@
+LOCAL_PATH := $(call my-dir)
+
+include $(CLEAR_VARS)
+LOCAL_MODULE := issue53163-OpenSLES_AndroidConfiguration
+LOCAL_SRC_FILES := issue53163-OpenSLES_AndroidConfiguration.c
+include $(BUILD_EXECUTABLE)
diff --git a/tests/build/issue53163-OpenSLES_AndroidConfiguration/jni/Application.mk b/tests/build/issue53163-OpenSLES_AndroidConfiguration/jni/Application.mk
new file mode 100644
index 0000000..b448d58
--- /dev/null
+++ b/tests/build/issue53163-OpenSLES_AndroidConfiguration/jni/Application.mk
@@ -0,0 +1,2 @@
+APP_ABI := all
+APP_PLATFORM := android-9
diff --git a/tests/build/issue53163-OpenSLES_AndroidConfiguration/jni/issue53163-OpenSLES_AndroidConfiguration.c b/tests/build/issue53163-OpenSLES_AndroidConfiguration/jni/issue53163-OpenSLES_AndroidConfiguration.c
new file mode 100644
index 0000000..6035247
--- /dev/null
+++ b/tests/build/issue53163-OpenSLES_AndroidConfiguration/jni/issue53163-OpenSLES_AndroidConfiguration.c
@@ -0,0 +1,23 @@
+/*
+ * Copyright (C) 2010 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <SLES/OpenSLES.h>
+#include <SLES/OpenSLES_AndroidConfiguration.h>
+
+int main()
+{
+ SL_ANDROID_RECORDING_PRESET_NONE;
+}
diff --git a/tests/device/issue19851-sigsetjmp/jni/Android.mk b/tests/device/issue19851-sigsetjmp/jni/Android.mk
new file mode 100644
index 0000000..eb8e177
--- /dev/null
+++ b/tests/device/issue19851-sigsetjmp/jni/Android.mk
@@ -0,0 +1,6 @@
+LOCAL_PATH := $(call my-dir)
+
+include $(CLEAR_VARS)
+LOCAL_MODULE := issue19851-sigsetjmp
+LOCAL_SRC_FILES := issue19851-sigsetjmp.c
+include $(BUILD_EXECUTABLE)
diff --git a/tests/device/issue19851-sigsetjmp/jni/Application.mk b/tests/device/issue19851-sigsetjmp/jni/Application.mk
new file mode 100644
index 0000000..a252a72
--- /dev/null
+++ b/tests/device/issue19851-sigsetjmp/jni/Application.mk
@@ -0,0 +1 @@
+APP_ABI := all
diff --git a/tests/device/issue19851-sigsetjmp/jni/issue19851-sigsetjmp.c b/tests/device/issue19851-sigsetjmp/jni/issue19851-sigsetjmp.c
new file mode 100644
index 0000000..49d35ee
--- /dev/null
+++ b/tests/device/issue19851-sigsetjmp/jni/issue19851-sigsetjmp.c
@@ -0,0 +1,84 @@
+/*
+ * Copyright (C) 2010 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <stdio.h>
+#include <signal.h>
+#include <setjmp.h>
+
+static sigjmp_buf sbuf;
+
+void handler(int sig)
+{
+ printf("In handler()\n");
+ siglongjmp(sbuf, 99);
+ printf("After calling siglongjmp, but you won't see me here.\n");
+}
+
+void foo()
+{
+ struct sigaction sact;
+ sigset_t sset;
+ printf("In foo()\n");
+
+ /* Setup signal handler for SIGUSR2 */
+ sigemptyset(&sact.sa_mask);
+ sact.sa_flags = 0;
+ sact.sa_handler = handler;
+ sigaction(SIGUSR2, &sact, NULL);
+
+ /* Unblock SIGUSR2 */
+ sigemptyset(&sset);
+ sigaddset(&sset, SIGUSR2);
+ sigprocmask(SIG_UNBLOCK, &sset, NULL);
+
+ /* Action */
+ kill(getpid(), SIGUSR2);
+
+ printf("After calling kill, but you won't see me here.\n");
+}
+
+void bar()
+{
+ printf("In bar()\n");
+ foo();
+ printf("After calling foo, but you won't see me here.\n");
+}
+
+int main()
+{
+ int code, ret;
+ sigset_t sset;
+ printf("In main()\n");
+ sigemptyset(&sset);
+ sigaddset(&sset, SIGUSR1);
+ sigaddset(&sset, SIGUSR2);
+ sigprocmask(SIG_SETMASK, &sset, NULL);
+ if ((code = sigsetjmp(sbuf, 1)) == 0)
+ {
+ bar();
+ ret = 0xDEADBEEF;
+ }
+ else
+ {
+ printf("siglongjmp() back to main, code = %d\n", code);
+ /* Make sure SIGUSR2 still blocked */
+ sigprocmask(SIG_SETMASK, NULL, &sset);
+ ret = sigismember(&sset, SIGUSR2)? 0 : -1;
+ }
+ printf("ret = %d\n", ret);
+
+ return ret;
+}
diff --git a/tests/device/test-openmp/jni/fib.c b/tests/device/test-openmp/jni/fib.c
index c2ec2e9..fb3e3e1 100644
--- a/tests/device/test-openmp/jni/fib.c
+++ b/tests/device/test-openmp/jni/fib.c
@@ -48,7 +48,7 @@
time_end.tv_usec = time_end.tv_usec-time_start.tv_usec;
time_end.tv_sec = time_end.tv_sec-time_start.tv_sec;
time_end.tv_usec += (time_end.tv_sec*1000000);
- printf("Time of Fibonacci with OpenMP : %lf sec\n", time_end.tv_usec / 1000000.0);
+ printf("Execution time of The Fibonacci Numbers with OpenMP : %lf sec\n", time_end.tv_usec / 1000000.0);
for(i = 0; i < MAX; i++)
printf("%d ", FibNumber[i]);
printf("\n-------------------------------\n");
diff --git a/tests/device/test-openmp/jni/openmp2.c b/tests/device/test-openmp/jni/openmp2.c
index c1788ce..aa5575d 100644
--- a/tests/device/test-openmp/jni/openmp2.c
+++ b/tests/device/test-openmp/jni/openmp2.c
@@ -7,6 +7,7 @@
{
int nthreads, tid;
printf("SC_NPROCESSORS_ONLN: %d\n", sysconf (_SC_NPROCESSORS_ONLN));
+ printf("SC_NPROCESSORS_CONF: %d\n", sysconf (_SC_NPROCESSORS_CONF));
#pragma omp parallel default(shared) private(nthreads, tid)
/* Fork a team of threads giving them their own copies of variables */
{