I'm building a custom version of Apache HTTPD with a whole slew of extra modules. As part of this, I'm linking against PCRE 8.44, which is working fine. However, lib/libpcrecpp.so.0.0.2
has a dependency showing for libgcc_s.so.1 via /usr/bin/env -i ldd
.
I do not want to have gcc installed on production servers, especially not extranet production servers. I cannot seem to find any combination of flags that will build a PCRE that does not link to libgcc. I'm fairly certain that disabling C++ support would do it, but that's hardly optimal and I haven't actually tried it.
Is there a way to build PCRE such that it doesn't link to gcc?
Current settings are:
LDFLAGS=-Wl,-rpath,${PREFIX}/lib -Wl,-rpath,${PREFIX}/lib64 -L${PREFIX}/lib -L${PREFIX}/lib64
CFLAGS=-Wl,-rpath,${PREFIX}/lib -Wl,-rpath,${PREFIX}/lib64 -I${PREFIX}/include
CPPFLAGS=${CFLAGS}
export LDFLAGS CFLAGS CPPFLAGS PREFIX
./configure \
--prefix="${PREFIX}" \
--enable-pcre16 \
--enable-pcre32 \
--enable-jit \
--enable-utf \
&& make \
&& make install
(If folks have suggestions for better configuration options I'm listening.)
UPDATE: It appears that turning off shared libraries for pcre works. Testing is required to ensure that everything worked correctly, but I think I've got a statically linked pcre baked in where needed, which is acceptable to me. If anyone has ideas on how to build shared libraries without linking to gcc I would love to hear it, though.
UPDATE 2: Looks like mod_security does not want to build using httpd's built-in pcre, so I'm back to stuck.