linux-m68k.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Rob Landley <rob@landley.net>
To: Finn Thain <fthain@telegraphics.com.au>
Cc: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>,
	linux-m68k@vger.kernel.org, Laurent Vivier <Laurent@Vivier.EU>
Subject: Re: GCC?, was Re: Running m68k on qemu with external initramfs?
Date: Mon, 13 Apr 2020 02:07:16 -0500	[thread overview]
Message-ID: <eb942a46-515f-9e1e-eeab-22c50b56e07c@landley.net> (raw)
In-Reply-To: <alpine.LNX.2.22.394.2004131146180.15@nippy.intranet>



On 4/13/20 12:17 AM, Finn Thain wrote:
> On Sun, 12 Apr 2020, Rob Landley wrote:
> 
>> Target: m68k-linux-musl
>> Configured with: ../src_gcc/configure --enable-languages=c,c++ CFLAGS=' -g0 -Os'
> 
> Was toysh also built with -Os in CFLAGS? If so, I suggest you try -O2. The 

It was. -O2 still segfaults the same way, but -O1 runs fine.

Sigh, tracking this down,
https://gcc.gnu.org/onlinedocs/gcc/Optimize-Options.html says -O2 adds:

-falign-functions  -falign-jumps -falign-labels  -falign-loops -fcaller-saves
-fcode-hoisting -fcrossjumping -fcse-follow-jumps  -fcse-skip-blocks
-fdelete-null-pointer-checks -fdevirtualize  -fdevirtualize-speculatively
-fexpensive-optimizations -ffinite-loops -fgcse  -fgcse-lm
-fhoist-adjacent-loads -finline-functions -finline-small-functions
-findirect-inlining -fipa-bit-cp  -fipa-cp  -fipa-icf -fipa-ra  -fipa-sra
-fipa-vrp -fisolate-erroneous-paths-dereference -flra-remat
-foptimize-sibling-calls -foptimize-strlen -fpartial-inlining -fpeephole2
-freorder-blocks-algorithm=stc -freorder-blocks-and-partition
-freorder-functions -frerun-cse-after-loop  -fschedule-insns  -fschedule-insns2
-fsched-interblock  -fsched-spec -fstore-merging -fstrict-aliasing
-fthread-jumps -ftree-builtin-call-dce -ftree-pre -ftree-switch-conversion
-ftree-tail-merge -ftree-vrp

So let's try...

unrecognized command line option '-ffinite-loops'; did you mean '-fsplit-loops'?

Did I mention I'm really done with gcc development ever since they decided to
rewrite everything in C++? Sigh. [grind grind grind...]

CFLAGS='-fgcse'

That's the one.

>> I have a todo item to pare my 2700 line toysh source file (plus however 
>> muchof main.c and lib/*.c it's pulling in, "LDFLAGS=--static 
>> CROSS_COMPILE=ccc/m68k-linux-musl-cross/bin/m68k-linux-musl- make sh" 
>> makes a 99k m68k binary) down into a minimal reproduction thingy, but 
>> I'm trying to get the other targets to finish parsing the init script so 
>> I can cut a toybox release.
> 
> It would be great to have a minimal reproducer from toysh. Getting that 
> from the python build looks hard, even with creduce.
> https://embed.cs.utah.edu/creduce/

Oh it's not hard, it's just tedious.

Rob

  reply	other threads:[~2020-04-13  7:01 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-11  0:50 Running m68k on qemu with external initramfs? Rob Landley
2020-04-11  6:12 ` Finn Thain
2020-04-12  3:36   ` Rob Landley
2020-04-12  5:29     ` Finn Thain
2020-04-12 12:34       ` Rob Landley
2020-04-12  8:27     ` John Paul Adrian Glaubitz
2020-04-12  8:31       ` Laurent Vivier
2020-04-12 21:48         ` Rob Landley
2020-04-12 23:17           ` Finn Thain
2020-04-11 12:12 ` John Paul Adrian Glaubitz
2020-04-12 12:48   ` Rob Landley
2020-04-12 13:02     ` John Paul Adrian Glaubitz
2020-04-12 21:56       ` Rob Landley
2020-04-12 23:30     ` GCC?, was " Finn Thain
2020-04-13  0:28       ` Rob Landley
2020-04-13  5:17         ` Finn Thain
2020-04-13  7:07           ` Rob Landley [this message]
2020-04-13  7:41             ` John Paul Adrian Glaubitz
2020-04-13  8:27             ` Rob Landley
2020-04-13  9:42               ` Geert Uytterhoeven
2020-04-13 23:02                 ` Finn Thain

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=eb942a46-515f-9e1e-eeab-22c50b56e07c@landley.net \
    --to=rob@landley.net \
    --cc=Laurent@Vivier.EU \
    --cc=fthain@telegraphics.com.au \
    --cc=glaubitz@physik.fu-berlin.de \
    --cc=linux-m68k@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).