This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: building cross-compiler for m68hc11/m68hc12


29.2.2012 16:29, Mihai Daniel OPREA kirjoitti:
Thank you Kai Ruottu for all your help.

I managed to build binutils-2.19. After that I tried building gcc-4.3.2, which failed due to "compiler internal
error: segmentation fault". I then tried building gcc-3.3.6 (the version which was used to compile the successful
m68hc11 build), which failed as well because of "open with O_CREAT in second argument needs 3 arguments".

Building old FSF sources with very new tools may be a problem :-( They were written to be compiled with the tools available at that time so if any standard has changed that has influence. I don't know how 'open()' has changed in Linux/glibc since the gcc-3.3.6 time... In any case your Ubuntu 11.10 32-bit system, told in your 1st msg, is very "uptodate" as a development platform for old sources. My development/build platform is CentOS 5.7 with glibc-2.5 and gcc-4.1.2 as the native C library and GCC. Furthermore I didn't even use the native GCC and glibc when building but a cross GCC for the early 2000's Red Hat 7.3 distro, a gcc-4.1.2 for 'i386-redhat-linux7.3' and RHL 7.3's glibc-2.2.5 as the target C library. So it wasn't any surprise that there were no problems. Before starting to write this, I restarted the gcc-4.2.4 build with the native gcc-4.1.2 (and glibc-2.5). This far no problems, 'libssp' for the 'm68hc11-elf' target being just built...

Fortunately however, the link you indicated contains a guide for installing the m68hc11 port from sources:
http://www.gnu-m68hc11.org/m68hc11_inst_ptc.php
The first step is building binutils-2.15. I tried it both with applying the supplied patch (binutils-2.15-
m68hc1x-20040801.diffs.gz) and without applying it, but it failed both times with the message:
"array type has incomplete element type" in tc-m68hc11.h.

I can try newer (Linux) binutils sources than 2.14.90 and see how long they will succeed for 'm68hc11-elf' target...

The prerequisites state that a gcc-3.2 or gcc-3.3 host compiler and binutils-2.14 or binutils-2.15 are required.

Talking only about the GCC version and binutils version as if only they could have some influence is misleading. Also the C headers used during compile may have influence, for instance the problem with 'open()'. And if we are talking about copying linked executables made for an very uptodate system, running them on much older systems is always impossible. Your "for-Ubuntu 11.10-made" executables wouldn't work on any older systems meanwhile those "for RHL7.3" or even the native "for CentOS 5.7" would work on many systems, including Ubuntu 11.10. Currently I have Ubuntu 11.04 (x86_64) on my laptop and 10.04 in one older desktop so I could check the toolchain workings in them easily.

Do I actually need gcc-3.3 and binutils-2.15 in order to build gcc-3.3
> and binutils-2.15? If so, how do I go about it?

The obvious answer would be: "Get a binutils, GCC and glibc toolchain
for some old generic Linux/ia32 target and build things with it". But
this advice isn't so simple to apply, where one gets these?  One choice
could be :

https://sourcery.mentor.com/sgpp/lite/ia32/portal/release1026

The toolchain is from 2009, so 3 years old and for 3 years old things...

Making crosstoolchains for old systems of course requires an access to
the install stuff of them. Anyone who started with Linux in early 1990's
of course have many install CDs in one's shelf or closet, finding them
on net may though be very hard...

BTW, the gcc-4.2.4 build for m68hc11-elf had succeeded nicely, no
problems. The binutils-2.14.9.0.8 from:

ftp.kernel.org/pub/linux/devel/binutils

were still used, must check how they could be built with the native
CentOS 5.7 tools, I compiled them with gcc-3.2.3 for RHL 7.3, when
expecting problems with a newer GCC...


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