#201 closed defect (fixed)
cannot build with gcc 4.7.1 and -O2
Reported by: | Brent Garber | Owned by: | somebody |
---|---|---|---|
Priority: | major | Milestone: | |
Component: | nginx-core | Version: | 1.3.x |
Keywords: | Cc: | ||
uname -a: | Linux 3.4.2-x86_64-linode25 #2 SMP Tue Jun 26 16:10:49 EDT 2012 x86_64 GNU/Linux | ||
nginx -V: | 1.3.5 |
Description
gcc -c -pipe -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g -O2 -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs -I src/http -I src/http/modules \ -o objs/src/http/ngx_http_core_module.o \ src/http/ngx_http_core_module.c src/http/ngx_http_core_module.c: In function ‘ngx_http_get_forwarded_addr’: src/http/ngx_http_core_module.c:2779:13: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing] cc1: all warnings being treated as errors make[1]: *** [objs/src/http/ngx_http_core_module.o] Error 1 make[1]: Leaving directory `/usr/src/nginx-1.3.5' make: *** [build] Error 2 make -f objs/Makefile install make[1]: Entering directory `/usr/src/nginx-1.3.5' gcc -c -pipe -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g -O2 -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs -I src/http -I src/http/modules \ -o objs/src/http/ngx_http_core_module.o \ src/http/ngx_http_core_module.c src/http/ngx_http_core_module.c: In function ‘ngx_http_get_forwarded_addr’: src/http/ngx_http_core_module.c:2779:13: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing] cc1: all warnings being treated as errors make[1]: *** [objs/src/http/ngx_http_core_module.o] Error 1 make[1]: Leaving directory `/usr/src/nginx-1.3.5' make: *** [install] Error 2
Attachments (1)
Change History (11)
follow-up: 3 comment:1 by , 12 years ago
comment:2 by , 12 years ago
comment:3 by , 12 years ago
Replying to Brent Garber <bgarber42@gmail.com>:
This is GCC 4.7.1
What Linux distribution do you use?
According to http://www.linode.com/faq.cfm, there's plenty of options.
follow-up: 5 comment:4 by , 12 years ago
Debian unstable, GNU toolchain is 4.7.1-7, 4.6.3-9 works with -O2 however.
by , 12 years ago
comment:5 by , 12 years ago
Replying to Brent Garber <bgarber42@gmail.com>:
Debian unstable, GNU toolchain is 4.7.1-7, 4.6.3-9 works with -O2 however.
Please try the patch I have attached.
follow-up: 7 comment:6 by , 12 years ago
That seems to do the trick:
# ./nginx -V nginx version: nginx/1.3.5 built by gcc 4.7.1 (Debian 4.7.1-7) TLS SNI support enabled configure arguments: --prefix=/etc/nginx --sbin-path=/usr/sbin/nginx --conf-path=/etc/nginx/nginx.conf --pid-path=/var/run/nginx.pid --lock-path=/var/lock/nginx.lock --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --user=www-data --group=www-data --with-ipv6 --with-http_ssl_module --with-http_gzip_static_module --with-http_stub_status_module --with-pcre-jit --with-sha1-asm --with-sha1=/usr/include --with-cc-opt=-O2 --with-cpu-opt=native
comment:8 by , 12 years ago
Summary: | Cannot Build on Linux → cannot build with gcc 4.7.1 and -O2 |
---|
Note:
See TracTickets
for help on using tickets.
This is GCC 4.7.1