bugmake - Bugs: bug #50300, Set CFLAGS to “-O 1” with...

 
 

bug #50300: Set CFLAGS to “-O 1” with .POSIX target

Submitted by:  Quentin Rameau <quinq>
Submitted on:  Tue 14 Feb 2017 12:18:04 PM UTC  
 
Severity:  3 - Normal Item Group:  Bug
Status:  Fixed Privacy:  Public
Assigned to:  Paul D. Smith <psmith> Open/Closed:  Closed
Component Version:  None Operating System:  POSIX-Based
Fixed Release:  4.3 Triage Status:  None

Add a New Comment (Rich Markup)
   

You are not logged in

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

 

( Jump to the original submission)

Sun 04 Jun 2017 10:53:06 PM UTC, comment #8: 

A fix has been pushed and will be in the next release.  Thank you for filing a report!

Paul D. Smith <psmith>
Project AdministratorIn charge of this item.
Fri 26 May 2017 08:06:47 AM UTC, comment #7: 

Great, thank you!
No hurry though, thanks for the update on your decision.

Quentin Rameau <quinq>
Mon 22 May 2017 01:33:07 PM UTC, comment #6: 

I have this change already queued locally along with a bunch of others.  I've been away for a while on vacation but I'll try to push those to Savannah this week/weekend.

Paul D. Smith <psmith>
Project AdministratorIn charge of this item.
Mon 22 May 2017 08:29:38 AM UTC, comment #5: 

So...

What do you think, Paul ?

Quentin Rameau <quinq>
Mon 17 Apr 2017 08:46:11 AM UTC, comment #4: 

Hello Paul,

Thank you for taking the time to answer to this bug report.

But, as commented by the previous user, the report is about .POSIX target, as specified in my report.

One issue here though, is that gcc doesn't support POSIX standard utility syntax, so to mitigate this it may be better to set it to “-O1” instead of the expected “-O 1”.

Thanks!

Quentin Rameau <quinq>
Sun 16 Apr 2017 06:43:03 PM UTC, comment #3: 

I think you overlooked the reference to ".POSIX target":

$ cat Makefile                                                        
.POSIX:
$ gmake -pq | grep ^CFLAGS
gmake: *** No targets.  Stop.
CFLAGS := -O
$ gmake --version
GNU Make 4.2.1
...

Philip Guenther

Anonymous
Sun 16 Apr 2017 06:20:01 PM UTC, comment #2: 

I'm not sure I understand this bug report.  The default behavior of GNU make contains no settings for CFLAGS at all:

$ make -p -f /dev/null | grep CFLAGS
make: *** No targets.  Stop.
LINK.m = $(OBJC) $(OBJCFLAGS) $(CPPFLAGS) $(LDFLAGS) $(TARGET_ARCH)
LINK.c = $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) $(TARGET_ARCH)
COMPILE.m = $(OBJC) $(OBJCFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c
COMPILE.c = $(CC) $(CFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c

$ make -pf/dev/null | grep .-O
make: *** No targets.  Stop.

If "-O" is appearing in your CFLAGS, it's not make that's adding it.

If you can provide further details about what make is doing wrong I'm happy to reopen this issue.

Paul D. Smith <psmith>
Project AdministratorIn charge of this item.
Fri 03 Mar 2017 06:24:52 PM UTC, comment #1: 

I am having this same problem. I am developing a POSIX compliant compiler which accepts the options requested by POSIX and this behaviour is broken my makefiles since the compiler follows the utility conventions syntax -O n.

[1] http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap12.html

Roberto E. Vargas Caballero <k0ga>
Tue 14 Feb 2017 12:18:04 PM UTC, original submission:  

The POSIX standard for make[1] specifies that the default CFLAGS should be “-O 1” but GNU make currently defines “-O” (which is not portable and can break c99).

[1] http://pubs.opengroup.org/onlinepubs/9699919799/utilities/make.html

Quentin Rameau <quinq>

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #39751:  0001-read.c-record_files-set-CFLAGS-to-O-1-for-.POSIX-tar.patch added by quinq (2KiB - application/octet-stream - Fix patch for executable and tests)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by psmith (Posted a comment)
  • -email is unavailable- added by k0ga (Posted a comment)
  • -email is unavailable- added by quinq (Submitted the item)
  •  

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

    Only logged-in users can vote.

     

     

     

    Follow 9 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2017-06-04 psmith StatusNone => Fixed
        Assigned toNone => psmith
        Open/ClosedOpen => Closed
        Fixed ReleaseNone => 4.3
    2017-05-22 psmith StatusNot A Bug => None
        Open/ClosedClosed => Open
    2017-04-16 psmith StatusNone => Not A Bug
        Open/ClosedOpen => Closed
    2017-02-14 quinq Attached File- => Added 0001-read.c-record_files-set-CFLAGS-to-O-1-for-.POSIX-tar.patch, #39751

    Back to the top


    Powered by Savane 3.7