diff options
author | Dan Albert <danalbert@google.com> | 2019-07-10 14:52:01 -0700 |
---|---|---|
committer | Dan Albert <danalbert@google.com> | 2019-07-10 14:52:01 -0700 |
commit | 545a7738c744136aa800da05b5c901045a267e03 (patch) | |
tree | 0aba9b5b1f5f7c46ae5ba1239f1a0b0c298abae3 /docs | |
parent | c78e43cca384a47d44e9e796b9978b35491c6746 (diff) | |
download | ndk-545a7738c744136aa800da05b5c901045a267e03.tar.gz |
Clarify ASan KI in the changelogs.
Test: None
Bug: https://github.com/android-ndk/ndk/issues/988
Change-Id: I9047240acedb677a3c44c93992cf6283a6475369
Diffstat (limited to 'docs')
-rw-r--r-- | docs/changelogs/Changelog-r19.md | 22 | ||||
-rw-r--r-- | docs/changelogs/Changelog-r20.md | 29 | ||||
-rw-r--r-- | docs/changelogs/Changelog-r21.md | 29 |
3 files changed, 59 insertions, 21 deletions
diff --git a/docs/changelogs/Changelog-r19.md b/docs/changelogs/Changelog-r19.md index c4c2018fa..5af0efa1b 100644 --- a/docs/changelogs/Changelog-r19.md +++ b/docs/changelogs/Changelog-r19.md @@ -156,18 +156,26 @@ Known Issues `-march=armv7-a` when building for 32-bit ARM with the non-integrated assembler, or use the integrated assembler. ndk-build and CMake already contain these workarounds. - * [Issue 988]: Exception handling with libc++_shared when using ASan via - wrap.sh can crash. To workaround this issue, ensure that your application's - libc++_shared.so is in `LD_PRELOAD` in your `wrap.sh` as in the following - example: + * [Issue 988]: Exception handling when using ASan via wrap.sh can crash. To + workaround this issue when using libc++_shared, ensure that your + application's libc++_shared.so is in `LD_PRELOAD` in your `wrap.sh` as in the + following example: ```bash #!/system/bin/sh HERE="$(cd "$(dirname "$0")" && pwd)" export ASAN_OPTIONS=log_to_syslog=false,allow_user_segv_handler=1 - export LD_PRELOAD="$HERE/libclang_rt.asan-aarch64-android.so $HERE/libc++_shared.so" - exec "$@" - ``` + ASAN_LIB=$(ls $HERE/libclang_rt.asan-*-android.so) + if [ -f "$HERE/libc++_shared.so" ]; then + # Workaround for https://github.com/android-ndk/ndk/issues/988. + export LD_PRELOAD="$ASAN_LIB $HERE/libc++_shared.so" + else + export LD_PRELOAD="$ASAN_LIB" + fi + "$@" + ``` + + There is no known workaround for libc++_static. Note that because this is a platform bug rather than an NDK bug this workaround will be necessary for this use case to work on all devices until diff --git a/docs/changelogs/Changelog-r20.md b/docs/changelogs/Changelog-r20.md index d497ff26e..602b336a4 100644 --- a/docs/changelogs/Changelog-r20.md +++ b/docs/changelogs/Changelog-r20.md @@ -52,18 +52,33 @@ For Android Studio issues, follow the docs on the [Android Studio site]. `-march=armv7-a` when building for 32-bit ARM with the non-integrated assembler, or use the integrated assembler. ndk-build and CMake already contain these workarounds. - * [Issue 988]: Exception handling with libc++_shared when using ASan via - wrap.sh can crash. To workaround this issue, ensure that your application's - libc++_shared.so is in `LD_PRELOAD` in your `wrap.sh` as in the following - example: + * [Issue 906]: Clang does not pass `-march=armv7-a` to the assembler when using + `-fno-integrated-as`. This results in the assembler generating ARMv5 + instructions. Note that by default Clang uses the integrated assembler which + does not have this problem. To workaround this issue, explicitly use + `-march=armv7-a` when building for 32-bit ARM with the non-integrated + assembler, or use the integrated assembler. ndk-build and CMake already + contain these workarounds. + * [Issue 988]: Exception handling when using ASan via wrap.sh can crash. To + workaround this issue when using libc++_shared, ensure that your + application's libc++_shared.so is in `LD_PRELOAD` in your `wrap.sh` as in the + following example: ```bash #!/system/bin/sh HERE="$(cd "$(dirname "$0")" && pwd)" export ASAN_OPTIONS=log_to_syslog=false,allow_user_segv_handler=1 - export LD_PRELOAD="$HERE/libclang_rt.asan-aarch64-android.so $HERE/libc++_shared.so" - exec "$@" - ``` + ASAN_LIB=$(ls $HERE/libclang_rt.asan-*-android.so) + if [ -f "$HERE/libc++_shared.so" ]; then + # Workaround for https://github.com/android-ndk/ndk/issues/988. + export LD_PRELOAD="$ASAN_LIB $HERE/libc++_shared.so" + else + export LD_PRELOAD="$ASAN_LIB" + fi + "$@" + ``` + + There is no known workaround for libc++_static. Note that because this is a platform bug rather than an NDK bug this workaround will be necessary for this use case to work on all devices until diff --git a/docs/changelogs/Changelog-r21.md b/docs/changelogs/Changelog-r21.md index 47b0e5fb8..4318ce977 100644 --- a/docs/changelogs/Changelog-r21.md +++ b/docs/changelogs/Changelog-r21.md @@ -62,18 +62,33 @@ For Android Studio issues, follow the docs on the [Android Studio site]. `-march=armv7-a` when building for 32-bit ARM with the non-integrated assembler, or use the integrated assembler. ndk-build and CMake already contain these workarounds. - * [Issue 988]: Exception handling with libc++_shared when using ASan via - wrap.sh can crash. To workaround this issue, ensure that your application's - libc++_shared.so is in `LD_PRELOAD` in your `wrap.sh` as in the following - example: + * [Issue 906]: Clang does not pass `-march=armv7-a` to the assembler when using + `-fno-integrated-as`. This results in the assembler generating ARMv5 + instructions. Note that by default Clang uses the integrated assembler which + does not have this problem. To workaround this issue, explicitly use + `-march=armv7-a` when building for 32-bit ARM with the non-integrated + assembler, or use the integrated assembler. ndk-build and CMake already + contain these workarounds. + * [Issue 988]: Exception handling when using ASan via wrap.sh can crash. To + workaround this issue when using libc++_shared, ensure that your + application's libc++_shared.so is in `LD_PRELOAD` in your `wrap.sh` as in the + following example: ```bash #!/system/bin/sh HERE="$(cd "$(dirname "$0")" && pwd)" export ASAN_OPTIONS=log_to_syslog=false,allow_user_segv_handler=1 - export LD_PRELOAD="$HERE/libclang_rt.asan-aarch64-android.so $HERE/libc++_shared.so" - exec "$@" - ``` + ASAN_LIB=$(ls $HERE/libclang_rt.asan-*-android.so) + if [ -f "$HERE/libc++_shared.so" ]; then + # Workaround for https://github.com/android-ndk/ndk/issues/988. + export LD_PRELOAD="$ASAN_LIB $HERE/libc++_shared.so" + else + export LD_PRELOAD="$ASAN_LIB" + fi + "$@" + ``` + + There is no known workaround for libc++_static. Note that because this is a platform bug rather than an NDK bug this workaround will be necessary for this use case to work on all devices until |