Opened 11 years ago

Closed 11 years ago

#286 closed defect (worksforme)

auto/make LINK variable doesn't reflect CFLAGS

Reported by: Chris Nehren Owned by: sb
Priority: minor Milestone:
Component: nginx-core Version: 1.3.x
Keywords: Cc:
uname -a: SunOS cnehrenbuild 5.11 omnios-eae537b i86pc i386 i86pc
nginx -V: Can't get it to build, so no nginx -V, but this applies to 1.2.6 and 1.3.11.


The auto/make script sets some variables like $CC, $CFLAGS, and $LINK. It applies $CFLAGS to $CC which is correct. However, it sets $LINK to $CC without respecting $CFLAGS, which causes problems like

ld: fatal: file objs/src/core/nginx.o: wrong ELF class: ELFCLASS64
ld: fatal: file processing errors. No output written to objs/nginx
collect2: ld returned 1 exit status

when trying to build nginx 64bit on illumos.

Attachments (1) (302 bytes ) - added by Chris Nehren 11 years ago.
patch for auto/make to fix problem

Download all attachments as: .zip

Change History (3)

by Chris Nehren, 11 years ago

patch for auto/make to fix problem

comment:1 by maxim, 11 years ago

Owner: set to sb
Status: newassigned

Sergey, please take a look.

comment:2 by Sergey Budnevitch, 11 years ago

Resolution: worksforme
Status: assignedclosed

It seems you have defined CFLAGS environment variable, and thus turned off normal nginx configuration, so if this is the case it is your obligation to provide correct flags to compiler and linker. You could add necessary linker options by --with-ld-opt=.

If the only thing you want is to build nginx, you have no need to define CFLAGS, instead you should add --with-cpu-opt=amd64 --with-cc=/path/to/c/compiler to nginx configure.

As to LINK variable it is incorrect place for linker options in any case, use CORE_LINK instead.

Note: See TracTickets for help on using tickets.