Johnny Ko has submitted this change. (
https://gem5-review.googlesource.com/c/public/gem5/+/67298?usp=email )
Change subject: scons: force libasan to static linking
......................................................................
scons: force libasan to static linking
The asan(enable with --with-asan) sanitizer interpret calls to dlopen().
That replaces the RUNPATH of an executable with RUNPATH of libasan.so
after libasan.so is loaded by loader. Then it may cause some shared
libraries missing, i.e. the error messages is like
"cannot open shared object file: No such file or directory" since the
RUNPATH is no longer correct. Force the libasan to static linking
can avoid this issue since libasan.a does not have a RUNPATH, thus
the replacement will never happen.
Change-Id: I8e5ff4d1fbe4644a258054be6e9f6d4db9062e56
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/67298
Reviewed-by: Earl Ou <shunhsin...@google.com>
Tested-by: kokoro <noreply+kok...@google.com>
Maintainer: Gabe Black <gabe.bl...@gmail.com>
---
M SConstruct
1 file changed, 25 insertions(+), 1 deletion(-)
Approvals:
Gabe Black: Looks good to me, approved
Earl Ou: Looks good to me, approved
kokoro: Regressions pass
diff --git a/SConstruct b/SConstruct
index 43ca3ac..2e525a3 100755
--- a/SConstruct
+++ b/SConstruct
@@ -526,7 +526,9 @@
if env['GCC'] or env['CLANG']:
env.Append(CCFLAGS=['-fsanitize=%s' % sanitizers,
'-fno-omit-frame-pointer'],
- LINKFLAGS='-fsanitize=%s' % sanitizers)
+ LINKFLAGS=['-fsanitize=%s' % sanitizers,
+ '-static-libasan'])
+
if main["BIN_TARGET_ARCH"] == "x86_64":
# Sanitizers can enlarge binary size drammatically, north
of
# 2GB. This can prevent successful linkage due to symbol
--
To view, visit
https://gem5-review.googlesource.com/c/public/gem5/+/67298?usp=email
To unsubscribe, or for help writing mail filters, visit
https://gem5-review.googlesource.com/settings
Gerrit-Project: public/gem5
Gerrit-Branch: develop
Gerrit-Change-Id: I8e5ff4d1fbe4644a258054be6e9f6d4db9062e56
Gerrit-Change-Number: 67298
Gerrit-PatchSet: 3
Gerrit-Owner: Johnny Ko <johnn...@google.com>
Gerrit-Reviewer: Earl Ou <shunhsin...@google.com>
Gerrit-Reviewer: Gabe Black <gabe.bl...@gmail.com>
Gerrit-Reviewer: Gabe Black <gabebl...@google.com>
Gerrit-Reviewer: Johnny Ko <johnn...@google.com>
Gerrit-Reviewer: Yu-hsin Wang <yuhsi...@google.com>
Gerrit-Reviewer: kokoro <noreply+kok...@google.com>
Gerrit-MessageType: merged
_______________________________________________
gem5-dev mailing list -- gem5-dev@gem5.org
To unsubscribe send an email to gem5-dev-le...@gem5.org