Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 9 Aug 2009 12:42:58 -0800
From:      Mel Flynn <mel.flynn+fbsd.questions@mailing.thruhere.net>
To:        freebsd-questions@freebsd.org
Cc:        APR maintainer <pgollucci@freebsd.org>, Charles Howse <chowse@charter.net>, Maintainer <araujo@freebsd.org>
Subject:   Re: mod_security 2.5.9
Message-ID:  <200908091242.58470.mel.flynn%2Bfbsd.questions@mailing.thruhere.net>
In-Reply-To: <2A95E0AE-73DF-48F5-87E6-32683FE5AA8C@charter.net>
References:  <2097B988-0F1B-4F60-812D-71F6AB2C17CA@charter.net> <200908082038.51127.mel.flynn%2Bfbsd.questions@mailing.thruhere.net> <2A95E0AE-73DF-48F5-87E6-32683FE5AA8C@charter.net>

next in thread | previous in thread | raw e-mail | index | archive | help
--Boundary-00=_STzfK8koMaT+8zr
Content-Type: text/plain;
  charset="us-ascii"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

On Sunday 09 August 2009 04:24:37 Charles Howse wrote:
> On Aug 8, 2009, at 11:38 PM, Mel Flynn wrote:
> > On Saturday 08 August 2009 19:38:42 Charles Howse wrote:
> >> On Aug 8, 2009, at 11:36 AM, Mel Flynn wrote:
> >>> On Saturday 08 August 2009 08:00:47 Charles Howse wrote:
> >>>> Just wondering if anyone has tried updating from mod_security 2.5.9
> >>>> to
> >>>> 2.5.9_1 via portupgrade.
> >>>> It fails with a "linker error" for me.
> >>>
> >>> And can we see the actual linker error?
> >>
> >> Thought I had included enough in my original post.
> >> Here's the mod_security part of 'portupgrade -a'
> >>
> >> ...
> >> [Updating the pkgdb <format:bdb_btree> in /var/db/pkg ... - 51
> >> packages found (-0 +1) . done]
> >> --->  Upgrading 'mod_security-2.5.9' to 'mod_security-2.5.9_1' (www/
> >> mod_security)
> >> --->  Building '/usr/ports/www/mod_security'
> >
> > ...
> >
> >> checking for libapr config script... /usr/local/bin/apr-1-config
> >> configure: using ' -lcrypt  -pthread' for apr Library
> >
> >                    ^^^^^^^^^^^^^^^^^^
> >
> >> /usr/local/share/apr/build-1/libtool --silent --mode=link cc -o
> >> mod_security2.la -R/usr/local/lib  -L/usr/local/lib -L/usr/local/
> >> lib -
> >> L/usr/local/lib -lpcre -lxml2 -lz -liconv -lm -rpath /usr/local/
> >> libexec/apache22 -module -avoid-version    msc_release.lo msc_lua.lo
> >> acmp.lo msc_geo.lo pdf_protect.lo msc_reqbody.lo persist_dbm.lo
> >> msc_pcre.lo msc_util.lo msc_parsers.lo modsecurity.lo
> >> msc_multipart.lo
> >> msc_xml.lo msc_logging.lo re_variables.lo re_tfns.lo re_actions.lo
> >> re_operators.lo re.lo apache2_util.lo apache2_io.lo apache2_config.lo
> >> mod_security2.lo
> >> # XXX there is "mlogc-static" target in the Makefile, too
> >> cd /usr/ports/www/mod_security/work/modsecurity-apache_2.5.9/apache2
> >> && /usr/bin/env SHELL=/bin/sh NO_LINT=YES   PREFIX=/usr/local
> >> LOCALBASE=/usr/local X11BASE=/usr/local  MOTIFLIB="-L/usr/local/lib -
> >> lXm -lXp" LIBDIR="/usr/lib"  CC="cc" CFLAGS="-O2 -fno-strict-
> >> aliasing -
> >> pipe" CXX="c++" CXXFLAGS="-O2 -fno-strict-aliasing -pipe"
> >> MANPREFIX="/
> >> usr/local" BSD_INSTALL_PROGRAM="install  -s -o root -g wheel -m 555"
> >> BSD_INSTALL_SCRIPT="install  -o root -g wheel -m 555"
> >> BSD_INSTALL_DATA="install  -o root -g wheel -m 444"
> >> BSD_INSTALL_MAN="install  -o root -g wheel -m 444" make -f Makefile
> >> mlogc
> >>
> >> Building dynamically linked mlogc...
> >> /usr/local/lib/libapr-1.so: undefined reference to `pthread_yield'
> >> /usr/local/lib/libapr-1.so: undefined reference to
> >> `pthread_attr_destroy'
> >> /usr/local/lib/libapr-1.so: undefined reference to `pthread_create'
> >> /usr/local/lib/libapr-1.so: undefined reference to
> >> `pthread_attr_init'
> >> /usr/local/lib/libapr-1.so: undefined reference to `pthread_exit'
> >> /usr/local/lib/libapr-1.so: undefined reference to `pthread_equal'
> >> /usr/local/lib/libapr-1.so: undefined reference to `pthread_detach'
> >> /usr/local/lib/libapr-1.so: undefined reference to
> >> `pthread_attr_setstacksize'
> >> /usr/local/lib/libapr-1.so: undefined reference to
> >> `pthread_attr_getdetachstate'
> >> /usr/local/lib/libapr-1.so: undefined reference to
> >> `pthread_attr_setguardsize'
> >> /usr/local/lib/libapr-1.so: undefined reference to
> >> `pthread_attr_setdetachstate'
> >> /usr/local/lib/libapr-1.so: undefined reference to `pthread_join'
> >> /usr/local/lib/libapr-1.so: undefined reference to
> >> `pthread_cond_timedwait'
> >> *** Error code 1
> >
> > Apparently -pthread isn't passed here. I've tried to reproduce this,
> > but I
> > can't. Could you show the output of:
> > make -C /usr/ports/www/mod_security actual-package-depends
>
> root@curly /root# make -C /usr/ports/www/mod_security actual-package-
> depends
> pcre-7.9:devel/pcre
> apr-gdbm-db42-1.3.8.1.3.9:devel/apr
> curl-7.19.5_1:ftp/curl
> libxml2-2.7.3:textproc/libxml2
> apache-2.2.11_7:www/apache22
> pkg-config-0.23_1:devel/pkg-config
> expat-2.0.1:textproc/expat2
> gdbm-1.8.3_3:databases/gdbm
> db42-4.2.52_5:databases/db42
> libiconv-1.13.1:converters/libiconv
> ca_root_nss-3.11.9_2:security/ca_root_nss
> pkg-config-0.23_1:devel/pkg-config
> libiconv-1.13.1:converters/libiconv
> expat-2.0.1:textproc/expat2
> perl-5.8.9_3:lang/perl5.8
> pcre-7.9:devel/pcre
> libiconv-1.13.1:converters/libiconv
> root@curly /root#
>
> > Also the contents of /var/db/ports/apr/options.
>
> root@curly /root# cat /var/db/ports/apr/options
> # This file is auto-generated by 'make config'.
> # No user-servicable parts inside!
> # Options for apr-gdbm-db42-1.3.3.1.3.4_1
> _OPTIONS_READ=apr-gdbm-db42-1.3.3.1.3.4_1
> WITH_THREADS=true
> WITHOUT_IPV6=true
> WITH_GDBM=true
> WITH_BDB=true
> WITHOUT_NDBM=true
> WITHOUT_LDAP=true
> WITHOUT_MYSQL=true
> WITHOUT_PGSQL=true

Ok, reproduced in a clean jail on a 6.4-p6 box, amd64.
I tried setting WITH_THREADS in www/apache22 options (built without first), 
but that didn't change anything.
I built apache22 with defaults + APR_FROM_PORTS.

On the working machine (7.1) I see no mention of pthread in the mlogc makefile 
either, so perhaps the linker got smarter in 7.x.

I've attached a patch that fixes the issue.
@maintainers: do you want a PR for this?
-- 
Mel

--Boundary-00=_STzfK8koMaT+8zr
Content-Type: text/plain; charset="ISO-8859-1";
	name="patch-www::mod_security.txt"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
	filename="patch-www::mod_security.txt"

--- Makefile.orig	2009-08-05 12:31:21.000000000 -0800
+++ Makefile	2009-08-09 12:34:34.000000000 -0800
@@ -47,6 +47,9 @@
 SUB_FILES+=	pkg-message.rules
 .if defined(WITH_MLOGC)
 PLIST_FILES+=	bin/mlogc
+.if ${OSVERSION} < 700000
+EXTRA_PATCHES+=	${FILESDIR}/extra-patch-fix-6.x-link
+.endif
 .endif
 PLIST_DIRS+=	${APACHEETCDIR}/Includes/mod_security2/optional_rules
 PLIST_DIRS+=	${APACHEETCDIR}/Includes/mod_security2
--- /dev/null	2009-08-09 12:37:23.000000000 -0800
+++ files/extra-patch-fix-6.x-link	2009-08-09 12:25:33.000000000 -0800
@@ -0,0 +1,11 @@
+--- mlogc-src/Makefile.in.orig	2008-09-02 23:10:36.000000000 +0000
++++ mlogc-src/Makefile.in	2009-08-09 20:24:50.000000000 +0000
+@@ -10,7 +10,7 @@
+ MLOGC_VERSION = `grep '^\#define *VERSION ' mlogc.c | sed 's/.*VERSION *"\([^"]*\)"/\1/'`
+ 
+ APR_FLAGS = @APR_CFLAGS@
+-APR_LIBS = @APR_LINK_LD@
++APR_LIBS = @APR_LINK_LD@ @APR_LIBS@
+ 
+ CURL_FLAGS = @CURL_CFLAGS@
+ CURL_LIBS = @CURL_LIBS@

--Boundary-00=_STzfK8koMaT+8zr--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200908091242.58470.mel.flynn%2Bfbsd.questions>