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]

Re: 32/64 startfile path handling


On Tue, May 21, 2002 at 02:45:42PM -0700, Richard Henderson wrote:
> On Tue, May 21, 2002 at 03:34:44PM +0930, Alan Modra wrote:
> > 	* configure.in (CROSS): Define NATIVE_CROSS.
> > 	* configure: Regenerate.
> > 	* gcc.c (STARTFILE_PREFIX_SPEC): Define.
> > 	(startfile_prefix_spec): New var.
> > 	(static_specs): Add startfile_prefix_spec.
> > 	(do_spec_2): Split out from..
> > 	(do_spec): ..here.
> > 	(main): Process startfile_prefix_spec.
> > 	* config/rs6000/linux64.h (LINK_OS_LINUX_SPEC) Add -Y, change name
> > 	of dynamic linker.
> > 	(STARTFILE_PREFIX_SPEC): Define.
> > 	(STARTFILE_LINUX_SPEC, ENDFILE_LINUX_SPEC): Rewrite without
> > 	absolute paths.
> 
> Everything looks ok except the positioning of the -Y bit.
> Why do you want that during a cross-compile?

Oops, that wasn't supposed to be in the diff.  Rubbish left over from
an older attempt to solve this particular problem.

Revised diff as follows.

	* config/rs6000/linux64.h (LINK_OS_LINUX_SPEC) Change name
	of dynamic linker.
	(STARTFILE_PREFIX_SPEC): Define.
	(STARTFILE_LINUX_SPEC, ENDFILE_LINUX_SPEC): Rewrite without
	absolute paths.

--- gcc-ppc64-32.orig/gcc/config/rs6000/linux64.h	2002-05-20 19:08:16.000000000 +0930
+++ gcc-ppc64-32/gcc/config/rs6000/linux64.h	2002-05-22 14:15:37.000000000 +0930
@@ -100,6 +100,7 @@ Boston, MA 02111-1307, USA.  */
 /* Don't assume anything about the header files.  */
 #define NO_IMPLICIT_EXTERN_C
 
+/* Override svr4.h  */
 #undef MD_EXEC_PREFIX
 #undef MD_STARTFILE_PREFIX
 
@@ -138,29 +139,23 @@ Boston, MA 02111-1307, USA.  */
 #define LINK_OS_DEFAULT_SPEC "%(link_os_linux)"
 
 #undef  LINK_OS_LINUX_SPEC
-#ifndef CROSS_COMPILE
 #define LINK_OS_LINUX_SPEC "-m elf64ppc %{!shared: %{!static: \
   %{rdynamic:-export-dynamic} \
-  %{!dynamic-linker:-dynamic-linker /lib64/ld.so.1}}}"
-#else
-#define LINK_OS_LINUX_SPEC "-m elf64ppc %{!shared: %{!static: \
-  %{rdynamic:-export-dynamic} \
-  %{!dynamic-linker:-dynamic-linker ld.so.1}}}"
+  %{!dynamic-linker:-dynamic-linker /lib64/ld64.so.1}}}"
+
+#ifdef NATIVE_CROSS
+#define STARTFILE_PREFIX_SPEC "/usr/local/lib64/ /lib64/ /usr/lib64/"
 #endif
 
-#ifndef CROSS_COMPILE
 #undef  STARTFILE_LINUX_SPEC
 #define STARTFILE_LINUX_SPEC "\
-%{!shared: %{pg:/usr/lib64/gcrt1.o%s} %{!pg:%{p:/usr/lib64/gcrt1.o%s} \
-  %{!p:/usr/lib64/crt1.o%s}}} /usr/lib64/crti.o%s \
-%{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}"
-#endif
+%{!shared: %{pg:gcrt1.o%s} %{!pg:%{p:gcrt1.o%s} %{!p:crt1.o%s}}} crti.o%s \
+%{static:crtbeginT.o%s} \
+%{!static:%{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}}"
 
-#ifndef CROSS_COMPILE
 #undef  ENDFILE_LINUX_SPEC
 #define ENDFILE_LINUX_SPEC "\
-%{!shared:crtend.o%s} %{shared:crtendS.o%s} /usr/lib64/crtn.o%s"
-#endif
+%{!shared:crtend.o%s} %{shared:crtendS.o%s} crtn.o%s"
 
 #undef  TOC_SECTION_ASM_OP
 #define TOC_SECTION_ASM_OP "\t.section\t\".toc\",\"aw\""

-- 
Alan Modra
IBM OzLabs - Linux Technology Centre


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