Project

General

Profile

Bug #1229

Unable to compile on AIX 5.3 using gcc 4.1.1

Added by Anonymous over 12 years ago. Updated about 3 years ago.

Status:
Fixed
Priority:
Normal
Assignee:
-
Category:
core
Target version:
Start date:
Due date:
% Done:

0%

Estimated time:
Missing in 1.5.x:

Description

Here's the configure line that I used:

./configure --prefix=/opt/lighttpd-1.4.15

Here's the last output from the compiler before it died:

bash-3.00# make
make all-recursive
Making all in src
maker1: Entering directory `/tmp/lighttpd-1.4.15/src'
/bin/sh ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -DLIBRARY_DIR="\"/opt/lighttpd-1.4.15/lib\"" -I. -I.. -D_REENTRANT -D+EXTENSIONS_+ -I/opt/pware/include -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGE_FILES -g -O2 -Wall -W -Wshadow -pedantic -std=gnu99 -MT mod_webdav_la-mod_webdav.lo -MD -MP -MF .deps/mod_webdav_la-mod_webdav.Tpo -c -o mod_webdav_la-mod_webdav.lo `test -f 'mod_webdav.c' || echo './'`mod_webdav.c
gcc -DHAVE_CONFIG_H -DLIBRARY_DIR=\"/opt/lighttpd-1.4.15/lib\" -I. -I.. -D_REENTRANT -D+EXTENSIONS_+ -I/opt/pware/include -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGE_FILES -g -O2 -Wall -W -Wshadow -pedantic -std=gnu99 -MT mod_webdav_la-mod_webdav.lo -MD -MP -MF .deps/mod_webdav_la-mod_webdav.Tpo -c mod_webdav.c -o mod_webdav_la-mod_webdav.o
mod_webdav.c: In function 'webdav_delete_file':
mod_webdav.c:536: warning: unused parameter 'p'
mod_webdav.c: In function 'webdav_copy_file':
mod_webdav.c:664: warning: unused parameter 'p'
mod_webdav.c: In function 'webdav_has_lock':
mod_webdav.c:1153: warning: unused parameter 'srv'
mod_webdav.c:1153: warning: unused parameter 'con'
mod_webdav.c:1153: warning: unused parameter 'p'
mod_webdav.c:1153: warning: unused parameter 'uri'
mod_webdav.c: In function 'mod_webdav_subrequest_handler':
mod_webdav.c:1705: error: 'struct <anonymous>' has no member named 'mmap64'
mod_webdav.c:1713: error: 'struct <anonymous>' has no member named 'mmap64'
mod_webdav.c:1720: error: 'struct <anonymous>' has no member named 'mmap64'
mod_webdav.c:1728: error: 'struct <anonymous>' has no member named 'mmap64'
maker1: * mod_webdav_la-mod_webdav.lo Error 1
maker1: Leaving directory `/tmp/lighttpd-1.4.15/src'
make: *
all-recursive Error 1
make: 1254-004 The error code from the last command is 2.

Stop.

-- j.m.jackson


Related issues

Related to Bug #1201: Unable to compile on AIX 5.1 using gcc 4.0.0Obsolete

Actions

History

#1

Updated by Anonymous over 12 years ago

Ok, i can get farther if i use the following configure line, which disables large file support:

./configure --disable-lfs --prefix=/opt/lighttpd-1.4.15

AND the resultant binary is runnable, but it looks like the modules compile their .a and .la parts, but never produce the .so file, so when i run lighty, i get this:

./lighttpd -f /tmp/lighttpd-1.4.15/doc/lighttpd.conf
2007-06-12 15:42:12: (plugin.c.165) dlopen() failed for: /opt/lighttpd-1.4.15/lib/mod_indexfile.so Could not load module /opt/lighttpd-1.4.15/lib/mod_indexfile.so.
System error: No such file or directory
2007-06-12 15:42:12: (server.c.594) loading plugins finally failed

ls /opt/lighttpd-1.4.15/lib/
liblightcomp.a mod_expire.a mod_scgi.a
liblightcomp.la mod_expire.la mod_scgi.la
mod_access.a mod_extforward.a mod_secdownload.a
mod_access.la mod_extforward.la mod_secdownload.la
mod_accesslog.a mod_fastcgi.a mod_setenv.a
mod_accesslog.la mod_fastcgi.la mod_setenv.la
mod_alias.a mod_flv_streaming.a mod_simple_vhost.a
mod_alias.la mod_flv_streaming.la mod_simple_vhost.la
mod_auth.a mod_indexfile.a mod_ssi.a
mod_auth.la mod_indexfile.la mod_ssi.la
mod_cgi.a mod_magnet.a mod_staticfile.a
mod_cgi.la mod_magnet.la mod_staticfile.la
mod_cml.a mod_mysql_vhost.a mod_status.a
mod_cml.la mod_mysql_vhost.la mod_status.la
mod_compress.a mod_proxy.a mod_trigger_b4_dl.a
mod_compress.la mod_proxy.la mod_trigger_b4_dl.la
mod_dirlisting.a mod_redirect.a mod_userdir.a
mod_dirlisting.la mod_redirect.la mod_userdir.la
mod_evasive.a mod_rewrite.a mod_usertrack.a
mod_evasive.la mod_rewrite.la mod_usertrack.la
mod_evhost.a mod_rrdtool.a mod_webdav.a
mod_evhost.la mod_rrdtool.la mod_webdav.la

Any ideas?

-- j.m.jackson

#2

Updated by Anonymous over 12 years ago

got the same problems under qnx. it seems that there are no shared libs created.

#3

Updated by Anonymous almost 12 years ago

I were able to compile using the xlc_r compiler with the following configure command

CC="xlc_r" CFLAGS="-O2 -brtl -bexpfull" \
./configure \
--disable-lfs \

The shared libaries all end up under src/.libs, however in order to get them to work properly you will need to change CFLAGS of the main binary to use -brtl -bexpfull and the shared libraries to use -G -qmkshrobj -bexpfull, so changes to the Makefiles in . and ./src as well as libtool needs to be made. The configure script does not seem to update Makefile's and libtool's correctly for aix.

I did run into a problem
"configfile.c", line 977.1: 1506-191 (E) The character # is not a valid C source character.
"configfile.c", line 979.1: 1506-191 (E) The character # is not a valid C source character.
"configfile.c", line 981.1: 1506-191 (E) The character # is not a valid C source character.
"configfile.c", line 977.8: 1506-276 (S) Syntax error: possible missing ')'?
"configfile.c", line 977.2: 1506-045 (S) Undeclared identifier ifdef.
maker2: *** configfile.o Error 1

I just got rid of the #ifdef, specifying '/' in all cases, and it compiled fine, though that is likely not the right long term solution.

#4

Updated by Anonymous over 11 years ago

I got the same "mmap64" message with AIX5.3TL4 using IBM's version of GCC4.0.0. However I was able to get rid of this message by altering the definition of the mmap structure defined in chunk.h and used in mod_cgi.c; mod_webdav.c; network_writev.c; and chunk.c. I assumed that this might be a problem with the system "mmap" definitions, so renamed the one in the five files named to "mymap" and the error message disappears.
At the basic level that I'm able to test at the moment this doesn't seem to break the software.
I'm also wondering if switching the compile system to 32bit mode (using the environment variable ABI=32) would also be a way to stop the error? Unfortunately, I've not got access to 64-bit AIX hardware at the moment to try this.

-- r_l_cross a t lycos.co.uk

#5

Updated by stbuehler over 11 years ago

Ok, this is an "easy" problem - your systems define a macro mmap:


#define mmap mmap64

I think that is broken behaviour... but how to fix it?

Either rename the mmap element to mymap as suggested above, or try adding


#include <sys/mman.h>

in chunks.h before the struct definition. I would prefer the latter one ;-)

#6

Updated by stbuehler over 11 years ago

  • Status changed from New to Fixed
  • Resolution set to worksforme

Broken system header (imho) and missing feedback.

#7

Updated by stbuehler almost 11 years ago

  • Status changed from Fixed to Missing Feedback
#8

Updated by cmihai over 10 years ago

  • Status changed from Missing Feedback to Reopened

All issues above are still valid of a AIX 5300-09-02-0849 using XL C 10.1.0.1.

It builds with these changes:

src/chunks.h
6a7,9
> #include <sys/mman.h>
>
>
10a14
>

src/configfile.c
1004,1010c1004
<       pos = strrchr(fn,
< #ifdef __WIN32
<                       '\\'
< #else
<                       '/'
< #endif
<                       );
---
>       pos = strrchr(fn,'/');

But it doesn't get linked properly:

$ lighttpd -f test-lighttpd.conf
2009-02-16 00:47:46: (plugin.c.165) dlopen() failed for: /usr/local/lib/mod_indexfile.so 0509-022 Cannot load module /usr/local/lib/mod_indexfile.so.
0509-026 System error: A file or directory in the path name does not exist.
2009-02-16 00:47:46: (server.c.610) loading plugins finally failed

gmake install reports:

Libraries have been installed in:
/usr/local/lib

If you ever happen to want to link against installed libraries in a given directory, LIBDIR, you must either use libtool, and specify the full pathname of the library, or use the `-LLIBDIR' flag during linking and do at least one of the following:
  • add LIBDIR to the `LIBPATH' environment variable during execution
  • use the `-Wl,-blibpath:LIBDIR:/usr/local/ssl/lib:/usr/local/lib:/opt/freeware/lib:/usr/vac/lib:/usr/lib:/lib ' linker flag
 /bin/sh ../libtool   --mode=install /opt/freeware/bin/ginstall -c  'mod_staticfile.la' '/usr/local/lib/mod_staticfile.la'
libtool: install: warning: relinking `mod_staticfile.la'
(cd /home/cmihai/packaging/lighttpd-1.4.20/src; /bin/sh ../libtool  --tag=CC --mode=relink xlc -q64 -O3 -qnoansialias -I /usr/local/ssl/include -I/usr/local/include -I/opt/freeware/include -module -export-dynamic -avoid-version -no-undefined -L/usr/local/ssl/lib -L/usr/local/lib -L/opt/freeware/lib -o mod_staticfile.la -rpath /usr/local/lib mod_staticfile.lo liblightcomp.la )
generating symbol list for `mod_staticfile.la'
/usr/bin/nm -B -BCpg  .libs/mod_staticfile.o  | awk '{ if ((($2 == "T") || ($2 == "D") || ($2 == "B")) && (substr($3,1,1) != ".")) { print $3 } }' | sort -u > .libs/mod_staticfile.exp
xlc -q64 -Wl,-bM:SRE -o .libs/mod_staticfile.so  .libs/mod_staticfile.o  -Wl,-blibpath:/usr/local/lib:/usr/local/ssl/lib:/usr/local/lib:/opt/freeware/lib:/usr/vac/lib:/usr/lib:/lib -L/usr/local/ssl/lib -L/usr/local/lib -L/opt/freeware/lib /usr/local/lib/liblightcomp.a -lc -Wl,-bnoentry  -q64 -qnoansialias -Wl,-bE:.libs/mod_staticfile.exp ${wl}-bernotok
ar cru .libs/mod_staticfile.a .libs/mod_staticfile.so
/opt/freeware/bin/ginstall -c .libs/mod_staticfile.aT /usr/local/lib/mod_staticfile.a
#9

Updated by cmihai over 10 years ago

Server: lighttpd/1.4.22
<html><body><h1>It works!</h1></body></html>

It works :-).

#include <sys/mman.h> in chunks.h before the struct definition fixed the issue. I also had to rebuild with different LDFLAGS and NM values, and now it works.

#10

Updated by gstrauss about 3 years ago

  • Related to Bug #1201: Unable to compile on AIX 5.1 using gcc 4.0.0 added
#11

Updated by gstrauss about 3 years ago

  • Description updated (diff)
  • Status changed from Reopened to Fixed

marking fixed per above notes

Also available in: Atom