diff options
author | Roberto Alanis <alanisbaez@google.com> | 2021-08-25 14:26:00 +0000 |
---|---|---|
committer | Roberto Alanis <alanisbaez@google.com> | 2021-08-27 23:47:53 +0000 |
commit | fcbb8cc2b4fbe59ddb690421945dc32e431feab3 (patch) | |
tree | 29f621d3987e1433e6b1927dc5a5f276e7ec9a9d | |
parent | e12a2208e129145e589cfe595829aa6fedd3b1e8 (diff) | |
download | libwebm-fcbb8cc2b4fbe59ddb690421945dc32e431feab3.tar.gz |
Port jenkins scripts: Fix link error in x86-ubsan
Fix undefined symbol undefined reference to `__mulodi4'.
See https://bugs.llvm.org/show_bug.cgi?id=17693
Change-Id: I9427a8d0915b817f5280c5c4f1bb3d44c9f638ea
Bug: b:185520494
-rwxr-xr-x | infra/run_unit_tests.sh | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/infra/run_unit_tests.sh b/infra/run_unit_tests.sh index 9f70b61..96ce5ab 100755 --- a/infra/run_unit_tests.sh +++ b/infra/run_unit_tests.sh @@ -149,7 +149,15 @@ export CXX opts+=("-DCMAKE_BUILD_TYPE=Debug" "-DENABLE_TESTS=ON") case "${TARGET}" in *-asan) opts+=("-DCMAKE_CXX_FLAGS=-fsanitize=address") ;; - *-ubsan) opts+=("-DCMAKE_CXX_FLAGS=-fsanitize=integer") ;; + *-ubsan) + opts+=("-DCMAKE_CXX_FLAGS=-fsanitize=integer") + if [[ "${TARGET}" == "x86-ubsan" ]]; then + # clang fails to find symbols when -fsanitize=integer is set in x86 arch. + # https://bugs.llvm.org/show_bug.cgi?id=17693 + opts+=("-DCMAKE_CXX_FLAGS=-rtlib=compiler-rt") + opts+=("-DCMAKE_EXE_LINKER_FLAGS=-lgcc_s") + fi + ;; *) ;; # No additional flags needed. esac |