* Which compiler should I use to make mips64 kernel
@ 2003-05-06 6:54 Guo Michael
2003-05-06 12:40 ` Ralf Baechle
2003-05-06 13:04 ` Maciej W. Rozycki
0 siblings, 2 replies; 4+ messages in thread
From: Guo Michael @ 2003-05-06 6:54 UTC (permalink / raw)
To: linux-mips
Hello, I want to build mips64el kernel and downloaded the mips64el
toolchain from ftp://ftp.ds2.pg.gda.pl/pub/macro/ (Maciej W. Rozycki's
site) and I got following errors:
. scripts/mkversion > .tmpversion
mips64el-linux-gcc -D__KERNEL__ -I/home/michael/linux-working/linux/include
-Wall -Wstrict-prototypes -Wno-trigraphs -O2 -fno-strict-aliasing
-fno-common -fomit-frame-pointer -I
/home/michael/linux-working/linux/include/asm/gcc -mabi=64 -G 0
-mno-abicalls -fno-pic -Wa,--trap -pipe -mcpu=r4600 -mips3 -Wa,-32
-Wa,-mgp64 -DUTS_MACHINE='"mips64"' -DKBUILD_BASENAME=version -c -o
init/version.o init/version.c
make CFLAGS="-D__KERNEL__ -I/home/michael/linux-working/linux/include -Wall
-Wstrict-prototypes -Wno-trigraphs -O2 -fno-strict-aliasing -fno-common
-fomit-frame-pointer -I /home/michael/linux-working/linux/include/asm/gcc
-mabi=64 -G 0 -mno-abicalls -fno-pic -Wa,--trap -pipe -mcpu=r4600 -mips3
-Wa,-32 -Wa,-mgp64 " -C arch/mips/tools
make[1]: Entering directory
`/home/michael/linux-working/linux/arch/mips/tools'
cmp -s offset.h
/home/michael/linux-working/linux/include/asm-mips64/offset.h || (cp
offset.h /home/michael/linux-working/linux/include/asm-mips64/offset.h.new
&& mv /home/michael/linux-working/linux/include/asm-mips64/offset.h.new
/home/michael/linux-working/linux/include/asm-mips64/offset.h)
make[1]: Leaving directory
`/home/michael/linux-working/linux/arch/mips/tools'
make CFLAGS="-D__KERNEL__ -I/home/michael/linux-working/linux/include -Wall
-Wstrict-prototypes -Wno-trigraphs -O2 -fno-strict-aliasing -fno-common
-fomit-frame-pointer -I /home/michael/linux-working/linux/include/asm/gcc
-mabi=64 -G 0 -mno-abicalls -fno-pic -Wa,--trap -pipe -mcpu=r4600 -mips3
-Wa,-32 -Wa,-mgp64 " -C kernel
make[1]: Entering directory `/home/michael/linux-working/linux/kernel'
make all_targets
make[2]: Entering directory `/home/michael/linux-working/linux/kernel'
rm -f kernel.o
mips64el-linux-ld -r -o kernel.o sched.o dma.o fork.o exec_domain.o
panic.o printk.o module.o exit.o itimer.o info.o time.o softirq.o
resource.o sysctl.o acct.o capability.o ptrace.o timer.o user.o signal.o
sys.o kmod.o context.o ksyms.o
mips64el-linux-ld: BFD 2.13.2.1 assertion fail elflink.h:5117
mips64el-linux-ld: BFD 2.13.2.1 assertion fail elflink.h:5117
mips64el-linux-ld: BFD 2.13.2.1 assertion fail elflink.h:5117
mips64el-linux-ld: BFD 2.13.2.1 assertion fail elflink.h:5117
mips64el-linux-ld: BFD 2.13.2.1 assertion fail elflink.h:5117
mips64el-linux-ld: BFD 2.13.2.1 assertion fail elflink.h:5117
mips64el-linux-ld: BFD 2.13.2.1 assertion fail elflink.h:5117
mips64el-linux-ld: BFD 2.13.2.1 assertion fail elflink.h:5117
mips64el-linux-ld: BFD 2.13.2.1 assertion fail elflink.h:5117
mips64el-linux-ld: BFD 2.13.2.1 assertion fail elflink.h:5117
mips64el-linux-ld: BFD 2.13.2.1 assertion fail elflink.h:5117
mips64el-linux-ld: BFD 2.13.2.1 assertion fail elflink.h:5117
mips64el-linux-ld: BFD 2.13.2.1 assertion fail elflink.h:5117
mips64el-linux-ld: BFD 2.13.2.1 assertion fail elflink.h:5117
mips64el-linux-ld: BFD 2.13.2.1 assertion fail elflink.h:5117
mips64el-linux-ld: BFD 2.13.2.1 assertion fail elflink.h:5117
mips64el-linux-ld: BFD 2.13.2.1 assertion fail elflink.h:5117
mips64el-linux-ld: BFD 2.13.2.1 assertion fail elflink.h:5117
mips64el-linux-ld: BFD 2.13.2.1 assertion fail elflink.h:5117
mips64el-linux-ld: BFD 2.13.2.1 assertion fail elflink.h:5117
mips64el-linux-ld: BFD 2.13.2.1 assertion fail elflink.h:5117
mips64el-linux-ld: BFD 2.13.2.1 assertion fail elflink.h:5117
mips64el-linux-ld: BFD 2.13.2.1 assertion fail elflink.h:5117
mips64el-linux-ld: BFD 2.13.2.1 assertion fail elflink.h:5117
mips64el-linux-ld: BFD 2.13.2.1 assertion fail elflink.h:5117
mips64el-linux-ld: BFD 2.13.2.1 assertion fail elflink.h:5117
mips64el-linux-ld: BFD 2.13.2.1 assertion fail elflink.h:5117
mips64el-linux-ld: BFD 2.13.2.1 assertion fail elflink.h:5117
mips64el-linux-ld: BFD 2.13.2.1 assertion fail elflink.h:5117
mips64el-linux-ld: BFD 2.13.2.1 assertion fail elflink.h:5117
mips64el-linux-ld: BFD 2.13.2.1 assertion fail elflink.h:5117
mips64el-linux-ld: BFD 2.13.2.1 assertion fail elflink.h:5117
mips64el-linux-ld: BFD 2.13.2.1 assertion fail elflink.h:5117
mips64el-linux-ld: BFD 2.13.2.1 assertion fail elflink.h:5117
mips64el-linux-ld: BFD 2.13.2.1 assertion fail elflink.h:5117
mips64el-linux-ld: BFD 2.13.2.1 assertion fail elflink.h:5117
mips64el-linux-ld: BFD 2.13.2.1 assertion fail elflink.h:5117
mips64el-linux-ld: BFD 2.13.2.1 assertion fail elflink.h:5117
mips64el-linux-ld: BFD 2.13.2.1 assertion fail elflink.h:5117
mips64el-linux-ld: BFD 2.13.2.1 assertion fail elflink.h:5117
mips64el-linux-ld: BFD 2.13.2.1 assertion fail elflink.h:5117
mips64el-linux-ld: BFD 2.13.2.1 assertion fail elflink.h:5117
mips64el-linux-ld: BFD 2.13.2.1 assertion fail elflink.h:5117
mips64el-linux-ld: BFD 2.13.2.1 assertion fail elflink.h:5117
mips64el-linux-ld: BFD 2.13.2.1 assertion fail elflink.h:5117
mips64el-linux-ld: BFD 2.13.2.1 assertion fail elflink.h:5117
mips64el-linux-ld: BFD 2.13.2.1 assertion fail elflink.h:5117
mips64el-linux-ld: BFD 2.13.2.1 assertion fail elflink.h:5117
mips64el-linux-ld: BFD 2.13.2.1 assertion fail elflink.h:5117
mips64el-linux-ld: BFD 2.13.2.1 assertion fail elflink.h:5117
mips64el-linux-ld: BFD 2.13.2.1 assertion fail elflink.h:5117
mips64el-linux-ld: BFD 2.13.2.1 assertion fail elflink.h:5117
mips64el-linux-ld: BFD 2.13.2.1 assertion fail elflink.h:5117
mips64el-linux-ld: BFD 2.13.2.1 assertion fail elflink.h:5117
mips64el-linux-ld: BFD 2.13.2.1 assertion fail elflink.h:5117
mips64el-linux-ld: BFD 2.13.2.1 assertion fail elflink.h:5117
mips64el-linux-ld: BFD 2.13.2.1 assertion fail elflink.h:5117
mips64el-linux-ld: BFD 2.13.2.1 assertion fail elflink.h:5117
mips64el-linux-ld: BFD 2.13.2.1 assertion fail elflink.h:5117
mips64el-linux-ld: BFD 2.13.2.1 assertion fail elflink.h:5117
mips64el-linux-ld: BFD 2.13.2.1 assertion fail elflink.h:5117
mips64el-linux-ld: BFD 2.13.2.1 assertion fail elflink.h:5117
mips64el-linux-ld: BFD 2.13.2.1 assertion fail elflink.h:5117
mips64el-linux-ld: BFD 2.13.2.1 assertion fail elflink.h:5117
mips64el-linux-ld: BFD 2.13.2.1 assertion fail elflink.h:5117
mips64el-linux-ld: BFD 2.13.2.1 assertion fail elflink.h:5117
mips64el-linux-ld: BFD 2.13.2.1 assertion fail elflink.h:5117
mips64el-linux-ld: BFD 2.13.2.1 assertion fail elflink.h:5117
mips64el-linux-ld: BFD 2.13.2.1 assertion fail elflink.h:5117
mips64el-linux-ld: BFD 2.13.2.1 assertion fail elflink.h:5117
mips64el-linux-ld: BFD 2.13.2.1 assertion fail elflink.h:5117
mips64el-linux-ld: BFD 2.13.2.1 assertion fail elflink.h:5117
mips64el-linux-ld: BFD 2.13.2.1 assertion fail elflink.h:5117
mips64el-linux-ld: BFD 2.13.2.1 assertion fail elflink.h:5117
mips64el-linux-ld: BFD 2.13.2.1 assertion fail elflink.h:5117
mips64el-linux-ld: BFD 2.13.2.1 assertion fail elflink.h:5117
mips64el-linux-ld: BFD 2.13.2.1 assertion fail elflink.h:5117
mips64el-linux-ld: BFD 2.13.2.1 assertion fail elflink.h:5117
mips64el-linux-ld: BFD 2.13.2.1 assertion fail elflink.h:5117
mips64el-linux-ld: BFD 2.13.2.1 assertion fail elflink.h:5117
mips64el-linux-ld: BFD 2.13.2.1 assertion fail elflink.h:5117
mips64el-linux-ld: BFD 2.13.2.1 assertion fail elflink.h:5117
mips64el-linux-ld: BFD 2.13.2.1 assertion fail elflink.h:5117
mips64el-linux-ld: BFD 2.13.2.1 assertion fail elflink.h:5117
mips64el-linux-ld: BFD 2.13.2.1 assertion fail elflink.h:5117
mips64el-linux-ld: BFD 2.13.2.1 assertion fail elflink.h:5117
mips64el-linux-ld: BFD 2.13.2.1 assertion fail elflink.h:5117
mips64el-linux-ld: BFD 2.13.2.1 assertion fail elflink.h:5117
mips64el-linux-ld: BFD 2.13.2.1 assertion fail elflink.h:5117
mips64el-linux-ld: BFD 2.13.2.1 assertion fail elflink.h:5117
mips64el-linux-ld: BFD 2.13.2.1 assertion fail elflink.h:5117
mips64el-linux-ld: BFD 2.13.2.1 assertion fail elflink.h:5117
mips64el-linux-ld: BFD 2.13.2.1 assertion fail elflink.h:5117
mips64el-linux-ld: BFD 2.13.2.1 assertion fail elflink.h:5117
mips64el-linux-ld: BFD 2.13.2.1 assertion fail elflink.h:5117
mips64el-linux-ld: BFD 2.13.2.1 assertion fail elflink.h:5117
mips64el-linux-ld: BFD 2.13.2.1 assertion fail elflink.h:5117
mips64el-linux-ld: BFD 2.13.2.1 assertion fail elflink.h:5117
mips64el-linux-ld: BFD 2.13.2.1 assertion fail elflink.h:5117
mips64el-linux-ld: BFD 2.13.2.1 assertion fail elflink.h:5117
mips64el-linux-ld: BFD 2.13.2.1 assertion fail elflink.h:5117
mips64el-linux-ld: BFD 2.13.2.1 assertion fail elflink.h:5117
mips64el-linux-ld: BFD 2.13.2.1 assertion fail elflink.h:5117
mips64el-linux-ld: BFD 2.13.2.1 assertion fail elflink.h:5117
mips64el-linux-ld: BFD 2.13.2.1 assertion fail elflink.h:5117
mips64el-linux-ld: BFD 2.13.2.1 assertion fail elflink.h:5117
mips64el-linux-ld: Attempt to do relocateable link with
elf32-tradlittlemips input and elf64-tradlittlemips output
mips64el-linux-ld: final link failed: File in wrong format
make[2]: *** [kernel.o] Error 1
make[2]: Leaving directory `/home/michael/linux-working/linux/kernel'
make[1]: *** [first_rule] Error 2
make[1]: Leaving directory `/home/michael/linux-working/linux/kernel'
make: *** [_dir_kernel] Error 2
Where should I get the right toolchain or how can I build one?
-Michael
_________________________________________________________________
与联机的朋友进行交流,请使用 MSN Messenger: http://messenger.msn.com/cn
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Which compiler should I use to make mips64 kernel
2003-05-06 6:54 Which compiler should I use to make mips64 kernel Guo Michael
@ 2003-05-06 12:40 ` Ralf Baechle
2003-05-08 19:21 ` Maciej W. Rozycki
2003-05-06 13:04 ` Maciej W. Rozycki
1 sibling, 1 reply; 4+ messages in thread
From: Ralf Baechle @ 2003-05-06 12:40 UTC (permalink / raw)
To: Guo Michael; +Cc: linux-mips
On Tue, May 06, 2003 at 02:54:52PM +0800, Guo Michael wrote:
> mips64el-linux-ld -r -o kernel.o sched.o dma.o fork.o exec_domain.o
> panic.o printk.o module.o exit.o itimer.o info.o time.o softirq.o
> resource.o sysctl.o acct.o capability.o ptrace.o timer.o user.o signal.o
> sys.o kmod.o context.o ksyms.o
> mips64el-linux-ld: BFD 2.13.2.1 assertion fail elflink.h:5117
This is a known but not yet fixed problem that only seems to hit certain
kernel configurations; I believe it somehow tied to little endianess also.
Ralf
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Which compiler should I use to make mips64 kernel
2003-05-06 6:54 Which compiler should I use to make mips64 kernel Guo Michael
2003-05-06 12:40 ` Ralf Baechle
@ 2003-05-06 13:04 ` Maciej W. Rozycki
1 sibling, 0 replies; 4+ messages in thread
From: Maciej W. Rozycki @ 2003-05-06 13:04 UTC (permalink / raw)
To: Guo Michael; +Cc: linux-mips
On Tue, 6 May 2003, Guo Michael wrote:
> Hello, I want to build mips64el kernel and downloaded the mips64el
> toolchain from ftp://ftp.ds2.pg.gda.pl/pub/macro/ (Maciej W. Rozycki's
> site) and I got following errors:
My 64-bit binutils package has `ld' that assumes output is to be 64-bit
ELF. When fed with 32-bit ELF objects such as these created by `as -32'
(as invoked when building the kernel) it should convert them to 64-bit on
the fly, but it wasn't really ever tested and doesn't work. There are two
immediate ways to deal with that:
1. Add "-m elf32ltsmip" or "-m elf32btsmip" (depending on the endianness)
to `ld' invocation (there is a commented-out example how to do this in
arch/mips64/Makefile). This is probably the simplest and safest way to
deal with the problem. It could probably be added to the CVS to avoid
confusion.
2. Build all objects as 64-bit. This will enlarge the kernel noticeably
and possibly reveal bugs. I have a patch (or maybe a hack) to enable such
a setup if you were really interested.
Maciej
--
+ Maciej W. Rozycki, Technical University of Gdansk, Poland +
+--------------------------------------------------------------+
+ e-mail: macro@ds2.pg.gda.pl, PGP key available +
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Which compiler should I use to make mips64 kernel
2003-05-06 12:40 ` Ralf Baechle
@ 2003-05-08 19:21 ` Maciej W. Rozycki
0 siblings, 0 replies; 4+ messages in thread
From: Maciej W. Rozycki @ 2003-05-08 19:21 UTC (permalink / raw)
To: Ralf Baechle; +Cc: Guo Michael, linux-mips
On Tue, 6 May 2003, Ralf Baechle wrote:
> > mips64el-linux-ld -r -o kernel.o sched.o dma.o fork.o exec_domain.o
> > panic.o printk.o module.o exit.o itimer.o info.o time.o softirq.o
> > resource.o sysctl.o acct.o capability.o ptrace.o timer.o user.o signal.o
> > sys.o kmod.o context.o ksyms.o
> > mips64el-linux-ld: BFD 2.13.2.1 assertion fail elflink.h:5117
>
> This is a known but not yet fixed problem that only seems to hit certain
> kernel configurations; I believe it somehow tied to little endianess also.
This patch makes ld work for the kernel regardless of the default
emulation (output format). What do you think?
--
+ Maciej W. Rozycki, Technical University of Gdansk, Poland +
+--------------------------------------------------------------+
+ e-mail: macro@ds2.pg.gda.pl, PGP key available +
patch-mips-2.4.21-pre4-20030505-mips64-ld-oformat-0
diff -up --recursive --new-file linux-mips-2.4.21-pre4-20030505.macro/arch/mips64/Makefile linux-mips-2.4.21-pre4-20030505/arch/mips64/Makefile
--- linux-mips-2.4.21-pre4-20030505.macro/arch/mips64/Makefile 2003-02-27 03:56:44.000000000 +0000
+++ linux-mips-2.4.21-pre4-20030505/arch/mips64/Makefile 2003-05-08 15:44:25.000000000 +0000
@@ -251,10 +251,20 @@ LINKFLAGS += -T arch/mips64/ld.script.el
#LINKFLAGS += -T arch/mips64/ld.script.elf64
endif
+ifdef CONFIG_CPU_LITTLE_ENDIAN
+32bit-bfd = elf32-tradlittlemips
+64bit-bfd = elf64-tradlittlemips
+else
+32bit-bfd = elf32-tradbigmips
+64bit-bfd = elf64-tradbigmips
+endif
+
AFLAGS += $(GCCFLAGS)
CFLAGS += $(GCCFLAGS)
+LD += --oformat $(32bit-bfd)
+
LINKFLAGS += -Ttext $(LOADADDR)
@@ -266,12 +276,6 @@ LIBS := arch/mips64/lib/lib.a $(LIBS)
MAKEBOOT = $(MAKE) -C arch/$(ARCH)/boot
-ifdef CONFIG_CPU_LITTLE_ENDIAN
-64bit-bfd = elf64-tradlittlemips
-else
-64bit-bfd = elf64-tradbigmips
-endif
-
vmlinux: arch/mips64/ld.script.elf32
arch/mips64/ld.script.elf32: arch/mips64/ld.script.elf32.S
$(CPP) -C -P -I$(HPATH) -imacros $(HPATH)/asm-mips64/sn/mapped_kernel.h -Umips arch/mips64/ld.script.elf32.S > arch/mips64/ld.script.elf32
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2003-05-08 19:22 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-05-06 6:54 Which compiler should I use to make mips64 kernel Guo Michael
2003-05-06 12:40 ` Ralf Baechle
2003-05-08 19:21 ` Maciej W. Rozycki
2003-05-06 13:04 ` Maciej W. Rozycki
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox