Bug 97883 - www/mod_bw 0.7 doesn't work on 4.x due to patch in files/
Summary: www/mod_bw 0.7 doesn't work on 4.x due to patch in files/
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-apache (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-05-25 07:40 UTC by Jeremy Chadwick
Modified: 2006-12-29 12:00 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jeremy Chadwick 2006-05-25 07:40:15 UTC
	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.
Comment 1 Edwin Groothuis freebsd_committer freebsd_triage 2006-05-25 07:44:17 UTC
Responsible Changed
From-To: freebsd-ports-bugs->apache

Over to maintainer
Comment 2 dfilter service freebsd_committer freebsd_triage 2006-10-06 20:13:38 UTC
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"
Comment 3 Pav Lucistnik freebsd_committer freebsd_triage 2006-10-06 20:13:52 UTC
State Changed
From-To: open->closed

Offending patch chunk removed.
Comment 4 Oleg Gawriloff 2006-12-30 03:14:28 UTC
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"
Comment 5 Oleg Gawriloff 2006-12-30 03:20:32 UTC
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:(