Opened 12 years ago

Closed 12 years ago

#204 closed defect (invalid)

Nginx is not compiling in pentium 3 with libatomic.

Reported by: Cleber J Santos Owned by: somebody
Priority: blocker Milestone: 1.3
Component: nginx-core Version: 1.3.x
Keywords: Cc: cleber@…
uname -a: Linux cleberjsantos1 3.2.0-29-generic-pae #46-Ubuntu SMP Fri Jul 27 17:25:43 UTC 2012 i686 i686 i386 GNU/Linux
nginx -V: nginx version: nginx/1.2.3
built by gcc 4.6.3 (Ubuntu/Linaro 4.6.3-1ubuntu5)

Description

I'm using nginx 1.2.3 and my architecture is pentium 3 as shown in the below output:

uname -a

Linux cleberjsantos1 3.2.0-29-generic-pae #46-Ubuntu SMP Fri Jul 27 17:25:43 UTC 2012 i686 i686 i386 GNU/Linux

lscpu

Arquitetura:           i686
CPU op-mode(s):        32-bit, 64-bit
Byte Order:            Little Endian
CPU(s):                4
On-line CPU(s) list:   0-3
Thread(s) por núcleo: 2
Núcleo(s) por soquete:2
Soquete(s):            1
ID do fabricante:      GenuineIntel
CPU family:            6
Modelo:                42
Stepping:              7
CPU MHz:               800.000
BogoMIPS:              4390.00
Virtualização:       VT-x
L1d cache:             32K
L1i cache:             32K
L2 cache:              256K
L3 cache:              3072K

gcc -v

Usando especificações internas.
COLLECT_GCC=/usr/bin/gcc-4.6.real
COLLECT_LTO_WRAPPER=/usr/lib/gcc/i686-linux-gnu/4.6/lto-wrapper
Alvo: i686-linux-gnu
Configurado com: ../src/configure -v --with-pkgversion='Ubuntu/Linaro 4.6.3-1ubuntu5' --with-bugurl=file:///usr/share/doc/gcc-4.6/README.Bugs --enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.6 --enable-shared --enable-linker-build-id --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.6 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object --enable-plugin --enable-objc-gc --enable-targets=all --disable-werror --with-arch-32=i686 --with-tune=generic --enable-checking=release --build=i686-linux-gnu --host=i686-linux-gnu --target=i686-linux-gnu
Modelo de thread: posix
versão do gcc 4.6.3 (Ubuntu/Linaro 4.6.3-1ubuntu5) 

Options used for compilation:

./configure --prefix="/home/cleber/projetos/clientes/buildouts_255_317_336/parts/nginx-build" --with-http_gzip_static_module --with-http_stub_status_module --with-http_dav_module --with-http_ssl_module --with-http_flv_module --with-pcre --with-poll_module --with-google_perftools_module --with-libatomic --with-libatomic=/usr/lib --with-cpu-opt=pentium3 --with-cc-opt="-march=pentium3" --http-client-body-temp-path=/home/cleber/projetos/clientes/buildouts_255_317_336/var/tmp/client --http-proxy-temp-path=/home/cleber/projetos/clientes/buildouts_255_317_336/var/tmp/proxy --http-fastcgi-temp-path=/home/cleber/projetos/clientes/buildouts_255_317_336/var/tmp/fcgi --with-md5-asm --with-md5=/usr/include --with-sha1-asm --with-sha1=/usr/include --with-http_realip_module

Trace back

checking for OS
 + Linux 3.2.0-29-generic-pae i686
checking for C compiler ... found
 + using GNU C compiler
 + gcc version: 4-Target: i686-linux-gnu
5-Configured with: ../src/configure -v --with-pkgversion='Ubuntu/Linaro 4.6.3-1ubuntu5' --with-bugurl=file:///usr/share/doc/gcc-4.6/README.Bugs --enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.6 --enable-shared --enable-linker-build-id --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.6 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object --enable-plugin --enable-objc-gc --enable-targets=all --disable-werror --with-arch-32=i686 --with-tune=generic --enable-checking=release --build=i686-linux-gnu --host=i686-linux-gnu --target=i686-linux-gnu
6-Thread model: posix
7:gcc version 4.6.3 (Ubuntu/Linaro 4.6.3-1ubuntu5) 
checking for gcc -pipe switch ... found
checking for gcc builtin atomic operations ... found
checking for C99 variadic macros ... found
checking for gcc variadic macros ... found
checking for unistd.h ... found
checking for inttypes.h ... found
checking for limits.h ... found
checking for sys/filio.h ... not found
checking for sys/param.h ... found
checking for sys/mount.h ... found
checking for sys/statvfs.h ... found
checking for crypt.h ... found
checking for Linux specific features
checking for epoll ... found
checking for sendfile() ... found
checking for sendfile64() ... found
checking for sys/prctl.h ... found
checking for prctl(PR_SET_DUMPABLE) ... found
checking for sched_setaffinity() ... found
checking for crypt_r() ... found
checking for sys/vfs.h ... found
checking for nobody group ... not found
checking for nogroup group ... found
checking for poll() ... found
checking for /dev/poll ... not found
checking for kqueue ... not found
checking for crypt() ... not found
checking for crypt() in libcrypt ... found
checking for F_READAHEAD ... not found
checking for posix_fadvise() ... found
checking for O_DIRECT ... found
checking for F_NOCACHE ... not found
checking for directio() ... not found
checking for statfs() ... found
checking for statvfs() ... found
checking for dlopen() ... not found
checking for dlopen() in libdl ... found
checking for sched_yield() ... found
checking for SO_SETFIB ... not found
checking for SO_ACCEPTFILTER ... not found
checking for TCP_DEFER_ACCEPT ... found
checking for TCP_KEEPIDLE, TCP_KEEPINTVL, TCP_KEEPCNT ... found
checking for TCP_INFO ... found
checking for accept4() ... found
checking for int size ... 4 bytes
checking for long size ... 4 bytes
checking for long long size ... 8 bytes
checking for void * size ... 4 bytes
checking for uint64_t ... found
checking for sig_atomic_t ... found
checking for sig_atomic_t size ...
./configure: error: can not detect sig_atomic_t size
nginx-build: Command failed with exit code 1: ./configure --prefix="/home/cleber/projetos/clientes/buildouts_255_317_336/parts/nginx-build" --with-http_gzip_static_module --with-http_stub_status_module --with-http_dav_module --with-http_ssl_module --with-http_flv_module --with-pcre --with-poll_module --with-google_perftools_module --with-libatomic --with-libatomic=/usr/lib --with-cpu-opt=pentium3 --with-cc-opt="-march=pentium3" --http-client-body-temp-path=/home/cleber/projetos/clientes/buildouts_255_317_336/var/tmp/client --http-proxy-temp-path=/home/cleber/projetos/clientes/buildouts_255_317_336/var/tmp/proxy --http-fastcgi-temp-path=/home/cleber/projetos/clientes/buildouts_255_317_336/var/tmp/fcgi --with-md5-asm --with-md5=/usr/include --with-sha1-asm --with-sha1=/usr/include --with-http_realip_module
nginx-build: Compilation error. The package is left as is at /home/cleber/projetos/clientes/buildouts_255_317_336/parts/nginx-build__compile__/nginx-1.2.3 where you can inspect what went wrong

Change History (5)

comment:1 by is, 12 years ago

Resolution: invalid
Status: newclosed

./configure --help | grep libatomic

--with-libatomic force libatomic_ops library usage
--with-libatomic=DIR set path to libatomic_ops library sources

You should use either

--with-libatomic

or

--with-libatomic=/path/to/libatomic/source/files/

Besides, libatomic is required only for exotic platforms which have no gcc and nginx builtin atomic support.

Pentium 3 is supported by both gcc:

checking for gcc builtin atomic operations ... found

and nginx itself.

in reply to:  1 ; comment:2 by Cleber J Santos, 12 years ago

Replying to is:

./configure --help | grep libatomic

--with-libatomic force libatomic_ops library usage
--with-libatomic=DIR set path to libatomic_ops library sources

You should use either

--with-libatomic

or

--with-libatomic=/path/to/libatomic/source/files/

Besides, libatomic is required only for exotic platforms which have no gcc and nginx builtin atomic support.

Pentium 3 is supported by both gcc:

checking for gcc builtin atomic operations ... found

and nginx itself.

The options were used as I passed the ticket:

 --with-libatomic

Passing or not he is giving the error I mentioned, I have another server with Debian and it is working, it is an amd.

Ubuntu used libatomic_ops.

in reply to:  2 comment:3 by is, 12 years ago

Replying to Cleber J Santos <cleber@cleberjsantos.com.br>:

Replying to is:

./configure --help | grep libatomic

--with-libatomic force libatomic_ops library usage
--with-libatomic=DIR set path to libatomic_ops library sources

You should use either

--with-libatomic

or

--with-libatomic=/path/to/libatomic/source/files/

Besides, libatomic is required only for exotic platforms which have no gcc and nginx builtin atomic support.

Pentium 3 is supported by both gcc:

checking for gcc builtin atomic operations ... found

and nginx itself.

The options were used as I passed the ticket:

 --with-libatomic

According to ticket:
... --with-google_perftools_module --with-libatomic --with-libatomic=/usr/lib ...

Passing or not he is giving the error I mentioned, I have another server with Debian and it is working, it is an amd.

Ubuntu used libatomic_ops.

gcc generates better inlined code (just single CPU instruction on i386/amd64) with its builtin atomic operations instead of external function calls to libatomic_ops.

comment:4 by Cleber J Santos, 12 years ago

Resolution: invalid
Status: closedreopened

The problem occurred because in my system have changed through grep alias:

File: ~ /. bashrc

export GREP_OPTIONS="--line-number --before-context=3 --after-context=3 --color=always"

But I also see as a problem that we have in the build Nginx scripts, he does not anticipate that grep can be aliased to avoid problems and one way that I see to be the simplest is:

--- gcc          2012-09-24 15:08:24.891596686 -0300
+++ gcc.modified 2012-09-24 15:09:03.871597515 -0300
@@ -8,9 +8,7 @@
 #     4.0.0, 4.0.1, 4.1.0
 
 
-NGX_GCC_VER=`$CC -v 2>&1 | grep 'gcc version' 2>&1 \
-                         | sed -e 's/^.* version \(.*\)/\1/'`
-
+NGX_GCC_VER=`$CC -v 2>&1 | sed -ne 's/^gcc version \(.*\)/\1/p'`
 echo " + gcc version: $NGX_GCC_VER"
 
 have=NGX_COMPILER value="\"gcc $NGX_GCC_VER\"" . auto/define
Version 0, edited 12 years ago by Cleber J Santos (next)

comment:5 by Maxim Dounin, 12 years ago

Resolution: invalid
Status: reopenedclosed

Well, --color=auto exists for reason. As with the options set grep behaviour isn't compatible with POSIX there is no surprise configure fails.

The patch might work for you, but it's certainly neither something general nor the route we want to follow. It also changes semantics of the actual test, and no longer handles "gcc driver version ... executing gcc version ..." as used to be produced by gcc invoked with -V switch.

I would suggest to fix your build environment instead.

Note: See TracTickets for help on using tickets.