[Freemint-list] Clean gcc buid for m68k-atari-mint
Miro Kropáček
miro.kropacek at gmail.com
Thu Jan 5 14:31:23 MSK 2017
Hi there,
I've been studying cross compilers for ARM for some time so as a side
effect I've learned quite a deal about cross compiling in general.
I was always wondering why our poor gcc must be built so differently from
the standard ones like ARM or even m68k-elf. I thought it's because of the
nature of Vincent's patches but as it turns out... it is not!
So I'm happy to present you my much cleaner Makefile for the gcc toolchain:
https://github.com/mikrosk/m68k-atari-mint-build. The key difference is
that it doesn't use any hacks, it's built as it was meant to be. :) So
instead of building a semi-working gcc, joggling with include headers and
whatnot we *explicitly* configure gcc as "libc-less" (using
*--without-headers*, *--with-newlib *and *--with-sysroot*), install it and
use *that* to build mintlib and pml (libc in general).
Then we restart the process, now without *--without-headers *(still with
*--with-sysroot*, now pointing to our mintlib/pml) and voila! We have a
full featured gcc with correct PATH_MAX and most importantly, without any
hacks at all. You can replace mintlib for anything else, in fact, you can
even replace *m68k-atari-mint-* for any other target with a few changes to
the Makefile.
With all that cleanness I've realised how pitiful the state of public
headers in FreeMiNT/mintlib is. So in case there's somebody wondering what
would be a nice and not so complex task to improve FreeMiNT/mintlib
relationship to Linux/Unix worlds, here's couple of hints:
- package called *freemint-libc-dev* (created by *make [arch] [desdir]
install_headers* from FreeMiNT source tree) -- this would be the merge
result of mintlib's include/mint and FreeMiNT's sys/include/mint headers,
cleaned up from private FreeMiNT structures (this would allow to call
FreeMiNT functions without installing mintlib; ideal for targets which
don't want full unix environment, ideally the headers would be in
PureC-compatible format as well)
- package called *freemint-headers* (created from full FreeMiNT build),
usable for compiling XDD/XFS/XIF modules (right now you have to cvs
checkout whole FreeMiNT tree and hope for the best)
- merging pml or fdlibm (or something else) with mintlib, every libc I
know of had done that in the past, much easier maintanance
- merging mintbin's strip and stack utilities into *mintlib-bin* package
(and to mintlib in general, of course) and get rid of this ancient package
for good
- implement m68k-atari-mint support, now we have a clean build process,
into tools like *crosstool-ng* so we're treated as first class citizens
and any novice programmers would need only knowledge from other platforms
to start immediately
TL; DR version: no real news, just a handful of wishes. ;)
--
MiKRO / Mystic Bytes
http://mikro.atari.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.atariforge.org/pipermail/freemint-list/attachments/20170105/e66819a3/attachment.html
More information about the Freemint-list
mailing list