--- a/SConscript Fri Apr 10 21:20:25 2009 +0200
+++ b/SConscript Sat Aug 15 00:33:43 2009 +0200
@@ -151,6 +151,9 @@
# We need a special linker script to set up some variables for
# initialisation in Linux
+# Using Program and -shared is a hacky way to make a shared library in SCons
+# without requiring -fPIC (which cannot be used, as inline assembler uses
+# registers that cannot be used when with -fPIC).
link_flags = '-Wl,-O1 -shared -Wl,-O1 -Wl,-T' + curdir + linker_script
ext_cflags = ''
as_flags = '-D__ASSEMBLY__'
@@ -166,6 +169,8 @@
# -----------------------------------------------------------------------------
env = default_env.Clone(CCFLAGS=cflags, CPPPATH=include_path,
+ LINKFLAGS = link_flags,
+ ASFLAGS = as_flags,
GLB_CCFLAGS=glb_cflags,
GLB_LIST=curdir + '/global_list.txt')
sim_env = default_env.Clone(CCFLAGS='-g -Wall -O2 ' + ext_cflags,
@@ -175,10 +180,6 @@
objects.extend([sim_env.SharedObject(s) for s in sim_sources])
objects.extend(asm_sources)
-# Using Program and -shared is a hacky way to make a shared library in SCons
-# without requiring -fPIC.
-env['LINKFLAGS'] += link_flags
-env['ASFLAGS'] += as_flags
output = env.Program(source=objects, target='lib%s.so' % stackname)
Install(dir = "..", source = output)