changeset b958d9fa867c in /z/repo/gem5
details: http://repo.gem5.org/gem5?cmd=changeset;node=b958d9fa867c
description:
        scons: Fix libelf linking errors when using clang/llvm

        This patch fixes a linking error that occurs when using clang/llvm in
        combination with older versions of glibc. The fix involves adding
        -std=gnu89 to the command line when compiling libelf as clang defaults
        to c99, causing issues with the symbols in sysmacros.h being defined
        multiple times.

diffstat:

 ext/libelf/SConscript |  5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diffs (15 lines):

diff -r 175421e57fff -r b958d9fa867c ext/libelf/SConscript
--- a/ext/libelf/SConscript     Mon Jan 07 13:05:35 2013 -0500
+++ b/ext/libelf/SConscript     Mon Jan 07 13:05:35 2013 -0500
@@ -100,6 +100,11 @@
                               '-Wno-implicit-function-declaration'])
 if m4env['CLANG']:
     m4env.Append(CCFLAGS=['-Wno-initializer-overrides', '-Wno-pointer-sign'])
+    # clang defaults to c99 (while gcc defaults to gnu89) and there is a
+    # difference in the handling of inlining functions which causes
+    # linking problems with multiple definitions of the symbols in
+    # sysmacros.h for older versions of glibc
+    m4env.Append(CCFLAGS=['-std=gnu89'])
 m4env.Append(CCFLAGS=['-Wno-implicit'])
 del m4env['CPPPATH']
 
_______________________________________________
gem5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/gem5-dev

Reply via email to