Bug in nginx 0.7.xx ./configure procedure

Michael Shadle mike503 at gmail.com
Tue Mar 24 09:03:29 MSK 2009

when my "make" runs this is what i see:

gcc -c -O -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter
-Wno-unused-function -Wunused-variable -Wunused-value -Werror -g  -I
src/core -I src/event -I src/event/modules -I src/os/unix -I
/usr/lib/include -I /usr/include/libxml2 -I objs \
                -o objs/src/core/ngx_array.o \

that is as optimal as it should be for an x86_64 ubuntu linux box,
basically, right?

2009/3/23 Igor Sysoev <is at rambler-co.ru>:
> On Mon, Mar 23, 2009 at 09:56:45PM +0000, Mark Alan wrote:
>> mike wrote:
>> >What does this do?
>> >
>> ># ensure that there is only one -O in CFLAGS and that it is -O2
>> When we use --with-cc-opt= to specify any alternative -On C compiler
>> optimization, there seems to be a bug (or is it a designed feature?) in
>> nginx's ./configure that leads to the following line in the created
>> objs/Makefile file:
>> CFLAGS =  -O -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter
>> -Wno-unused-function -Wunused-variable -Wunused-value -Werror -g -O2
>> If I am not wrong, that line should only have one instance of -O:
>> CFLAGS = -pipe -W -Wall -Wpointer-arith -Wno-unused-parameter
>> -Wno-unused-function -Wunused-variable -Wunused-value -Werror -g -O2
>> Hence the usage of the command sed -i '/CFLAGS/s/ \-O //g' objs/Makefile
>> to clean the other instances of -O.
>> From man cc:
>> " -O2 Optimize even more.
>> (...)
>> As compared to -O, this option increases both compilation time and the
>> performance of the generated code."
> As I understand gcc uses the lastest -O option, therefore -O -O2 is the same
> as -O2. Also you may disable optimizations using -O -O0. As to -O2 itself,
> I believe you would not see any significant changes in nginx with -O2
> if compared with just -O. However, -O0 vs -O change is dramatically.
> --
> Igor Sysoev
> http://sysoev.ru/en/


More information about the nginx mailing list