This is the mail archive of the crossgcc@sources.redhat.com mailing list for the crossgcc project.

See the CrossGCC FAQ for lots more information.


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

[SOLVED] Re: Problems building cross-compiler on Sparc Solaris 8for x86 Solaris 10... (cont.)


I'd like to report success in my endeavor, however I did have to do some
tinkering with some make/configure scripts... my patch is attached
below. Note that I didn't alter configure.in because I didn't feel like
running autoconf over the tree. Make of it what you will, but this patch
allowed me to build gcc 3.4.3 with C and C++ for Solaris 10 x86 with a
Solaris 8 Sparc as host, using --with-sysroot instead of --with-libs/--
with-headers. 

To those who wrote in, thanks for your help with this.

-- 
Aaron Gaudio           agaudio @ eng.mc.xerox.com           585-422-6876
               madcap @ irc://rockhopper.eng.mc.xerox.com
 OpenPGP fingerprint: 74B3 1018 08EB 1B3F E7C7  B944 11B1 E0C3 949C 8906
             "Every man is a mob, a chain gang of idiots." 
                     - Jonathan Nolan, /Memento Mori/
--- gcc-3.4.3/gcc/config/i386/t-sol2.adg	2005-04-06 17:04:47.534758000 -0400
+++ gcc-3.4.3/gcc/config/i386/t-sol2	2005-04-06 17:04:51.574745000 -0400
@@ -9,7 +9,7 @@
 # the comments with sed.  This bug may only be in the Early Access releases.
 gcrt1.o: $(srcdir)/config/i386/sol2-gc1.asm
 	sed -e '/^!/d' <$(srcdir)/config/i386/sol2-gc1.asm >gcrt1.s
-	$(AS) -o gcrt1.o gcrt1.s
+	$(AS_FOR_TARGET) -o gcrt1.o gcrt1.s
 crt1.o: $(srcdir)/config/i386/sol2-c1.asm $(GCC_PASSES)
 	sed -e '/^!/d' <$(srcdir)/config/i386/sol2-c1.asm >crt1.s
 	$(GCC_FOR_TARGET) -c -o crt1.o crt1.s
--- gcc-3.4.3/configure.sysroot	2005-04-07 18:12:41.844794000 -0400
+++ gcc-3.4.3/configure	2005-04-07 18:51:57.034688000 -0400
@@ -38,6 +38,7 @@
 site=
 srcdir=
 target=NONE
+target_sysroot=
 verbose=
 x_includes=NONE
 x_libraries=NONE
@@ -2723,7 +2724,25 @@
 # being built; programs in there won't even run.
 if test "${build}" = "${host}" && test -d ${srcdir}/gcc; then
   # Search for pre-installed headers if nothing else fits.
-  FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -B$(build_tooldir)/bin/ -B$(build_tooldir)/lib/ -isystem $(build_tooldir)/include -isystem $(build_tooldir)/sys-include'
+  TARGET_LIBS=
+  TARGET_INCLUDES=
+	
+  FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -B$(build_tooldir)/bin/ -B$(build_tooldir)/lib/'
+  
+  # if --with-sysroot, use the system root, otherwise, use the copied libs and headers under
+  # build_tooldir
+  if test "${with_sysroot+set}" = set; then
+	
+	case ${with_sysroot} in
+	yes) target_sysroot='${exec_prefix}/${target_noncanonical}/sys-root' ;;
+	*) target_sysroot=$with_sysroot ;;
+	esac
+	
+	FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -B$(target_sysroot)/lib -B$(target_sysroot)/usr/lib -isystem $(target_sysroot)/usr/include'
+	
+  else
+	FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -B$(build_tooldir)/bin/ -B$(build_tooldir)/lib/ -isystem $(build_tooldir)/include -isystem $(build_tooldir)/sys-include'
+  fi
 fi
 
 if test "x${use_gnu_ld}" = x &&
@@ -4293,6 +4312,7 @@
 s%@gcc_version@%$gcc_version%g
 s%@tooldir@%$tooldir%g
 s%@build_tooldir@%$build_tooldir%g
+s%@target_sysroot@%$target_sysroot%g
 s%@GDB_TK@%$GDB_TK%g
 s%@gxx_include_dir@%$gxx_include_dir%g
 s%@libstdcxx_incdir@%$libstdcxx_incdir%g
--- gcc-3.4.3/Makefile.in.sysroot	2005-04-07 18:48:55.494603000 -0400
+++ gcc-3.4.3/Makefile.in	2005-04-07 18:49:55.384593000 -0400
@@ -83,6 +83,7 @@
 
 tooldir = @tooldir@
 build_tooldir = @build_tooldir@
+target_sysroot = @target_sysroot@
 
 # Directory in which the compiler finds executables, libraries, etc.
 libsubdir = $(libdir)/gcc/$(target_alias)/$(gcc_version)

Attachment: signature.asc
Description: This is a digitally signed message part


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