Re: Trying to build crosscompiler for Sparc Solaris 8 -> Sparc Solaris 10 (& others)...

2005-04-05 Thread Aaron Gaudio
udiv_w_sdiv.o libgcc/./_udivmoddi4.o  libgcc/./unwind-dw2.o 
libgcc/./unwind-dw2-fde.o libgcc/./unwind-sjlj.o libgcc/./gthr-gnat.o 
libgcc/./unwind-c.o; echo %%; \
  cat ../../gcc-3.4.3/gcc/libgcc-std.ver \
| sed -e '/^[   ]*#/d' \
  -e 's/^%\(if\|else\|elif\|endif\|define\)/#\1/' \
| $(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) $(INCLUDES)  -E 
-xassembler-with-cpp -; \
} | $(AWK) -f ../../gcc-3.4.3/gcc/mkmap-symver.awk  > 
libgcc/./tmp-libgcc.map
mv 'libgcc/./tmp-libgcc.map' $@


NM_FOR_TARGET is defined in gcc/Makefile as this:

NM_FOR_TARGET = ` \
  if [ -f ./nm ] ; then \
echo ./nm ; \
  elif [ -f $(objdir)/../binutils/nm-new ] ; then \
echo $(objdir)/../binutils/nm-new ; \
  else \
if [ "$(host)" = "$(target)" ] ; then \
  echo nm; \
else \
   t='$(program_transform_name)'; echo nm | sed -e $$t ; \
fi; \
  fi`


Which looks correct, but in mklibgcc, the '$$t' appears to get lost in
translation. My guess is that it's being passed as a shell environment
variable with improper quoting, rather than just resolving the variable
before executing the script. Whatever it is, it is certainly an error
right now.

Also, shouldn't the script exit prematurely when something like this
fails?

Please advise...

(below is my original note to gcc-help)

On Tue, 2005-04-05 at 12:15 -0400, Aaron Gaudio wrote: 
> As the subject suggests, I'm attempting to build a cross-compiler on a
> Sparc Solaris 8 host system with a target of Sparc Solaris 10. Once I
> can get this, I plan on building a cross-compiler for i386 Solaris 10
> (so my attempt is not purely academic).
> 
> I have already installed binutils 2.15 and gcc 3.4.5 native Solaris 8
> verisons in the prefix /vobs/java/gnu and added this directory to my
> path, so that those are the tools being used for building the cross-
> compiler environment.
> 
> I've unpacked the Solaris 10 libraries and headers
> to /vobs/java/gnu/sparc-sun-solaris-2.10.
> 
> I'm building Solaris 10 binutils 2.15, configured via 
> 
> configure --prefix=/vobs/java/gnu --target=sparc-sun-solaris2.10 --with-
> sysroot=/vobs/java/gnu/sparc-sun-solaris-2.10
> 
> (note that I don't see any reference to --with-sysroot in the binutils
> configure scripts, so I'm not sure that's even doing anything) and with
> 
> LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/usr/ccs/lib:/usr/local/lib"
> 
> (/usr/local/lib is where libiconv.so.2 is)
> 
> binutils builds and installs without problem.
> 
> Then I try to build gcc 3.4.3 (from /vobs/java/gnu/buildroot/gcc-build)
> using 
> 
> ../gcc-3.4.3/configure --prefix=/vobs/java/gnu --target=sparc-sun-
> solaris2.10 --enable-languages=c,c++ --with-gnu-ld --with-gnu-as --with-
> sysroot=/vobs/java/gnu/sparc-sun-solaris-2.10
> 
> Make ends up failing on the following command:
> /vobs/java/gnu/buildroot/gcc-build/gcc/xgcc 
> -B/vobs/java/gnu/buildroot/gcc-build/gcc/ 
> -B/vobs/java/gnu/sparc-sun-solaris2.10/bin/ 
> -B/vobs/java/gnu/sparc-sun-solaris2.10/lib/ -isystem 
> /vobs/java/gnu/sparc-sun-solaris2.10/include -isystem 
> /vobs/java/gnu/sparc-sun-solaris2.10/sys-include -O2  -DIN_GCC 
> -DCROSS_COMPILE   -W -Wall -Wwrite-strings -Wstrict-prototypes 
> -Wmissing-prototypes -Wold-style-definition  -isystem ./include  -fPIC -g 
> -DHAVE_GTHR_DEFAULT -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED  -shared 
> -nodefaultlibs -Wl,--soname=libgcc_s.so.1 
> -Wl,--version-script=libgcc/sparcv9/libgcc.map -o sparcv9/libgcc_s.so.1.tmp  
> -m64  libgcc/sparcv9/_muldi3.o libgcc/sparcv9/_negdi2.o 
> libgcc/sparcv9/_lshrdi3.o libgcc/sparcv9/_ashldi3.o libgcc/sparcv9/_ashrdi3.o 
> libgcc/sparcv9/_cmpdi2.o libgcc/sparcv9/_ucmpdi2.o 
> libgcc/sparcv9/_floatdidf.o libgcc/sparcv9/_floatdisf.o 
> libgcc/sparcv9/_fixunsdfsi.o libgcc/sparcv9/_fixunssfsi.o 
> libgcc/sparcv9/_fixunsdfdi.o libgcc/sparcv9/_fixdfdi.o 
> libgcc/sparcv9/_fixunssfdi.o libgcc/sparcv9/_fixsfdi.o 
> libgcc/sparcv9/_fixxfdi.o libgcc/sparcv9/_fixunsxfdi.o 
> libgcc/sparcv9/_floatdixf.o libgcc/sparcv9/_fixunsxfsi.o 
> libgcc/sparcv9/_fixtfdi.o libgcc/sparcv9/_fixunstfdi.o 
> libgcc/sparcv9/_floatditf.o libgcc/sparcv9/_clear_cache.o 
> libgcc/sparcv9/_enable_execute_stack.o libgcc/sparcv9/_trampoline.o 
> libgcc/sparcv9/__main.o libgcc/sparcv9/_absvsi2.o libgcc/sparcv9/_absvdi2.o 
> libgcc/sparcv9/_addvsi3.o libgcc/sparcv9/_addvdi3.o libgcc/sparcv9/_subvsi3.o 
> libgcc/sparcv9/_subvdi3.o libgcc/sparcv9/_mulvsi3.o libgcc/sparcv9/_mulvdi3.o 
> libgcc/sparcv9/_negvsi2.o libgcc/sparcv9/_negvdi2.o libgcc/sparcv9/_ctors.o 
> libgcc/sparcv9/_ffssi2.o libgcc/sparcv9/_ffsdi2.o libgcc/sparcv9/_clz.o 
> libgcc/sparcv9/_clzsi2.o libgcc/sparcv9/_clzdi2.o libgc

RE: Trying to build crosscompiler for Sparc Solaris 8 -> SparcSolaris 10 (& others)...

2005-04-06 Thread Aaron Gaudio
On Wed, 2005-04-06 at 10:28 +0100, Dave Korn wrote:
> Original Message
> >From: Aaron Gaudio
> >Sent: 05 April 2005 21:05
> 
> > (CCing this to [EMAIL PROTECTED] due to potential build bugs...)
> 
> > I have already installed binutils 2.15 and gcc 3.4.5 native Solaris 8
> > verisons in the prefix /vobs/java/gnu and added this directory to my
> > path, so that those are the tools being used for building the cross-
> > compiler environment.
> 
>   Two things to check: 
> 
>  1) Try specifying an absolute rather than relative path to the gcc
> configure script; I think this has been known to be a source of problems on
> solaris platforms in the past, but I don't know if it's still relevant now.
> It can't hurt to try.
> 
>  2) If what you say above is *literally* correct, then the reason the wrong
> assembler is being found is because you've added $prefix to your $PATH, when
> you should have added $prefix/bin!
> 
> 

Thanks for your attention, Dave. I checked the script I'm using to build
and I actually am using an absolute path to gcc's configure, despite
what I wrote in my original mailnote. 

As for the prefix... you're right, I should be adding $prefix/bin to my
path. I was adding $prefix in my script, but lo, I had already added
$prefix/bin to my path in my shell. I'll fix my script, but that won't
have any impact on the problems I'm facing. You see, the 'as' being
called was in fact the one in $prefix/bin, but the problem is that
$prefix is a holding place for binaries with multiple targets.
$prefix/bin/as is a Sparc Solaris 8 binary with a Sparc Solaris 8 target
(eg --version "This assembler was configured for a target of `sparc-sun-
solaris2.8'."). However, $prefix/bin/i586-sun-solaris2.10-as is a Sparc
Solaris 8 binary with an i586 Solaris 10 target (--version "This
assembler was configured for a target of `i586-sun-solaris2.10'."). 

It seems like either Makefile should be using $AS_FOR_TARGET (which
would expand to 'i586-sun-solaris2.10-as'), instead of $AS (which is
just 'as') OR the .s file being assembled should be using Sparc assembly
instructions instead of x86. I assumed the former was the case, and that
let me get further in the build, so that's what I've stuck with for
now...

-- 
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/


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