scons: Fix the compiler flag used for partial linking.
authorGabe Black <gabeblack@google.com>
Wed, 3 May 2017 07:37:19 +0000 (00:37 -0700)
committerGabe Black <gabeblack@google.com>
Wed, 3 May 2017 10:51:07 +0000 (10:51 +0000)
It seems that g++ can generally handle the -r flag for generating a
relocatable object file, but ld can't always handle the  --relocatable
flag.

Change-Id: I15f32e469590a814131d4e992b392a7ad6c52b83
Reviewed-on: https://gem5-review.googlesource.com/3001
Reviewed-by: Andreas Hansson <andreas.hansson@arm.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>

SConstruct

index ff6de944c49c3716a1d2a1f322a774ea50c2471b..d252865dbaccd24b5a6196edce330fec4c8c04ab 100755 (executable)
@@ -685,7 +685,7 @@ if main['GCC'] or main['CLANG']:
     main['FILTER_PSHLINKFLAGS'] = lambda x: str(x).replace(' -shared', '')
     main['PSHLINKFLAGS'] = main.subst('${FILTER_PSHLINKFLAGS(SHLINKFLAGS)}')
     main['PLINKFLAGS'] = main.subst('${LINKFLAGS}')
-    shared_partial_flags = ['-Wl,--relocatable', '-nostdlib']
+    shared_partial_flags = ['-r', '-nostdlib']
     main.Append(PSHLINKFLAGS=shared_partial_flags)
     main.Append(PLINKFLAGS=shared_partial_flags)
 else: