Trouble trying to compile apache2

Jon Turney jon.turney@dronecode.org.uk
Thu Feb 17 15:35:06 GMT 2022


On 14/02/2022 22:25, Scott Wood wrote:
> I'm trying to compile a current version of apache2 httpd under the cygwin64
> environment. There is an older version of apache2 compiled in cygwin but
> it's orphaned and didn't include some of the ssl libs I needed.
> 
> When I try to compile it's failing when trying to compile the
> mod_cache_disk module:
> 
> --------- modules/cache make results start ---------
[...]
> /usr/share/apr/build-1/libtool --silent --mode=link gcc       -L/usr/lib
> -no-undefined -shrext .so -Wl,/usr/src/httpd-2.4.52/libhttpd.dll.a
>   -L/usr/lib -R/usr/lib -laprutil-1 -ldb-5.3 -lgdbm -lexpat -liconv
> -L/usr/lib -R/usr/lib -lapr-1 -luuid -lcrypt -lpthread  -o mod_cache_disk.la
> -rpath /usr/local/apache2/modules -module -avoid-version  mod_cache_disk.lo
> /usr/lib/gcc/x86_64-pc-cygwin/11/../../../../x86_64-pc-cygwin/bin/ld:
> .libs/mod_cache_disk.o:mod_cache_disk:(.text+0x47): undefined reference to
> `ap_cache_generate_name'
> /usr/lib/gcc/x86_64-pc-cygwin/11/../../../../x86_64-pc-cygwin/bin/ld:
> .libs/mod_cache_disk.o:mod_cache_disk:(.text+0x12d): undefined reference to
> `ap_cache_generate_name'
> /usr/lib/gcc/x86_64-pc-cygwin/11/../../../../x86_64-pc-cygwin/bin/ld:
> .libs/mod_cache_disk.o:mod_cache_disk:(.text+0x3f32): undefined reference
> to `ap_cache_cacheable_headers_out'
> /usr/lib/gcc/x86_64-pc-cygwin/11/../../../../x86_64-pc-cygwin/bin/ld:
> .libs/mod_cache_disk.o:mod_cache_disk:(.text+0x3f59): undefined reference
> to `ap_cache_cacheable_headers_in'
> collect2: error: ld returned 1 exit status
> make[4]: *** [/usr/src/httpd-2.4.52/modules/cache/modules.mk:6:
> mod_cache_disk.la] Error 1
> make[4]: Leaving directory '/usr/src/httpd-2.4.52/modules/cache'
> make[3]: *** [/usr/src/httpd-2.4.52/build/rules.mk:117:
> shared-build-recursive] Error 1
> make[3]: Leaving directory '/usr/src/httpd-2.4.52/modules/cache'
> make[2]: *** [/usr/src/httpd-2.4.52/build/rules.mk:117:
> shared-build-recursive] Error 1
> make[2]: Leaving directory '/usr/src/httpd-2.4.52/modules'
> make[1]: *** [/usr/src/httpd-2.4.52/build/rules.mk:117:
> shared-build-recursive] Error 1
> make[1]: Leaving directory '/usr/src/httpd-2.4.52'
> make: *** [/usr/src/httpd-2.4.52/build/rules.mk:75: all-recursive] Error 1
> --------- modules/cache make results end ---------
> 
> 
> Digging up the old version in the cygwin ports, I found the patch files,
> but trying to manually apply a patch to the modules/cache/config.m4 didn't
> seem to fix the problem. It appears the patch is saying that the symbols
> I'm getting the errors upon exist in the 'main cache module' and thus it's
> changing a value of 'cache_disk_objs' in the m4 file to include mod_cache
> symbols when compiling/linking mod_disk_cache (but as you can see above,
> there appears to be no mention of mod_cache.* anything in the gcc or linker
> calls for mod_disk_cache)
> 
> patched lines from modules/cache/config.m4 is primarily adding cygwin to
> the OS/2 rule:
> 
> ------- relevant patched lines from modules/cache/config.m4 start -------
> cache_disk_objs="mod_cache_disk.lo"
> cache_socache_objs="mod_cache_socache.lo"
> 
> case "$host" in
>    *os2*|*cygwin*)
>      # OS/2 DLLs must resolve all symbols at build time
>      # and we need some from main cache module
>      cache_disk_objs="$cache_disk_objs mod_cache.la"
>      cache_socache_objs="$cache_socache_objs mod_cache.la"
>      ;;
> esac
> 
> APACHE_MODULE(cache, dynamic file caching.  At least one storage management
> module (e.g. mod_cache_disk) is also necessary., $cache_objs, , most)
> APACHE_MODULE(cache_disk, disk caching module, $cache_disk_objs, , most, ,
> cache)
> APACHE_MODULE(cache_socache, shared object caching module,
> $cache_socache_objs, , most)
> ------- relevant patched lines from modules/cache/config.m4 end -------
> 
> My C/make is rusty and I'm not sure the syntax to get it to properly pick
> up the symbols.
> 
> Can anyone help me figure out how to get this thing to compile? The patch
> included similar includes in other module directories so I probably have to
> apply similar fixes elsewhere.

Just applying the patch to the .m4 file is probably not sufficient. 
You'll need to run autoreconf (to regenerate the configury), then run 
the ./configure script, for that change to actually appear in the 
generated Makefile.




More information about the Cygwin mailing list