The mod_bw port contains a single patch in files/, which includes some very strange code: +#if APR_MAJOR_VERSION == 0 +#define apr_atomic_set32(mem,val) (atomic_set_32(mem,val),mem) +#define apr_atomic_inc32(mem) (atomic_add_32(mem,1),mem) +#define apr_atomic_dec32(mem) (atomic_subtract_32(mem,1),mem) +#define apr_atomic_add32(mem,val) (atomic_add_32(mem,val),mem) +#define apr_atomic_cas32 apr_atomic_cas +#endif This was introduced when the port was upgraded to 0.7. This code, simply put, does not work with Apache 2.2.2 on FreeBSD 4.x. The end result is that mod_bw finds missing symbol references to the atomic_*_32() functions, because they aren't available on 4.x. The native apr_atomic_*32() functions come with Apache 2.2.2, and these work fine on 4.x. What I'm saying is, on 4.x, all I have to do is remove the patch in files/ and mod_bw works. We need to have this fixed, and it's quite important. I'd recommend that the patch only be applied on 5.x and 6.x systems, since it's not necessary on 4.x boxes. Fix: See description. How-To-Repeat: On a 4.x box, build mod_bw, then try to run Apache with the module loaded. You'll receive missing symbol definitions for atomic_*_32() functions.
Responsible Changed From-To: freebsd-ports-bugs->apache Over to maintainer
pav 2006-10-06 19:13:28 UTC FreeBSD ports repository Modified files: www/mod_bw Makefile www/mod_bw/files patch-mod_bw.c Log: - Remove a patch chunk which was breaking runtime on FreeBSD 4.X PR: ports/97883 Submitted by: Jeremy Chadwick <freebsd@jdc.parodius.com> Approved by: maintainer timeout (apache; 4 months) Revision Changes Path 1.6 +1 -0 ports/www/mod_bw/Makefile 1.2 +0 -15 ports/www/mod_bw/files/patch-mod_bw.c _______________________________________________ cvs-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/cvs-all To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
State Changed From-To: open->closed Offending patch chunk removed.
The same thing under 5.5 (with this code removed). uname -a FreeBSD falcon.telecom.by 5.5-RELEASE-p8 FreeBSD 5.5-RELEASE-p8 #4: Sat Nov 25 01:45:17 EET 2006 root@falcon.telecom.by:/usr/obj/usr/src/sys/FALCON i386 Apache installed: apache-2.0.59 pachectl configtest Syntax error on line 279 of /usr/local/etc/apache2/httpd.conf: Cannot load /usr/local/libexec/apache2/mod_bw.so into server: /usr/local/libexec/apache2/mod_bw.so: Undefined symbol "apr_atomic_inc32"
So it seems that removed patch is needed if building for apache 2.0.x, and not needed for apache 2.2.x. So according to what I see the following logic must be used: If apache 2.2.x - use native apache functions If BSD>=5.x and apache 2.0.x - use BSD function (as it was in deleted patch) If BSD=4.x and apache 2.0.x - no idea:(