Re: building cross-compiler for m68hc11/m68hc12

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



29.2.2012 11:05, Mihai Daniel OPREA kirjoitti:

I am already aware of the FAQ section dedicated to this issue,
> that is why I tried to minimise problems with GMP / MPFR / MPC
> by letting GCC build them.

Just remember that older GCC versions maybe don't need these...

I also looked inside gcc/as and indeed there is no
> "ORIGINAL_AS_FOR_TARGET" (empty string). Do I have
> to build binutils beforehand

Yes, that is the normal method.

and configure --with-as and --with-ld (or with --build-time-tools)?

These aren't needed in normal case. Using just the same :

  --prefix=$prefix --target=$target

in both configures, binutils and GCC, lets the new GCC to
find the right 'as', 'ld', 'nm' etc from '$prefix/$target/bin'.

What one must remember before the GCC build is to put the new
'$prefix/bin' into PATH !  If not already there... The installed
'$target-as', '$target-ld' etc. executables for human users (and
scripts) will be searched via PATH.

The "Building GCC guide" states that one of the steps the make
> command performs is: "Build target tools for use by the
> compiler such as binutils (bfd, binutils, gas, gprof, ld,
> and opcodes) if they have been individually linked or
> moved into the top level GCC source tree before configuring."

What on earth is this "guide"?  I could guess some old Cygnus
or Red Hat guide for GNU Pro etc. telling this way, companies
selling prebuilt GNU tools with sources usually maintained
their own "source tree". But the FSF projects have been separate,
"build them one at a time" sources...

Ok, I tried your task... First with gcc-4.3.6 (the latest gcc-4.3),
it crashed in libgcc build. The earlier gcc-4.2.4 crashed with the
following :

/home/src/gcc-4.2.4/build/./gcc/xgcc -B/home/src/gcc-4.2.4/build/./gcc/ -nostdinc -B/home/src/gcc-4.2.4/build/m68hc11-elf/m68hc11/newlib/ -isystem /home/src/gcc-4.2.4/build/m68hc11-elf/m68hc11/newlib/targ-include -isystem /home/src/gcc-4.2.4/newlib/libc/include -B/usr/local/m68hc11-elf/bin/ -B/usr/local/m68hc11-elf/lib/ -isystem /usr/local/m68hc11-elf/include -isystem /usr/local/m68hc11-elf/sys-include -m68hc11 -DPACKAGE_NAME=\"newlib\" -DPACKAGE_TARNAME=\"newlib\" -DPACKAGE_VERSION=\"1.18.0\" -DPACKAGE_STRING=\"newlib\ 1.18.0\" -DPACKAGE_BUGREPORT=\"\" -I. -I../../../../../../newlib/libc/stdio -DPREFER_SIZE_OVER_SPEED -Os -mrelax -DNO_EXEC -DABORT_PROVIDED -DSMALL_MEMORY -DMISSING_SYSCALL_NAMES -fno-builtin -O2 -Os -m68hc11 -c ../../../../../../newlib/libc/stdio/vfwscanf.c -o lib_a-vfwscanf.o
../../../../../../newlib/libc/stdio/vfwscanf.c: In function '__svfwscanf_r':
../../../../../../newlib/libc/stdio/vfwscanf.c:1454: error: insn does not satisfy its constraints:
(insn 5773 5771 5774 507 (set (reg:HI 2 y)
        (plus:HI (reg:HI 0 x)
            (const_int 21 [0x15]))) 52 {*addhi3} (nil)
    (nil))
../../../../../../newlib/libc/stdio/vfwscanf.c:1454: internal compiler error: in reload_cse_simplify_operands, at postreload.c:392
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.
make[8]: *** [lib_a-vfwscanf.o] Virhe 1
make[8]: Poistutaan hakemistosta "/home/src/gcc-4.2.4/build/m68hc11-elf/m68hc11/newlib/libc/stdio"

I had put the 'newlib' and 'libgloss' subdirs from 'newlib-1.18.0'
into the main gcc-4.2.4 source directory so these were tried to be
built after 'gcc' and 'libgcc' were ready...

[root@localhost build]# gcc/xgcc -v
Using built-in specs.
Target: m68hc11-elf
Configured with: ../configure --build=i686-linux-gnu --host=i686-linux-gnu --target=m68hc11-elf --enable-languages=c,c++ --with-newlib --disable-shared --disable-threads --disable-nls --with-gxx-include-dir=/usr/local/include/c++/4.2.4 --enable-version-specific-runtime-libs --with-pkgversion=by Kai Ruottu 2012q1
Thread model: single
gcc version 4.2.4
[root@localhost build]# find . -name libgcc.a
./gcc/libgcc.a
./gcc/mshort/libgcc.a
./gcc/mshort/fshort-double/libgcc.a
./gcc/fshort-double/libgcc.a
./gcc/m68hc11/libgcc.a
./gcc/m68hc11/mshort/libgcc.a
./gcc/m68hc11/mshort/fshort-double/libgcc.a
./gcc/m68hc11/fshort-double/libgcc.a

The '--with-pkgversion=' had no influence in gcc-4.2.4 but nice try :-)

My binutils for 'm68hc11-elf' were quite old :

[root@localhost build]# /usr/local/m68hc11-elf/bin/ld -V
GNU ld version 030318 20030318
  Tuetut emuloinnit:
   m68hc11elf
   m68hc11elfb
   m68hc12elf
   m68hc12elfb

I maybe will still try gcc-4.1.2 and newlib-1.18.0 (or some much older)
after updating those in 2003 installed binutils... My thought is that
since Stephane worked with m68hc11/12, there has been no progress in
the tools. But the site :

http://www.gnu-m68hc11.org/blog/

will tell better...


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux