diff options
author | Daniel Bertalan <dani@danielbertalan.dev> | 2021-09-23 16:29:07 +0200 |
---|---|---|
committer | Linus Groh <mail@linusgroh.de> | 2021-10-17 17:09:58 +0100 |
commit | 928665d3bcba31c9a671cdc506f09b14a8a0a52c (patch) | |
tree | 9af909c9bcf9502e79d2bd6f60681aa8ca125c2b /Meta/serenity.sh | |
parent | 10c3cf9a47f928075563abd89c01b5de9f24e807 (diff) | |
download | serenity-928665d3bcba31c9a671cdc506f09b14a8a0a52c.zip |
Meta: Support llvm-addr2line in `serenity.sh`
With this, the subcommands 'addr2line` and `kaddr2line` work as with the
GNU toolchain.
Diffstat (limited to 'Meta/serenity.sh')
-rwxr-xr-x | Meta/serenity.sh | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/Meta/serenity.sh b/Meta/serenity.sh index 24394265b5..6e70ec78b0 100755 --- a/Meta/serenity.sh +++ b/Meta/serenity.sh @@ -372,7 +372,12 @@ if [[ "$CMD" =~ ^(build|install|image|copy-src|run|gdb|test|rebuild|recreate|kad lagom_unsupported build_target [ $# -ge 1 ] || usage - "$TOOLCHAIN_DIR/binutils/binutils/addr2line" -e "$BUILD_DIR/Kernel/Kernel" "$@" + if [ "$TOOLCHAIN_TYPE" = "Clang" ]; then + ADDR2LINE="$TOOLCHAIN_DIR/bin/llvm-addr2line" + else + ADDR2LINE="$TOOLCHAIN_DIR/binutils/binutils/addr2line" + fi + "$ADDR2LINE" -e "$BUILD_DIR/Kernel/Kernel" "$@" ;; addr2line) build_target @@ -382,6 +387,8 @@ if [[ "$CMD" =~ ^(build|install|image|copy-src|run|gdb|test|rebuild|recreate|kad if [ "$TARGET" = "lagom" ]; then command -v addr2line >/dev/null 2>&1 || die "Please install addr2line!" ADDR2LINE=addr2line + elif [ "$TOOLCHAIN_TYPE" = "Clang" ]; then + ADDR2LINE="$TOOLCHAIN_DIR/bin/llvm-addr2line" else ADDR2LINE="$TOOLCHAIN_DIR/binutils/binutils/addr2line" fi |