[Gtkradiant] SVN, Relocations

Michael leahcim at ntlworld.com
Sat Feb 11 00:37:07 CST 2006


mooer at moose-mail.com wrote:

>Did the SVN address change?
>
>Also anyone ever got gtkradiant to compile on x86_64? The same relocation error is being generated on multiple boxes. Now the 32 bit equivalent does seem to compile it. 
>
>Using: x86_64 versions of: GCC 3.4.5, glibc-2.3.6
>Tried older versions, with no luck either. 
>
>Anyone have experience with hunting down relocation issues, and want to share some advice? 
>  
>
I think it's complaining because it's trying to link against a static 
libstdc++, i.e it's libstdc++.a that's not compiled with -fPIC.
The solution, change the

I've not looked at this for months, but at one time there was this 
added  to the SConstruct file :-

# EVIL HACK - force static-linking for libstdc++ - create a symbolic 
link to the static libstdc++ in the root

Basically you want to remove that if it's still there.

Something like this is what I did in a very old patch :-

--- SConstruct  (revision 5219)
+++ SConstruct  (working copy)
@@ -68,6 +68,8 @@
 exp = re.compile('.*i?86.*')
 if (g_cpu == 'Power Macintosh' or g_cpu == 'ppc'):
   g_cpu = 'ppc'
+elif (g_cpu == 'x86_64'):
+  g_cpu = 'x86_64'
 elif exp.match(g_cpu):
   g_cpu = 'x86'
 else:
@@ -192,26 +194,11 @@

 LINKFLAGS = ''
 if ( OS == 'Linux' ):
-
-  # static
-  # 2112833 /opt/gtkradiant/radiant.x86
-  # 35282 /opt/gtkradiant/modules/archivezip.so
-  # 600099 /opt/gtkradiant/modules/entity.so
-
-  # dynamic
-  # 2237060 /opt/gtkradiant/radiant.x86
-  # 110605 /opt/gtkradiant/modules/archivezip.so
-  # 730222 /opt/gtkradiant/modules/entity.so
-
-  # EVIL HACK - force static-linking for libstdc++ - create a symbolic 
link to the static libstdc++ in the root
-  os.system("ln -s `g++ -print-file-name=libstdc++.a`")
-
-  #if not os.path.exists("./install"):
-  #  os.mkdir("./install")
-  #os.system("cp `g++ -print-file-name=libstdc++.so` ./install")
-
+  if (g_cpu == 'x86_64'):
+    CCFLAGS += '-march=k8 -fPIC '
+    CXXFLAGS += '-march=k8 -fPIC '
+  LINKFLAGS += '-Wl,-fini,fini_stub '
   CXXFLAGS += '-fno-exceptions -fno-rtti '
-  LINKFLAGS += '-Wl,-fini,fini_stub -L. -static-libgcc '
 if ( OS == 'Darwin' ):
   CCFLAGS += '-force_cpusubtype_ALL -fPIC '
   CXXFLAGS += '-force_cpusubtype_ALL -fPIC -fno-exceptions -fno-rtti'

-- 
Michael.




More information about the Gtkradiant mailing list