Skip to content

gn: hwasan: fixup hwasan-preinit #96748

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 27, 2024
Merged

gn: hwasan: fixup hwasan-preinit #96748

merged 1 commit into from
Jun 27, 2024

Conversation

hctim
Copy link
Collaborator

@hctim hctim commented Jun 26, 2024

The build rule for hwasan_preinit outputs libclang_rt.hwasan_preinit,
but clang expects hwasan-preinit (with a dash, rather than an
underscore) when selecting the library in the frontend.

Also, we were missing the hwasan-preinit dependency in check-hwasan.

For posterity, this now passes hwasan unit tests on Android with:
$ cat args.gn
clang_base_path = "/usr/local"
llvm_enable_assertions = true
llvm_targets_to_build = "all"
android_ndk_path = "/path/to/Android.sdk/ndk/25.2.9519653"
$ /path/to/llvm/utils/gn/gn.py gen build
$ ANDROID_SERIAL=xxx ninja -C build check-hwasan

The build rule for hwasan_preinit outputs libclang_rt.hwasan_preinit,
but clang expects hwasan-preinit (with a dash, rather than an
underscore) when selecting the library in the frontend.

Also, we were missing the hwasan-preinit dependency in check-hwasan.

For posterity, this now passes hwasan unit tests on Android with:
 $ cat args.gn
clang_base_path = "/usr/local"
llvm_enable_assertions = true
llvm_targets_to_build = "all"
android_ndk_path = "/path/to/Android.sdk/ndk/25.2.9519653"
 $ /path/to/llvm/utils/gn/gn.py gen build
 $ ANDROID_SERIAL=xxx ninja -C build check-hwasan
@hctim hctim requested a review from pcc June 26, 2024 10:25
@hctim hctim merged commit 73e6f9f into llvm:main Jun 27, 2024
8 checks passed
@hctim hctim deleted the hwasan/preinit-gn branch June 27, 2024 06:03
lravenclaw pushed a commit to lravenclaw/llvm-project that referenced this pull request Jul 3, 2024
The build rule for hwasan_preinit outputs libclang_rt.hwasan_preinit,
but clang expects hwasan-preinit (with a dash, rather than an
underscore) when selecting the library in the frontend.

Also, we were missing the hwasan-preinit dependency in check-hwasan.

For posterity, this now passes hwasan unit tests on Android with:
 $ cat args.gn
clang_base_path = "/usr/local"
llvm_enable_assertions = true
llvm_targets_to_build = "all"
android_ndk_path = "/path/to/Android.sdk/ndk/25.2.9519653"
 $ /path/to/llvm/utils/gn/gn.py gen build
 $ ANDROID_SERIAL=xxx ninja -C build check-hwasan
AlexisPerry pushed a commit to llvm-project-tlp/llvm-project that referenced this pull request Jul 9, 2024
The build rule for hwasan_preinit outputs libclang_rt.hwasan_preinit,
but clang expects hwasan-preinit (with a dash, rather than an
underscore) when selecting the library in the frontend.

Also, we were missing the hwasan-preinit dependency in check-hwasan.

For posterity, this now passes hwasan unit tests on Android with:
 $ cat args.gn
clang_base_path = "/usr/local"
llvm_enable_assertions = true
llvm_targets_to_build = "all"
android_ndk_path = "/path/to/Android.sdk/ndk/25.2.9519653"
 $ /path/to/llvm/utils/gn/gn.py gen build
 $ ANDROID_SERIAL=xxx ninja -C build check-hwasan
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants