[ 
https://issues.apache.org/jira/browse/SERF-133?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17985272#comment-17985272
 ] 

Daniel Sahlberg commented on SERF-133:
--------------------------------------

Digging around a bit, MergeFlags doesn't detect -O2 as being a duplicate of 
-O3, so some additional code is required. Also, we add -O2 to CCFLAGS, while 
original report was about adding -O3 to CFLAGS, so even more code would be 
required to check both CFLAGS and CCFLAGS.

There are too many ways to skin this cat to make for an easy fix.

> SConstruct should not force -O2
> -------------------------------
>
>                 Key: SERF-133
>                 URL: https://issues.apache.org/jira/browse/SERF-133
>             Project: serf
>          Issue Type: Bug
>            Reporter: Serf Importer
>            Priority: Major
>              Labels: Priority-Medium, Type-Defect
>
> Handling of CFLAGS etc. is misdesigned. Environmental variables are ignored. 
> Even when I explicitly specify CFLAGS on command line, then they are not 
> fully respected:
> $ scons CFLAGS="-march=native -O3"
> scons: Reading SConscript files ...
> scons: done reading SConscript files.
> scons: Building targets ...
> gcc -o context.o -c -march=native -O3 -std=c89 -Wdeclaration-after-statement 
> -Wmissing-prototypes -Wall -O2 -pthread -DNDEBUG -DLINUX -D_REENTRANT 
> -D_GNU_SOURCE -I. -I/usr/include/apr-1 -I/usr/include/db5.2 -I/usr/include 
> context.c
> gcc -o incoming.o -c -march=native -O3 -std=c89 -Wdeclaration-after-statement 
> -Wmissing-prototypes -Wall -O2 -pthread -DNDEBUG -DLINUX -D_REENTRANT 
> -D_GNU_SOURCE -I. -I/usr/include/apr-1 -I/usr/include/db5.2 -I/usr/include 
> incoming.c
> gcc -o outgoing.o -c -march=native -O3 -std=c89 -Wdeclaration-after-statement 
> -Wmissing-prototypes -Wall -O2 -pthread -DNDEBUG -DLINUX -D_REENTRANT 
> -D_GNU_SOURCE -I. -I/usr/include/apr-1 -I/usr/include/db5.2 -I/usr/include 
> outgoing.c
> gcc -o ssltunnel.o -c -march=native -O3 -std=c89 
> -Wdeclaration-after-statement -Wmissing-prototypes -Wall -O2 -pthread 
> -DNDEBUG -DLINUX -D_REENTRANT -D_GNU_SOURCE -I. -I/usr/include/apr-1 
> -I/usr/include/db5.2 -I/usr/include ssltunnel.c
> ...
> -O2 is appended and overrides flags set by user (which include -O3 in above 
> example).
> Original issue reported by *Arfrever.FTA*



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to