-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 2bcc2e2
Showing
5 changed files
with
102 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
/bin/ | ||
/build-bfd/ | ||
/build-lld/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Failing LLD crash dump test case | ||
|
||
Test case for https://github.com/android/ndk/issues/1196 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
cmake_minimum_required(VERSION 3.10) | ||
|
||
project(application) | ||
if(ANDROID_LD STREQUAL lld) | ||
set(SUFFIX -lld) | ||
else() | ||
set(SUFFIX "") | ||
endif() | ||
add_executable("application${SUFFIX}" application.cpp) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#include <cstdlib> | ||
|
||
int main(void) | ||
{ | ||
abort(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -e | ||
|
||
HERE=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) | ||
|
||
ANDROID_ABI=arm64-v8a | ||
ANDROID_NATIVE_API_LEVEL=29 | ||
|
||
if [ -z "$ANDROID_NDK" ]; then | ||
>&2 echo "Must set ANDROID_NDK" | ||
exit 1 | ||
fi | ||
|
||
function compile() | ||
{ | ||
printf '\nConfigure & Compile test applications ...\n\n' | ||
|
||
rm -rf $HERE/build-bfd | ||
mkdir "$HERE/build-bfd" | ||
|
||
cd "$HERE/build-bfd" | ||
|
||
cmake \ | ||
-G Ninja \ | ||
-DCMAKE_BUILD_TYPE:STRING=Debug \ | ||
-DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK/build/cmake/android.toolchain.cmake \ | ||
-DANDROID_ABI=$ANDROID_ABI \ | ||
-DANDROID_PLATFORM=android-$ANDROID_NATIVE_API_LEVEL \ | ||
-DCMAKE_RUNTIME_OUTPUT_DIRECTORY=$HERE/bin \ | ||
-DANDROID_LD=deprecated \ | ||
"$HERE/application" | ||
|
||
cmake --build . -- -j1 -v | ||
|
||
rm -rf $HERE/build-lld | ||
mkdir "$HERE/build-lld" | ||
|
||
cd "$HERE/build-lld" | ||
|
||
cmake \ | ||
-G Ninja \ | ||
-DCMAKE_BUILD_TYPE:STRING=Debug \ | ||
-DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK/build/cmake/android.toolchain.cmake \ | ||
-DANDROID_ABI=$ANDROID_ABI \ | ||
-DANDROID_PLATFORM=android-$ANDROID_NATIVE_API_LEVEL \ | ||
-DCMAKE_RUNTIME_OUTPUT_DIRECTORY=$HERE/bin \ | ||
-DANDROID_LD=lld \ | ||
"$HERE/application" | ||
|
||
cmake --build . -- -j1 -v | ||
|
||
printf '\nConfigure & Compile test applications DONE\n\n' | ||
} | ||
|
||
function run() | ||
{ | ||
printf '\nRun with & without LLD\n' | ||
|
||
adb logcat -c | ||
|
||
adb push $HERE/bin/application /data/local/tmp/ | ||
adb push $HERE/bin/application-lld /data/local/tmp/ | ||
|
||
set +e | ||
|
||
adb shell /data/local/tmp/application | ||
adb shell /data/local/tmp/application-lld | ||
|
||
set -e | ||
} | ||
|
||
function crash_dump() | ||
{ | ||
printf '\nCrash dumps:\n\n' | ||
adb logcat -d | $ANDROID_NDK/ndk-stack -sym $HERE/bin | ||
} | ||
|
||
compile | ||
run | ||
crash_dump |