Re: Has anyone successfully bootstrapped gcc-4.6.3 on m68k?
On 2012-05-18, at 2:00 PM, Thorsten Glaser wrote:
> Vaugha Brewchuk dixit:
>
>>> Building mksh and running its testsuite _is_ a good compiler and
>>> libc test anyway. I’ve suggested the GCC people do that several
>>> times already… (when you do, make sure to try CVS HEAD)
>>
>> Interesting, I will definitely look into this. I have been using
>> bash
>
> Maybe you didn’t know something else? ;-)
>
> mksh (other than crippled shells such as ash) is, for example, the
> only one with system dependencies low enough to run unmodified on
> Android bionic (even going as far back as Android 1.5, which was
> the first one I had contact with). It is also much faster than GNU
> bash and (obviously) more free ☺
>
> But the thing is, building mksh and running its testsuite has a
> history of exposing compiler, toolchain or OS bugs. So you get
> double benefit.
I will definitely have a look at mksh. In the past I primarily used zsh and only switched to bash in hopes of better compatibility with all the gnu scripts. I wonder if there would be a benefit to compiling it without -posix on NEXTSTEP in order to avoid the bugs and allow it to be ported to OPENSTEP?
>> but I have also been experiencing really bizarre issues with
>> configure scripts that I cannot trace to the root cause - some of the
>> files generated by config.status randomly get null characters inserted
>> into them which then breaks the tools that process them, such as gawk
>> or gcc.
>
> That may be a bug in the operating system. I’ve read about it,
> thanks to RT who ported mksh to NeXTstep, and the thing is, if
> you use a sequence like this:
>
> echo foo >file
> echo bar >>file
>
> … to create a file, and the *first* echo is less than 14 bytes,
> the file gets corrupted. (Look in mksh/Build.sh for “workaround”.)
This is incredible - a huge THANK YOU! I was aware of the famous POSIX append bug, but had no idea that a similar condition existed outside of the POSIX environment. The confusing thing is that it does not seem to be as simple as the above example - I created a shell script that tries to recreate the area of configure script that causes the problem, but I cannot trigger the issue.
while :; do
echo "BEGIN {" >$test_file
for line_no in 01 02 03 04 05 06 07 08 09; do
cat >>$test_file <<_ACEOF
#define THIS_IS_TEST_LINE_NO_$line_no "$line_no"
_ACEOF
However, changing the gcc configure scripts as follows makes the config.status run correctly!
- echo 'BEGIN {' >"$tmp/subs1.awk" &&
+ echo 'BEGIN {' >"$tmp/subs1.awk" &&
But to make things more intriguing, the following makes config.status run correctly as well:
- echo 'BEGIN {' >"$tmp/subs1.awk" &&
+ echo 'BEGIN {' >"/tmp/subs1.awk" &&
And to add insult to injury, if I reboot my NeXT and try to run the unmodified configure, it sometimes works, but not always. Anyhow, my apologies as this is grossly off-topic.
>> I have been working on reintegrating revised nextstep configuration
>> files back into the gcc source and was able to build gcc-3.4.6 and now
>> am trying gcc-4.6.3. I am hoping that a modern compiler will somewhat
>> reinvigorate the interest in the platform...
>
> ;-) I can confirm that it’s possible to build at least gcc-4.4 straight
> from gcc-3.4.6 since the latter is the system compiler on MirBSD (will
> be replaced with pcc eventually though) and the former is in MirPorts.
> Although I did collect a number of patches against 3.4… (but that’s on
> i386 and sparc, which are MirBSD’s currently supported platforms).
If my current attempt at 4.6 fails I will move my configuration back to 4.4 and try that instead.
>> My other desire is to refresh the NeXT c library to a somewhat more
>> modern configuration. For anyone interested, here is a good summary of
>> my struggles: http://www.nextcomputers.org/forums/viewtopic.php?t=2980
>
> Thanks, will peek at it.
Just please be gentle with me :-) That thread exposes how ignorant I am on the subject of programming. I have learned a whole lot since then, but I am just skimming the surface. I still do not know anything about C++...
>> This is really just a learning experience for me and I am very humbled
>> by help from real software developers.
>
> Isn’t it for all of us? I learned to know Debian by reviving m68k…
> even though I’ve been a programmer since approximately when I was
> six years old. (Games were few and held few interest for me when
> I had GWBASIC to toy with the computer with.) You never stop learning.
Amen to never stop learning! I first got exposed to programming (as a hobby) using ATARI 130XE basic. While at school for my mechanical (aerospace actually) engineering degree I did a bit of assembly for 8086 (scary stuff), assembly for 68000 (wonderful stuff) and lots of C. I refused to touch Fortran, despite Fortran being "the" language for engineers. I did a whole lot of hacking on my Atari MEGA 2 ST and eventually moved over to the NeXT Cube when I could afford one second hand. But even back then I did not dive into any UNIX specific programming or porting. All I did was engineering code.
> bye,
> //mirabilos
> --
> FWIW, I'm quite impressed with mksh interactively. I thought it was much
> *much* more bare bones. But it turns out it beats the living hell out of
> ksh93 in that respect. I'd even consider it for my daily use if I hadn't
> wasted half my life on my zsh setup. :-) -- Frank Terbeck in #!/bin/mksh
Reply to: