Johnny Ko has uploaded this change for review. ( 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
---
M SConstruct
1 file changed, 20 insertions(+), 1 deletion(-)



diff --git a/SConstruct b/SConstruct
index e08c2984..6872d5e 100755
--- a/SConstruct
+++ b/SConstruct
@@ -515,7 +515,8 @@
         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'])
         else:
             warning("Don't know how to enable %s sanitizer(s) for your "
                     "compiler." % sanitizers)

--
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: 1
Gerrit-Owner: Johnny Ko <johnn...@google.com>
Gerrit-MessageType: newchange
_______________________________________________
gem5-dev mailing list -- gem5-dev@gem5.org
To unsubscribe send an email to gem5-dev-le...@gem5.org

Reply via email to