diff options
author | Matthias Maennich <maennich@google.com> | 2019-02-06 12:53:57 +0000 |
---|---|---|
committer | Matthias Männich <maennich@google.com> | 2019-02-22 15:48:46 +0000 |
commit | 4a58c555e911a3bc14959353b7a32a94d6e76749 (patch) | |
tree | d030dbd98b5482cb352c8c2d459ec09debff68f1 | |
parent | 41921a275c4d3f68085603bc4d28895fdcc99898 (diff) | |
download | linux-kselftest-4a58c555e911a3bc14959353b7a32a94d6e76749.tar.gz |
x86 tests: address test failures caused by Text Relocations
Starting with API level 23, binaries must not contain text relocations.
(see https://android.googlesource.com/platform/bionic/+/master/
android-changes-for-ndk-developers.md
#Text-Relocations-Enforced-for-API-level-23)
Soong creates build rules in a way that non-static binaries are linked
with -pie (see cs/android/build/soong/cc/binary.go?l=278). That causes
the toolchain to generate text relocations, which violate the above
requirement.
Hence, marking the test executables as static and removing all occurrences
of `-Wl,-z,notext` as they are now obsolete.
Tests might still fail with this patch applied, but for a different reason.
Bug: 123864125
Test: run vts-kernel -m VtsKernelLinuxKselftest
Change-Id: If2e44691223685cb1059f656a2499a74deb1e496
Signed-off-by: Matthias Maennich <maennich@google.com>
-rw-r--r-- | Android.bp | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/Android.bp b/Android.bp index 52689a08c8ff..91edc09928c5 100644 --- a/Android.bp +++ b/Android.bp @@ -321,7 +321,7 @@ cc_test { } } -// x86 test +// x86 tests cc_test { name: "kselftest_x86_tests", relative_install_path: "linux-kselftest/x86", @@ -349,11 +349,6 @@ cc_test { "tools/testing/selftests/x86/test_FISTTP.c", "tools/testing/selftests/x86/vdso_restorer.c", ], - // Allow text (read-only) relocations, which is the default - // for ld.bfd, but not lld. - ldflags: [ - "-Wl,-z,notext", - ], }, }, cflags: [ @@ -361,6 +356,7 @@ cc_test { "-pthread", ], c_std: "gnu99", + static_executable: true, defaults: ["kselftest_defaults"], } @@ -428,17 +424,13 @@ cc_test { "-pthread", ], c_std: "gnu99", + static_executable: true, test_per_src: false, defaults: ["kselftest_defaults"], enabled: false, arch: { x86: { enabled: true, - // Allow text (read-only) relocations, which is the default - // for ld.bfd, but not lld. - ldflags: [ - "-Wl,-z,notext", - ], }, }, } |