All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
* More GCC problems
@ 2000-11-03 10:21 Ian Chilton
  0 siblings, 0 replies; 7+ messages in thread
From: Ian Chilton @ 2000-11-03 10:21 UTC (permalink / raw
  To: linux-mips

Hello,

I posted the other day, with a problem compiling the GCC from oss.sgi.com/pub/linux/mips/mips-linux/simple/crossdev/src
I think it was 17/10/2000 IIRC.

I am trying to build a static GCC (2.97) using egcs 1.0.3a

So, I tried the older 07-07-2000, and this does not work either....arrgh

gcc -c  -DIN_GCC    -W -Wall -Wtraditional -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -pedantic -Wno-long-long -O2 -g -O2  -DHAVE_CONFIG_H    -I. -I../../gcc -I../../gcc/config -I../../gcc/../include \
  ../../gcc/gencheck.c
cc1: Invalid option `-Wno-long-long'
make[2]: *** [gencheck.o] Error 1
make[2]: Leaving directory `/mnt/hd2/lfstmp/gcc-000707/gcc-build/gcc'
make[1]: *** [bootstrap] Error 2


I tried running make in the gcc directory, and get:

gcc -c  -DIN_GCC    -g  -W -Wall -Wtraditional -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes  -DHAVE_CONFIG_H    -I. -I../../gcc -I../../gcc/config -I../../gcc/../include ../../gcc/fold-const.c
../../gcc/fold-const.c: In function `div_and_round_double':
../../gcc/fold-const.c:676: warning: comparison between signed and unsigned
../../gcc/fold-const.c: In function `optimize_bit_field_compare':
../../gcc/fold-const.c:2936: warning: comparison between signed and unsigned
../../gcc/fold-const.c: In function `fold':
../../gcc/fold-const.c:5726: warning: comparison between signed and unsigned
../../gcc/fold-const.c:5737: warning: comparison between signed and unsigned
/tmp/cca08866.s: Assembler messages:
/tmp/cca08866.s:27593: Error: Branch out of range
/tmp/cca08866.s:27632: Error: Branch out of range
/tmp/cca08866.s:27637: Error: Branch out of range
make: *** [fold-const.o] Error 1
[root@dale:/mnt/hd2/lfstmp/gcc-000707/gcc-build/gcc]# 



Any ideas?
 

Thanks!


Bye for Now,

Ian


                     \|||/ 
                     (o o)
 /----------------ooO-(_)-Ooo----------------\
 |  Ian Chilton                              |
 |  E-Mail : ian@ichilton.co.uk              |
 \-------------------------------------------/

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: More GCC problems
@ 2000-11-03 14:37 Ian Chilton
  2000-11-03 16:18 ` Ralf Baechle
  2000-11-03 18:07 ` Keith M Wesolowski
  0 siblings, 2 replies; 7+ messages in thread
From: Ian Chilton @ 2000-11-03 14:37 UTC (permalink / raw
  To: linux-mips

Hello,

> /tmp/cca08866.s: Assembler messages:
> /tmp/cca08866.s:27593: Error: Branch out of range
> /tmp/cca08866.s:27632: Error: Branch out of range
> /tmp/cca08866.s:27637: Error: Branch out of range

I get this same thing, when doing this:

- use make-cross.sh to build a cross compiling envronment using the current cvs stuff - 001103
- cross compile gcc-001017 using this:

CC="mips-linux-gcc -I/scratch/crossdev/mips-linux/mips-linux/include" CC_FOR_BUILD=cc GCC_FOR_TARGET="mips-linux-gcc -I/s/crossdev/mips-linux/include" AR=mips-linux-ar RANLIB=mips-linux-ranlib LD=mips-linux-ld ../configure --prefix=/usr --enable-threads --enable-languages=c --host=mips-linux --target=mips-linux --build=`../config.guess` && make


PLEASE someone help me out here.... I have spent the last 2 days trying to compile GCC. I have tried every version I can find, from 07072000 to 1707200 which suposidly work, to the lastest CVS version. I have tried native and cross compiling....

The only gcc builds I have had work is egcs-1.0.3a, and a 2.97 cross compile. 


I need a 2.97 native build, static, to compile glibc 2.2, then build a 2.97 dynamic.


HEEEELLLP!
 

Thanks!


Bye for Now,

Ian


                     \|||/ 
                     (o o)
 /----------------ooO-(_)-Ooo----------------\
 |  Ian Chilton                              |
 |  E-Mail : ian@ichilton.co.uk              |
 \-------------------------------------------/

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: More GCC problems
  2000-11-03 14:37 More GCC problems Ian Chilton
@ 2000-11-03 16:18 ` Ralf Baechle
  2000-11-03 18:07 ` Keith M Wesolowski
  1 sibling, 0 replies; 7+ messages in thread
From: Ralf Baechle @ 2000-11-03 16:18 UTC (permalink / raw
  To: Ian Chilton; +Cc: linux-mips

On Fri, Nov 03, 2000 at 02:37:25PM +0000, Ian Chilton wrote:

> Hello,
> 
> > /tmp/cca08866.s: Assembler messages:
> > /tmp/cca08866.s:27593: Error: Branch out of range
> > /tmp/cca08866.s:27632: Error: Branch out of range
> > /tmp/cca08866.s:27637: Error: Branch out of range

This is a bug in all MIPS versions of gas I've ever examined, including the
vendors of GNU based development systems like Algorithmics.  The problem is
that gcc is producing code that results in loops of over 128kb size, so the
range of a normal branch is exceeded.  Gas should then convert assembler
code such as

loop:
	# > 128kb loop body
	bnez	reg, loop

into:

loop:
	# > 128kb loop body
	beq	reg, endloop
	jump	loop
endloop:

That's a non-trivial gas modification.

This is becoming an increasing problem with today's codesize.  Right now
only few applications are affected but Moore's law is mercyless ...

In this particular case I'll simply optimizing the code with -O1 or higher
will help by getting the loop body's size below 128kb size.  This may also
help with other affected packages.  It's however only a temporary solution;
we'll see code in the not to far future where the optimizer is no longer
able to get the code size below the critical size of 128kb.

  Ralf

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: More GCC problems
  2000-11-03 14:37 More GCC problems Ian Chilton
  2000-11-03 16:18 ` Ralf Baechle
@ 2000-11-03 18:07 ` Keith M Wesolowski
  2000-11-03 18:27   ` Maciej W. Rozycki
  2000-11-03 20:04   ` Ian Chilton
  1 sibling, 2 replies; 7+ messages in thread
From: Keith M Wesolowski @ 2000-11-03 18:07 UTC (permalink / raw
  To: Ian Chilton; +Cc: linux-mips

On Fri, Nov 03, 2000 at 02:37:25PM +0000, Ian Chilton wrote:

> Hello,
> 
> > /tmp/cca08866.s: Assembler messages:
> > /tmp/cca08866.s:27593: Error: Branch out of range
> > /tmp/cca08866.s:27632: Error: Branch out of range
> > /tmp/cca08866.s:27637: Error: Branch out of range
> 
> I get this same thing, when doing this:

Don't blame the compiler. This is a gas problem. You should be able to
get around it by using optimization; -O2 is sufficient I believe. If
not, you may have to use -Os.

> PLEASE someone help me out here.... I have spent the last 2 days
> trying to compile GCC. I have tried every version I can find, from
> 07072000 to 1707200 which suposidly work, to the lastest CVS
> version. I have tried native and cross compiling....  I need a 2.97
> native build, static, to compile glibc 2.2, then build a 2.97
> dynamic.

I have no idea how to build a static compiler. The approach I took to
get my working native 1019 compiler was to cross-build it with the
same version. Since it was built against glibc 2.2, I simply installed
both glibc 2.2 and the new native compiler on my system.

-- 
Keith M Wesolowski			wesolows@chem.unr.edu
University of Nevada			http://www.chem.unr.edu
Chemistry Department Systems and Network Administrator

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: More GCC problems
  2000-11-03 18:07 ` Keith M Wesolowski
@ 2000-11-03 18:27   ` Maciej W. Rozycki
  2000-11-03 20:04   ` Ian Chilton
  1 sibling, 0 replies; 7+ messages in thread
From: Maciej W. Rozycki @ 2000-11-03 18:27 UTC (permalink / raw
  To: Keith M Wesolowski; +Cc: Ian Chilton, linux-mips

On Fri, 3 Nov 2000, Keith M Wesolowski wrote:

> I have no idea how to build a static compiler. The approach I took to

 Just add "-static" to CFLAGS in the usual way.

> get my working native 1019 compiler was to cross-build it with the
> same version. Since it was built against glibc 2.2, I simply installed
> both glibc 2.2 and the new native compiler on my system.

 But check the "cross_compile" statement in the gcc's specs file. 
Depending on the way of installing a cross-compiled native compiler on the
host machine you may get it right or not -- it should be "0".  I had to
tweak it manually when making an RPM package of gcc-2.95.3 (packages
available from ftp://ftp.ds2.pg.gda.pl/pub/macro).

-- 
+  Maciej W. Rozycki, Technical University of Gdansk, Poland   +
+--------------------------------------------------------------+
+        e-mail: macro@ds2.pg.gda.pl, PGP key available        +

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: More GCC problems
  2000-11-03 18:07 ` Keith M Wesolowski
  2000-11-03 18:27   ` Maciej W. Rozycki
@ 2000-11-03 20:04   ` Ian Chilton
  2000-11-03 21:41     ` Maciej W. Rozycki
  1 sibling, 1 reply; 7+ messages in thread
From: Ian Chilton @ 2000-11-03 20:04 UTC (permalink / raw
  To: Keith M Wesolowski; +Cc: linux-mips

> Don't blame the compiler. This is a gas problem. You should be able to
> get around it by using optimization; -O2 is sufficient I believe. If
> not, you may have to use -Os.

-Os?


> I have no idea how to build a static compiler.

make -LDFLAGS=-static
but just make didn't work either..


> The approach I took t
> get my working native 1019 compiler was to cross-build it with the
> same versiona


The problem is, I can't cross-compile either  :(


Bye for Now,

Ian


                     \|||/ 
                     (o o)
 /----------------ooO-(_)-Ooo----------------\
 |  Ian Chilton                              |
 |  E-Mail : ian@ichilton.co.uk              |
 \-------------------------------------------/

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: More GCC problems
  2000-11-03 20:04   ` Ian Chilton
@ 2000-11-03 21:41     ` Maciej W. Rozycki
  0 siblings, 0 replies; 7+ messages in thread
From: Maciej W. Rozycki @ 2000-11-03 21:41 UTC (permalink / raw
  To: ian; +Cc: Keith M Wesolowski, linux-mips

On Fri, 3 Nov 2000, Ian Chilton wrote:

> > I have no idea how to build a static compiler.
> 
> make -LDFLAGS=-static
> but just make didn't work either..

$ CFLAGS='-static' ./configure
$ make

That's the usual way.  You need to specify necessary options to configure
as well.  You may also put other options in CFLAGS.  You may also specify
other variables -- CC, CXX, CXXFLAGS and LDFLAGS are likely to work.  For
others you need to study configure scripts yourself.

 For example I use more or less the following commands to build an
i386-linux hosted cross-compiler for mipsel-linux on an i386-linux build
system: 

$ mkdir -p obj && cd obj
$ CC="i386-linux-gcc" CXX="i386-linux-g++" \
	CFLAGS="-pipe -O2 -fomit-frame-pointer" \
	CXXFLAGS="-pipe -O2 -fomit-frame-pointer" \
	../configure --prefix=/usr \
	--with-local-prefix=/usr/mipsel-linux/local \
	--enable-shared --enable-haifa --enable-threads \
	--cache-file=config.cache \
	--build=i386-linux --host=i386-linux --target=mipsel-linux
$ make all

and the following lines to build a mipsel-linux native compiler on an
i386-linux build system:

$ mkdir -p obj && cd obj
$ CC="i386-linux-gcc" CXX="i386-linux-g++" \
	CC_FOR_BUILD="i386-linux-gcc" \
	CXX_FOR_BUILD="i386-linux-g++" \
	CC_FOR_TARGET="mipsel-linux-gcc" \
	CXX_FOR_TARGET="mipsel-linux-g++" \
	CFLAGS="-pipe -O2 -fomit-frame-pointer" \
	CXXFLAGS="-pipe -O2 -fomit-frame-pointer" \
	../configure --prefix=/usr \
	--enable-shared --enable-haifa --enable-threads \
	--cache-file=config.cache \
	--build=i386-linux --host=mipsel-linux --target=mipsel-linux
$ make all
	
Note also you need to have glibc headers for the target system installed
on your build system before performing either builds.  I believe gcc
expects them to be found in ${prefix}/${target_alias}/sys-include (that
would be /usr/mipsel-linux/sys-include for the above examples).  It will
copy them to ${prefix}/${target_alias}/include upon build.

 If you do not fear of deep RPM magic, you may try to bootstrap a compiler
toolchain using packages I made available at
ftp://ftp.ds2.pg.gda.pl/pub/macro.  You'll need .rpm* files available
there -- as you are building for mips-linux and I use mipsel-linux, you'll
have to tweak all the files with `sed s/mipsel/mips/g'.  Then you may
start building binary packages from source ones.  You will have to modify
mipsel-linux-* packages slightly -- basically `sed s/mipsel/mips/g' again. 
You need to build packages in a specific order and install every built
package before proceeding to the following one.

 The order is:

1. mips-linux-binutils, mips-linux-boot-glibc-headers (in any order),

2. mips-linux-boot-gcc,

3. mips-linux-glibc,

4. mips-linux-gcc,

5. binutils, gcc (native, for mips-linux; basically any mips-linux
software).

Spec files include appropriate "BuildRequires" statements to remind you
(and rpm) which packages have be installed to build a given package.  The
packages reflect the way I bootstrapped a mipsel-linux system from scratch
on an i386-linux build system.  Gcc is 2.95.3 (or 2.95.2 plus a
few patches, actually), which is sufficient to build glibc 2.2.  You may
build a current gcc snapshot with it if you need to.

 Please note there is a compatibility breakage as of Oct 28th (see the
README file available at the site; it's also explained in change logs for
binutils and glibc).  You may want to fetch earlier binutils and glibc
packages (barring the binary compatibility they work equally well) if you
insist on a compatibility with a current binutils snapshot and binaries
available throughout the Internet.  I'll submit an appropriate change to
the binutils CVS soon; glibc 2.1.97 already has the fix applied.

 I hope this helps,

  Maciej

-- 
+  Maciej W. Rozycki, Technical University of Gdansk, Poland   +
+--------------------------------------------------------------+
+        e-mail: macro@ds2.pg.gda.pl, PGP key available        +

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2000-11-03 21:45 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2000-11-03 14:37 More GCC problems Ian Chilton
2000-11-03 16:18 ` Ralf Baechle
2000-11-03 18:07 ` Keith M Wesolowski
2000-11-03 18:27   ` Maciej W. Rozycki
2000-11-03 20:04   ` Ian Chilton
2000-11-03 21:41     ` Maciej W. Rozycki
  -- strict thread matches above, loose matches on Subject: below --
2000-11-03 10:21 Ian Chilton

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.