pkgsrc-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Failure building nginx 0.8.34 on Solaris 10 with sunpro compiler (w/ fix)


I'm using pkgsrc (2009Q4) to build nginx (I ran cvs update only in 
www/nginx) using Sun Studio 12.1 (sunpro) on Solaris 10/x86 (building for 

It fails with this error when linking the nginx binary:

Undefined                       first referenced
 symbol                             in file
ngx_atomic_fetch_add                objs/src/core/ngx_file.o
ngx_atomic_cmp_set                  objs/src/core/ngx_slab.o
ngx_cpu_pause                       objs/src/core/ngx_spinlock.o
ld: fatal: Symbol referencing errors. No output written to objs/nginx

This is because the nginx configure system (in auto/cc/conf file) sees that 
CFLAGS is set in the environment, so it does not process the compiler specific 
configuration file (in this case auto/cc/sunc). 

The problem is that auto/cc/sunc sets the NGX_AUX variable to add the assembler 
files needed for the atomic routines. If this is not set, the routines are not 
defined, and the linker error occurs.

Therefore the fix is to set the NGX_AUX file via the environment in 
I've only handled the i386 case as I don't have any other environment to test 

.if (${PKGSRC_COMPILER} == sunpro)
.if (${MACHINE_ARCH} == i386)
CONFIGURE_ENV+= NGX_AUX=" src/os/unix/" 

Home | Main Index | Thread Index | Old Index