bugMIT/GNU Scheme - Bugs: bug #40150, mit-scheme-c-9.1.1 overrides user...

 
 

bug #40150: mit-scheme-c-9.1.1 overrides user supplied optimization CFLAGS

Submitted by:  George Skabinsky <gska>
Submitted on:  Mon 30 Sep 2013 09:35:12 PM UTC  
 
Category: NoneSeverity: 3 - Normal
Priority: 5 - NormalItem Group: None
Status: NonePrivacy: Public
Assigned to: NoneOriginator Name: 
Open/Closed: Open
Keywords: 

Add a New Comment (Rich MarkupRich Markup):
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Mon 14 Oct 2013 01:47:01 AM UTC, comment #2:

yes, that will suffice. thanks.

George Skabinsky <gska>
Thu 03 Oct 2013 06:12:17 PM UTC, comment #1:

I can find only a handful of lines where CFLAGS is touched at all, mostly to add some -Wnitpick options (admittedly after CFLAGS, but so what?), or override standard optimization options when configured with --enable-debugging (the intention?). Perhaps line 62 is all you meant; you were so... unspecific. Line 62 is only executed when ${GCC} is yes, but... maybe this patch is all you need?

diff --git a/src/microcode/achost.ac b/src/microcode/achost.ac
index 35408bb..63e45f1 100644
--- a/src/microcode/achost.ac
+++ b/src/microcode/achost.ac
@@ -59,7 +59,7 @@ if test ${GCC} = yes; then
LDFLAGS=${SAVED_LDFLAGS}

if test ${enable_debugging} = no; then
- CFLAGS="${CFLAGS} -O3"
+ CFLAGS="-O3 ${CFLAGS}"
else
CFLAGS="${CFLAGS} -O0 -g -DENABLE_DEBUGGING_TOOLS"
LDFLAGS="${LDFLAGS} -g"

Matt Birkholz <mhb>
Project Member
Mon 30 Sep 2013 09:35:12 PM UTC, original submission:

by default, autoconf'd programs set "-O2 -g" as default CFLAGS.
however they're only used when the user does not pass custom CFLAGS.

so the code there is equivalent to
[ -z $CFLAGS ] && CFLAGS="-O2 -g"

mit scheme otoh has the following:
CFLAGS="$CFLAGS -O3"

thus, -O3 is always added to the end of the CFLAGS, which takes precedence. so the user has no way to override the hardcore -O3 optimization, which takes 5-10 times as long (and much more RAM) to build than -O0.

if otoh the statement would look like this:
CFLAGS="-O3 $CFLAGS"
the user could still override the optimization level since his own CFLAGS come last.

however the best approach is the one taken by vanilla autoconf (first code example).

George Skabinsky <gska>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by mhb (Posted a comment)
  • -unavailable- added by mhb
  • -unavailable- added by gska (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follows 1 latest change.

    Date Changed By Updated Field Previous Value => Replaced By
    Thu 03 Oct 2013 06:12:17 PM UTCmhbCarbon-Copy-=>Added -unavailable-

    Back to the top


    Powered by Savane 3.1-cleanup