[ https://www.modsecurity.org/tracker/browse/MODSEC-347?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Breno Silva Pinto resolved MODSEC-347.
--------------------------------------
Resolution: Not a Bug
> building modsecuriy 2.7.0 on linux to link with external PCRE fails to link to correct lib @ runtime
> ----------------------------------------------------------------------------------------------------
>
> Key: MODSEC-347
> URL: https://www.modsecurity.org/tracker/browse/MODSEC-347
> Project: ModSecurity
> Issue Type: Bug
> Security Level: Normal
> Components: Build System
> Affects Versions: 2.7.0
> Environment: uname -a
> Linux devdesk 3.4.11-2.16-desktop #1 SMP PREEMPT Wed Sep 26 17:05:00 UTC 2012 (259fc87) x86_64 x86_64 x86_64 GNU/Linux
> lsb_release -a
> LSB Version: core-2.0-noarch:core-3.2-noarch:core-4.0-noarch:core-2.0-x86_64:core-3.2-x86_64:core-4.0-x86_64:desktop-4.0-amd64:desktop-4.0-noarch:graphics-2.0-amd64:graphics-2.0-noarch:graphics-3.2-amd64:graphics-3.2-noarch:graphics-4.0-amd64:graphics-4.0-noarch
> Distributor ID: SUSE LINUX
> Description: openSUSE 12.2 (x86_64)
> Release: 12.2
> Codename: Mantis
> gcc -v
> Using built-in specs.
> COLLECT_GCC=/usr/bin/gcc-4.7
> COLLECT_LTO_WRAPPER=/usr/lib64/gcc/x86_64-suse-linux/4.7/lto-wrapper
> Target: x86_64-suse-linux
> Configured with: ../configure --prefix=/usr --infodir=/usr/share/info --mandir=/usr/share/man --libdir=/usr/lib64 --libexecdir=/usr/lib64 --enable-languages=c,c++,objc,fortran,obj-c++,java,ada --enable-checking=release --with-gxx-include-dir=/usr/include/c++/4.7 --enable-ssp --disable-libssp --disable-libitm --disable-plugin --with-bugurl=http://bugs.opensuse.org/ --with-pkgversion='SUSE Linux' --disable-libgcj --disable-libmudflap --with-slibdir=/lib64 --with-system-zlib --enable-__cxa_atexit --enable-libstdcxx-allocator=new --disable-libstdcxx-pch --enable-version-specific-runtime-libs --enable-linker-build-id --program-suffix=-4.7 --enable-linux-futex --without-system-libunwind --with-arch-32=i586 --with-tune=generic --build=x86_64-suse-linux
> Thread model: posix
> gcc version 4.7.2 20120920 [gcc-4_7-branch revision 191568] (SUSE Linux)
> libtool --version
> libtool (GNU libtool) 2.4.2
> Written by Gordon Matzigkeit <go...@gn...>, 1996
> Copyright (C) 2011 Free Software Foundation, Inc.
> This is free software; see the source for copying conditions. There is NO
> warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
> Reporter: msd
> Assignee: Breno Silva Pinto
>
> install PCRE ...
> svn co svn://vcs.exim.org/pcre/code/trunk pcre
> cd pcre
> echo -e $CFLAGS "\n" $CXXFLAGS
> -O2 -march=amdfam10 -mtune=amdfam10 -fPIC -DPIC -D_GNU_SOURCE -fno-strict-aliasing -Wall -fPIC -DPIC -D_GNU_SOURCE -fno-strict-aliasing
> -O2 -march=amdfam10 -mtune=amdfam10 -fPIC -DPIC -D_GNU_SOURCE -fno-strict-aliasing -Wall -fPIC -DPIC -D_GNU_SOURCE -fno-strict-aliasing
> sh autogen.sh
> ./configure --disable-static --enable-jit --with-link-size=2 --with-match-limit=10000000 --enable-utf --enable-unicode-properties --enable-newline-is-lf
> make
> make install
> /usr/local/bin/pcre-config --version
> 8.32-RC1
> pkg-config libpcre --libs --cflags
> -I/usr/local/include -L/usr/local/lib64 -lpcre
> ls -al /usr/local/lib64/libpcre*
> -rwxr-xr-x 1 root root 965 Oct 18 11:44 /usr/local/lib64/libpcrecpp.la*
> lrwxrwxrwx 1 root root 19 Oct 18 11:44 /usr/local/lib64/libpcrecpp.so -> libpcrecpp.so.0.0.0*
> lrwxrwxrwx 1 root root 19 Oct 18 11:44 /usr/local/lib64/libpcrecpp.so.0 -> libpcrecpp.so.0.0.0*
> -rwxr-xr-x 1 root root 46K Oct 18 11:44 /usr/local/lib64/libpcrecpp.so.0.0.0*
> -rwxr-xr-x 1 root root 919 Oct 18 11:44 /usr/local/lib64/libpcre.la*
> -rwxr-xr-x 1 root root 977 Oct 18 11:44 /usr/local/lib64/libpcreposix.la*
> lrwxrwxrwx 1 root root 21 Oct 18 11:44 /usr/local/lib64/libpcreposix.so -> libpcreposix.so.0.0.1*
> lrwxrwxrwx 1 root root 21 Oct 18 11:44 /usr/local/lib64/libpcreposix.so.0 -> libpcreposix.so.0.0.1*
> -rwxr-xr-x 1 root root 13K Oct 18 11:44 /usr/local/lib64/libpcreposix.so.0.0.1*
> lrwxrwxrwx 1 root root 16 Oct 18 11:44 /usr/local/lib64/libpcre.so -> libpcre.so.1.0.1*
> lrwxrwxrwx 1 root root 16 Oct 18 11:44 /usr/local/lib64/libpcre.so.1 -> libpcre.so.1.0.1*
> -rwxr-xr-x 1 root root 577K Oct 18 11:44 /usr/local/lib64/libpcre.so.1.0.1*
> install modsecurity ...
> ldd `which httpd` | grep pcre
> libpcre.so.1 => /usr/local/lib64/libpcre.so.1 (0x00007f6ad63a5000)
> tar zxvf modsecurity-apache_2.7.0.tar.gz
> cd modsecurity-apache_2.7.0
> unset LD_PRELOAD LD_LIBRARY_PATH
> echo -e $CFLAGS "\n" $CXXFLAGS "\n" $LDFLAGS
> -O2 -march=amdfam10 -mtune=amdfam10 -fPIC -DPIC -D_GNU_SOURCE -fno-strict-aliasing -Wall -fPIC -DPIC -D_GNU_SOURCE -fno-strict-aliasing
> -O2 -march=amdfam10 -mtune=amdfam10 -fPIC -DPIC -D_GNU_SOURCE -fno-strict-aliasing -Wall -fPIC -DPIC -D_GNU_SOURCE -fno-strict-aliasing
> -L/usr/local/ssl/lib64 -Wl,-rpath,/usr/local/ssl/lib64 -lssl -lcrypto
> ./configure \
> --enable-shared --disable-static \
> --enable-apache2-module \
> --with-apxs=/usr/local/apache24x/bin/apxs \
> --with-apr=/usr/local/apache24x/bin/apr-2-config \
> --with-apu=/usr/local/apache24x/bin/apr-2-config \
> --with-pcre=/usr/local \
> --enable-pcre-jit \
> --enable-pcre-study \
> --disable-pcre-match-limit \
> --disable-pcre-match-limit-recursion \
> --disable-docs \
> --enable-strict-compile=yes \
> --enable-errors \
> --enable-verbose-output \
> --with-lua=/usr/local
> make
> make install
> ldd /usr/local/apache24x/modules/mod_security2.so* | grep pcre
> libpcre.so.1 => /usr/lib64/libpcre.so.1 (0x00007fc9f2736000)
> that's INCORRECT based on the config options.
> It can be changed @ runtime,
> LD_LIBRARY_PATH="/usr/local/lib64" ldd /usr/local/apache24x/modules/mod_security2.so* | grep pcre
> libpcre.so.1 => /usr/local/lib64/libpcre.so.1 (0x00007f9a4c2d5000)
> but the path needs to be correctly set/embedded at compile time, not requiring -- or overridable by -- a user-defined ENV var.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
|