summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
author Treehugger Robot <android-test-infra-autosubmit@system.gserviceaccount.com> 2025-01-21 19:09:57 -0800
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2025-01-21 19:09:57 -0800
commit27c6c1f15af21735c5b9c7fe9c5256633b1e3a19 (patch)
tree7639439cbcc67dd22cef6d18b4f36d2752e48a2e /scripts
parent102c2ae2b4d8d64cc484ccf03ec764ac4d0e63f3 (diff)
parent8ca51c6fd89555ebadb418617933dfc730ccf864 (diff)
Merge "Make go test -race more hermetic" into main
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/run-soong-tests-with-go-tools.sh5
1 files changed, 5 insertions, 0 deletions
diff --git a/scripts/run-soong-tests-with-go-tools.sh b/scripts/run-soong-tests-with-go-tools.sh
index 1fbb1fc77..82efaa0eb 100755
--- a/scripts/run-soong-tests-with-go-tools.sh
+++ b/scripts/run-soong-tests-with-go-tools.sh
@@ -38,6 +38,11 @@ if [[ ${OS} = linux ]]; then
CLANG_VERSION=$(build/soong/scripts/get_clang_version.py)
export CC="${TOP}/prebuilts/clang/host/${OS}-x86/${CLANG_VERSION}/bin/clang"
export CXX="${TOP}/prebuilts/clang/host/${OS}-x86/${CLANG_VERSION}/bin/clang++"
+ glibc_dir="${TOP}/prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.17-4.8"
+ export CGO_CFLAGS="--sysroot ${glibc_dir}/sysroot/"
+ export CGO_CPPFLAGS="--sysroot ${glibc_dir}/sysroot/"
+ export CGO_CXXFLAGS="--sysroot ${glibc_dir}/sysroot/"
+ export CGO_LDFLAGS="--sysroot ${glibc_dir}/sysroot/ -B ${glibc_dir}/lib/gcc/x86_64-linux/4.8.3 -L ${glibc_dir}/lib/gcc/x86_64-linux/4.8.3 -L ${glibc_dir}/x86_64-linux/lib64"
fi
# androidmk_test.go gets confused if ANDROID_BUILD_TOP is set.