0

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.

1 Answer 1

0

OK. Solved for real. Turns out nothing in httpd nor the extras I'm adding to it actually require libpcrecpp so I was able to just add --disable-cpp and skip building it entirely. If I ever need to build something that requires C++ support I'll need to actually figure this out, but for now I'm just not building the library in question and all is well.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .