This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Make native x86-64 compilation work - cleaned up


(Here you are, Honza :-)

This is a bit cleaner than the last one. It still has the horrible absolute
paths to /usr/lib64, but at least it doesn't contain absolute paths to
/usr/lib64/gcc-lib/x86_64-unknown-linux/3.1 anymore.

At some later point, I'm going to make a full multilib setup for x86-64,
but for now this is what's needed to be able to compile in the simulator.

Ok for mainline and branch?

Note about x86-64 support on branch: By now gcc can crosscompile to x86-64
and the resulting libs/binaries are working fine. But a gcc hello.c in the
simulated environment have never worked so far. Now it does that too.

2002-02-26  Bo Thorsen  <bo@suse.de>

        * config/i386/linux64.h (STARTFILE_SPEC): Add 64 bit files.
        (ENDFILE_SPEC): Likewise.
        (LINK_SPEC): Fix 32/64 bit compilation.

Index: gcc/config/i386/linux64.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/i386/linux64.h,v
retrieving revision 1.3
diff -u -r1.3 linux64.h
--- linux64.h	2001/12/06 10:43:01	1.3
+++ linux64.h	2002/02/26 17:32:09
@@ -39,10 +39,35 @@
    done.  */

 #undef	LINK_SPEC
-#define LINK_SPEC "%{!m32:-m elf_x86_64} %{m32:-m elf_i386}
 %{shared:-shared} \ +#define LINK_SPEC "%{!m32:-m elf_x86_64 -Y
 P,/usr/lib64} %{m32:-m elf_i386} \ +  %{shared:-shared} \
   %{!shared: \
     %{!static: \
       %{rdynamic:-export-dynamic} \
-      %{!dynamic-linker:-dynamic-linker /lib64/ld-linux-x86-64.so.2}} \
-      %{static:-static}}"
+      %{m32:%{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2}} \
+      %{!m32:%{!dynamic-linker:-dynamic-linker
 /lib64/ld-linux-x86-64.so.2}}} \ +    %{static:-static}}"

+#define STARTFILE_SPEC32 \
+  "%{!shared: \
+     %{pg:gcrt1.o%s} %{!pg:%{p:gcrt1.o%s} \
+     %{!p:%{profile:gcrt1.o%s} %{!profile:crt1.o%s}}}} \
+   crti.o%s %{static:crtbeginT.o%s}\
+   %{!static:%{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}}"
+
+#define STARTFILE_SPEC64 \
+  "%{!shared: \
+     %{pg:/usr/lib64/gcrt1.o%s} %{!pg:%{p:/usr/lib64/gcrt1.o%s} \
+     %{!p:%{profile:/usr/lib64/gcrt1.o%s} %{!profile:/usr/lib64/crt1.o%s}}}}
 \ +   /usr/lib64/crti.o%s %{static:crtbeginT.o%s} \
+   %{!static:%{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}}"
+
+#undef  STARTFILE_SPEC
+#define STARTFILE_SPEC "\
+%{m32:" STARTFILE_SPEC32 "} \
+%{!m32:" STARTFILE_SPEC64 "}"
+
+#undef  ENDFILE_SPEC
+#define ENDFILE_SPEC "\
+  %{m32:%{!shared:crtend.o%s} %{shared:crtendS.o%s} crtn.o%s} \
+  %{!m32:%{!shared:crtend.o%s} %{shared:crtendS.o%s} /usr/lib64/crtn.o%s}"

-- 

     Bo Thorsen                 |   Praestevejen 4
     Free software developer    |   5290 Marslev
     SuSE Labs                  |   Denmark


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]