Subject: compile problem with kernel

From: Oliver Frommel <[email-masked]>
Date: Mon, 30 Mar 1998 09:42:56 +0200 (MET DST)

hello,

i got the kernel (linux-980326) from linux.sgi.com and had the following
problems crosscompiling it from intel-linux (which appeared on list once, but
without any answer/solution as far as i remember):

mips-linux-gcc -D__KERNEL__ -I/mnt/dsk1/devel/mips/linux-980326/include -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer -G 0 -mno-abicalls -fno-pic -mcpu=r4600 -mips2 -pipe -c entry.S -o entry.o
entry.S: Assembler messages:
entry.S:147: Error: .previous without corresponding .section; ignored
entry.S:147: Error: .previous without corresponding .section; ignored
entry.S:148: Error: .previous without corresponding .section; ignored
entry.S:148: Error: .previous without corresponding .section; ignored
entry.S:154: Error: .previous without corresponding .section; ignored
entry.S:154: Error: .previous without corresponding .section; ignored
entry.S:156: Error: .previous without corresponding .section; ignored
entry.S:156: Error: .previous without corresponding .section; ignored
entry.S:157: Error: .previous without corresponding .section; ignored
entry.S:157: Error: .previous without corresponding .section; ignored
entry.S:158: Error: .previous without corresponding .section; ignored
entry.S:158: Error: .previous without corresponding .section; ignored
make[1]: *** [entry.o] Error 1
make[1]: Leaving directory `/mnt/dsk1/devel/mips/linux-980326/arch/mips/kernel'
make: *** [linuxsubdirs] Error 2

i'd appreciate an explanation what's happening here very much ..

thanks
-oliver

---

From: [email-masked]
Date: Mon, 30 Mar 1998 15:42:44 +0200

> i'd appreciate an explanation what's happening here very much ..

In the vanilla FSF sources the .previous pseudo is broken resulting in
these messages.  The fix is in 2.7-4 and newer.

  Ralf

---

From: [email-masked]
Date: Tue, 31 Mar 1998 09:14:52 +0200

On Tue, Mar 31, 1998 at 09:26:20AM +0200, Ulf Carlsson wrote:

> On Mon, 30 Mar 1998 [email-masked] wrote:
> 
> What are the vanilla FSF sources? The only FSF I have knowlegde of is the
> Free Software Foundation :-)

Sorry, but the FSF doesn't over any other flavour except vanilla ;-)

> Do I need a new crosscompiler?

Not really, if you have a native compiler setup.  A crosscompiler is
however very handy and sometimes even necessary when bootstrapping for a
new system.

  Ralf

---

From: Ulf Carlsson <[email-masked]>
Date: Tue, 31 Mar 1998 09:26:20 +0200 (CEST)

- Ulf

---

From: Oliver Frommel <[email-masked]>
Date: Tue, 31 Mar 1998 09:32:33 +0200 (MET DST)

Hi,

I am currently trying to rebuild recent binutils and gcc with host=x86 and
target=mips-linux. So far I've built binutils-2.8.1 with the patch from sgi.com
applied but I have some problems building gcc. I have two questions regarding 
the setup of the crosscompilation environment:

1. is gas supposed to be part of the binutils package, of the gcc package or
 is it a package on its own? I've built gas from the binutils dist and put it
 into the binutils.rpm now while I found it in gcc-xcompile...2.7.2-3.rpm
 on sgi.com ..

2. which compiler source & patches am i supposed to use? I've tried the original
 gcc-2.7.2 with patches 2.7.2-6 and 2.7.2-7 from sgi.com applied, but I am not
 sure if those are meant to be used with a native mips-linux host & target.
 Anyway I am getting this error when I try to compile gcc now:

./xgcc -B./ -DCROSS_COMPILE -DIN_GCC    -I./include -I. -I. -I./config  \
  -DCRT_BEGIN -finhibit-size-directive -fno-inline-functions \
   -c ./crtstuff.c
as: unrecognized option `-PIC'
make: *** [stamp-crt] Error 1

(btw.: I am using a non-optimizing version of gcc on the crosscompiler host due
 to a problem with the Cyrix processor ..)

thanks
-oliver

---

From: Oliver Frommel <[email-masked]>
Date: Tue, 31 Mar 1998 09:39:47 +0200 (MET DST)

Hi,

i forgot to add the output of xgcc compiling with -v ... 

$ ../xgcc -v -B../ -c test.c

 ../cpp -lang-c -v -isystem ../include -undef -D__GNUC__=2 -D__GNUC_MINOR__=7 -D__ELF__ -D_MIPS_SIM=_MIPS_SIM_ABI32 -D__PIC__ -D__pic__ -Dunix -Dmips -DR3000 -DMIPSEB -Dlinux -D__ELF__ -D_MIPS_SIM=_MIPS_SIM_ABI32 -D__PIC__ -D__pic__ -D__unix__ -D__mips__ 
-D__R3000__ -D__MIPSEB__ -D__linux__ -D__unix -D__mips -D__R3000 -D__MIPSEB -D__linux -Asystem(linux) -Asystem(posix) -Acpu(mips) -Amachine(mips) -D__LANGUAGE_C__ -DLANGUAGE_C -D_MIPS_FPSET=32 -D_MIPS_ISA=_MIPS_ISA_MIPS1 -D_MIPS_SZINT=32 -D__SIZE_TYPE__=u
nsigned int -D__SSIZE_TYPE__=int -D__PTRDIFF_TYPE__=int -D_MIPS_SZLONG=32 -D_MIPS_SZPTR=32 test.c /tmp/cca22420.i
GNU CPP version 2.7.2 [AL 1.1, MM 40] (MIPS Linux/ELF)
#include "..." search starts here:
#include <...> search starts here:
 ../include
 /usr/lib/gcc-lib/mips-linux/2.7.2/include
 /usr/lib/gcc-lib/mips-linux/2.7.2/sys-include
 /usr/mips-linux/include
End of search list.
 ../cc1 /tmp/cca22420.i -quiet -dumpbase test.c -version -o /tmp/cca22420.s
GNU C version 2.7.2 [AL 1.1, MM 40] (MIPS Linux/ELF) compiled by GNU C version 2.7.2.3.
 as -v -KPIC -o test.o /tmp/cca22420.s
GNU assembler version 2.8.1 (i686-pc-linux-gnu), using BFD version linux-2.8.1.0.1
as: unrecognized option `-PIC'

-oliver

---

From: [email-masked]
Date: Tue, 31 Mar 1998 16:38:48 +0200

> as: unrecognized option `-PIC'

Your crosscompiler is caling the native assembler.  Did you install binutils?
Did you configure the sources them using the same --prefix option?

  Ralf

---

From: Oliver Frommel <[email-masked]>
Date: Tue, 31 Mar 1998 16:46:53 +0200 (MET DST)

> Did you configure the sources them using the same --prefix option?

i installed the binutils-2.8.1 with the following configuration:

./configure --prefix=/tmp/binutils-xcompile-root/usr/local --program-prefix=mips
-linux- --enable-shared --target=mips-linux

-oliver

---

From: [email-masked]
Date: Tue, 31 Mar 1998 16:49:48 +0200

On Tue, Mar 31, 1998 at 09:32:33AM +0200, Oliver Frommel wrote:

> 1. is gas supposed to be part of the binutils package,

Yes.

> of the gcc package or

> 2. which compiler source & patches am i supposed to use?

Binutils 2.7-4 and newer are ok for kernels; userland needs 2.8.1-1 or
newer or building certain shared libs will fail.

GCC 2.7.2-7 is ok.  Btw, you only need to apply one of these patches;
none of my binutils or gcc patches was meant to be applied incrementally.

>  Anyway I am getting this error when I try to compile gcc now:

You can build both native and crosscompilers from the same source.  That's
the beauty of GCC.

  Ralf

---

From: [email-masked]
Date: Tue, 31 Mar 1998 16:55:02 +0200

> -linux- --enable-shared --target=mips-linux

You loose.  You install software in /tmp???

  Ralf

---

From: Oliver Frommel <[email-masked]>
Date: Tue, 31 Mar 1998 16:57:52 +0200 (MET DST)

> You loose.  You install software in /tmp???

yeah. i lose - i use RPM :-)
seriuosly, i've installed it in /tmp/binutils-xcompile-root and packaged the RPM
from there, then installed the RPM whose -qpl looks like this:

/usr/local/bin/mips-linux-c++filt
/usr/local/bin/mips-linux-gasp
/usr/local/bin/mips-linux-ld
/usr/local/bin/mips-linux-nm
/usr/local/bin/mips-linux-objcopy
/usr/local/bin/mips-linux-objdump
/usr/local/bin/mips-linux-ranlib
/usr/local/bin/mips-linux-size
/usr/local/bin/mips-linux-strings
/usr/local/bin/mips-linux-strip
/usr/local/bin/mips-linux-as
/usr/local/bin/mips-linux-ar
/usr/local/mips-linux/bin/ar
/usr/local/mips-linux/bin/as
/usr/local/mips-linux/bin/ld
/usr/local/mips-linux/bin/nm
/usr/local/mips-linux/bin/ranlib
/usr/local/mips-linux/bin/strip
/usr/local/lib/libmips-linux-bfd.so
/usr/local/lib/libmips-linux-bfd.so.2.8.1
/usr/local/lib/libmips-linux-opcodes.a
/usr/local/lib/libmips-linux-opcodes.so
/usr/local/lib/libmips-linux-opcodes.so.2.8.1
...

-oliver

---

From: [email-masked]
Date: Tue, 31 Mar 1998 17:33:03 +0200

> from there, then installed the RPM whose -qpl looks like this:

That strategy fails for alot of GNU autoconf'ed software.  Better do it
like:

  ./configure --prefix=/usr/local
  make ...
  make prefix=/tmp/binutils-xcompile-root/usr/local install

Otherwise you might end up with an embedded /tmp/binutils... path in
some files.  This for example happens when building GCC.

  Ralf

---

From: Oliver Frommel <[email-masked]>
Date: Tue, 31 Mar 1998 17:59:57 +0200 (MET DST)

hi,

ich hab einen dir einen account auf greasy.aec.at eingerichtet.
login: ralf, passwd: foobar7

die sourcen und patches fuer binutils sind in /usr/src/redhat...
die entpackte source fuer gcc-2.7.2 ind /home/oliver/devel/gcc-2.7.2

ciao
-oliver

---

From: Dong Liu <[email-masked]>
Date: Tue, 31 Mar 1998 11:16:21 -0500

> however very handy and sometimes even necessary when bootstrapping for a

I also have the same problem, however I don't have a native compiler,
I can't make the pre-compiled kernel boot on my Indy:), I'm cross
compiling it on i486-linux I got my binutils from 

ftp://ftp.linux.sgi.com/pub/crossdev/i486-linux/mips-linux

Where can I ftp binutils 2.7-4 ?

Thanks!

Dong