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]

details of error on building SH3 big-endian toolchain


  just before i head off for coffee, might as well dump this to the
list and see what someone has to say.

  i successfully built a small-endian SH3 toolchain and, as part of
the build, here's the contents of the build-glibc/csu directory
(you'll see shortly why i'm listing that particular directory):

[csu]$ file *.o			# what are file types?  note "LSB"

abi-note.o:   ELF 32-bit LSB relocatable, Hitachi SH, version 1
MathCoPro/FPU/MAU Required (SYSV), not stripped
check_fds.o:  ELF 32-bit LSB relocatable, Hitachi SH, version 1
(SYSV), not stripped
crt1.o:       ELF 32-bit LSB relocatable, Hitachi SH, version 1
MathCoPro/FPU/MAU Required (SYSV), not stripped
crti.o:       ELF 32-bit LSB relocatable, Hitachi SH, version 1
MathCoPro/FPU/MAU Required (SYSV), not stripped
crtn.o:       ELF 32-bit LSB relocatable, Hitachi SH, version 1
MathCoPro/FPU/MAU Required (SYSV), not stripped
dso_handle.o: ELF 32-bit LSB relocatable, Hitachi SH, version 1
MathCoPro/FPU/MAU Required (SYSV), not stripped
elf-init.o:   ELF 32-bit LSB relocatable, Hitachi SH, version 1
(SYSV), not stripped
errno-loc.o:  ELF 32-bit LSB relocatable, Hitachi SH, version 1
(SYSV), not stripped
errno.o:      ELF 32-bit LSB relocatable, Hitachi SH, version 1
MathCoPro/FPU/MAU Required (SYSV), not stripped
gcrt1.o:      ELF 32-bit LSB relocatable, Hitachi SH, version 1
(SYSV), not stripped
gmon-start.o: ELF 32-bit LSB relocatable, Hitachi SH, version 1
(SYSV), not stripped
init-first.o: ELF 32-bit LSB relocatable, Hitachi SH, version 1
(SYSV), not stripped
init.o:       ELF 32-bit LSB relocatable, Hitachi SH, version 1
MathCoPro/FPU/MAU Required (SYSV), not stripped
libc-start.o: ELF 32-bit LSB relocatable, Hitachi SH, version 1
(SYSV), not stripped
libc-tls.o:   ELF 32-bit LSB relocatable, Hitachi SH, version 1
MathCoPro/FPU/MAU Required (SYSV), not stripped
Mcrt1.o:      ELF 32-bit LSB relocatable, Hitachi SH, version 1
MathCoPro/FPU/MAU Required (SYSV), not stripped
Scrt1.o:      ELF 32-bit LSB relocatable, Hitachi SH, version 1
MathCoPro/FPU/MAU Required (SYSV), not stripped
stamp.o:      ASCII text
start.o:      ELF 32-bit LSB relocatable, Hitachi SH, version 1
MathCoPro/FPU/MAU Required (SYSV), not stripped
sysdep.o:     ELF 32-bit LSB relocatable, Hitachi SH, version 1
MathCoPro/FPU/MAU Required (SYSV), not stripped
version.o:    ELF 32-bit LSB relocatable, Hitachi SH, version 1
MathCoPro/FPU/MAU Required (SYSV), not stripped

  so, not surprisingly, since this was a small-endian build,
everything is LSB.

  start over, change sh3.dat to reflect big-endian ("-ml" -> "-mb"),
start the build and eventually:

... big snip here ...
sh3-unknown-linux-gnu-gcc  -nostdlib -nostartfiles -r -o
/home/rob/ct/crosstool-0.28-rc37/build/sh3-unknown-linux-gnu/gcc-3.4.1-glibc-2.3.3/build-glibc/csu/crt1.o
/home/rob/ct/crosstool-0.28-rc37/build/sh3-unknown-linux-gnu/gcc-3.4.1-glibc-2.3.3/build-glibc/csu/start.o
/home/rob/ct/crosstool-0.28-rc37/build/sh3-unknown-linux-gnu/gcc-3.4.1-glibc-2.3.3/build-glibc/csu/abi-note.o
/home/rob/ct/crosstool-0.28-rc37/build/sh3-unknown-linux-gnu/gcc-3.4.1-glibc-2.3.3/build-glibc/csu/init.o
/home/rob/ct/results/sh3-unknown-linux-gnu/gcc-3.4.1-glibc-2.3.3/lib/gcc/sh3-unknown-linux-gnu/3.4.1/../../../../sh3-unknown-linux-gnu/bin/ld:
/home/rob/ct/crosstool-0.28-rc37/build/sh3-unknown-linux-gnu/gcc-3.4.1-glibc-2.3.3/build-glibc/csu/init.o:
compiled for a big endian system and target is little endian
/home/rob/ct/results/sh3-unknown-linux-gnu/gcc-3.4.1-glibc-2.3.3/lib/gcc/sh3-unknown-linux-gnu/3.4.1/../../../../sh3-unknown-linux-gnu/bin/ld:
failed to merge target specific data of file
/home/rob/ct/crosstool-0.28-rc37/build/sh3-unknown-linux-gnu/gcc-3.4.1-glibc-2.3.3/build-glibc/csu/init.o
collect2: ld returned 1 exit status
make[2]: ***
[/home/rob/ct/crosstool-0.28-rc37/build/sh3-unknown-linux-gnu/gcc-3.4.1-glibc-2.3.3/build-glibc/csu/crt1.o]
Error 1
make[2]: Leaving directory
`/home/rob/ct/crosstool-0.28-rc37/build/sh3-unknown-linux-gnu/gcc-3.4.1-glibc-2.3.3/glibc-2.3.3/csu'
make[1]: *** [csu/subdir_lib] Error 2
make[1]: Leaving directory
`/home/rob/ct/crosstool-0.28-rc37/build/sh3-unknown-linux-gnu/gcc-3.4.1-glibc-2.3.3/glibc-2.3.3'
make: *** [all] Error 2

  hmmm ... note error "compiled for a big endian system and target is
little endian".  check that directory contents again to find:

[csu]$ file *.o
abi-note.o:   ELF 32-bit LSB relocatable, Hitachi SH, version 1
MathCoPro/FPU/MAU Required (SYSV), not stripped
check_fds.o:  ELF 32-bit MSB relocatable, Hitachi SH, version 1
(SYSV), not stripped
dso_handle.o: ELF 32-bit MSB relocatable, Hitachi SH, version 1
MathCoPro/FPU/MAU Required (SYSV), not stripped
elf-init.o:   ELF 32-bit MSB relocatable, Hitachi SH, version 1
MathCoPro/FPU/MAU Required (SYSV), not stripped
errno-loc.o:  ELF 32-bit MSB relocatable, Hitachi SH, version 1
(SYSV), not stripped
errno.o:      ELF 32-bit MSB relocatable, Hitachi SH, version 1
MathCoPro/FPU/MAU Required (SYSV), not stripped
gmon-start.o: ELF 32-bit MSB relocatable, Hitachi SH, version 1
(SYSV), not stripped
init-first.o: ELF 32-bit MSB relocatable, Hitachi SH, version 1
(SYSV), not stripped
init.o:       ELF 32-bit MSB relocatable, Hitachi SH, version 1
MathCoPro/FPU/MAU Required (SYSV), not stripped
libc-start.o: ELF 32-bit MSB relocatable, Hitachi SH, version 1
(SYSV), not stripped
libc-tls.o:   ELF 32-bit MSB relocatable, Hitachi SH, version 1
MathCoPro/FPU/MAU Required (SYSV), not stripped
stamp.o:      ASCII text
start.o:      ELF 32-bit LSB relocatable, Hitachi SH, version 1
MathCoPro/FPU/MAU Required (SYSV), not stripped
sysdep.o:     ELF 32-bit LSB relocatable, Hitachi SH, version 1
MathCoPro/FPU/MAU Required (SYSV), not stripped
version.o:    ELF 32-bit MSB relocatable, Hitachi SH, version 1
MathCoPro/FPU/MAU Required (SYSV), not stripped


  hmmm ... note the sprinkled "LSB" object files.  shouldn't
*all* object files in this build be MSB?  sure looks like this is the
problem -- that some compiles are still being done as little-endian.

  so ... what mind-numbingly obvious flag or option have i overlooked?
or is this not the problem?

rday

------
Want more information?  See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
Want to unsubscribe? Send a note to crossgcc-unsubscribe@sources.redhat.com


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