Am 25.08.2015 um 14:58 schrieb Falco Schwarz:
Hi there,

I tried to update the connectors to the most recent update but I am stuck
with error messages. Just a few background information on the
infrastructure used:

httpd: 2.2.31
OpenSSL: 1.0.2.d
mod_jk: 1.2.41

Kernel: 3.0.101-0.47.52-pae
OS: SLES 11 SP3 (32bit)
gcc: (SUSE Linux) 4.3.4 [gcc-4_3-branch revision 152973]

httpd configure: ./configure --prefix=/opt/apache
--sysconfdir=/opt/apache/build --enable-mods-shared="all ssl ldap cache
proxy authn_alias authnz_ldap dav_lock" --with-mpm=prefork
--with-included-apr --with-pcre --with-ldap --with-ssl=/opt/apache/openssl

jk configure: ./configure --with-apxs=/opt/apache/bin/apxs

configure, make and install runs without any errors. If I try to startup
httpd though the following error occurs:

httpd: Syntax error on line 88 of /opt/apache/conf/alles/httpd.conf: Cannot
load /opt/apache/modules/mod_jk.so into server:
/opt/apache/modules/mod_jk.so: undefined symbol: __sync_add_and_fetch_4

When I added the use of atomics, I checked for the minimal GCC version to support it. At that time I didn't notice, that GCC originally had only support for some architectures, and for all other architectures compiles in a call to a function named __sync_add_and_fetch_4(), which it does not implement itself.

There's a couple of options:

- use a newer GCC, it might support x86 atomics. But I guess you'd like to stick to your SLES provided GCC, so this probably is not an option for you.

- As a workaround fall back to what APR provides as atomics. In file common/jk_global.h you could comment out the following lines with a leading "//":

436 #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 1))
437 #define JK_ATOMIC_INCREMENT(x) __sync_add_and_fetch(x, 1)
438 #define JK_ATOMIC_DECREMENT(x) \
439     do {\
440         if (__sync_sub_and_fetch(x, 1) < 0) __sync_add_and_fetch(x, 1);\
441     } while (0)

or simply change the #elif line 436 e.g. to

#elif defined(JK_USE_GCC_ATOMICS) && defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 1))


Since JK_USE_GCC_ATOMICS is not defined, the elif will be skipped and the next option (APR atomics) will be used, but you can later switch back to the GCC version by compiling with -DJK_USE_GCC_ATOMICS. We might add something like this and make the define be chosen according to configure flags (--disable-gcc-atomics). Or maybe we should even use a configure check to detect real support for GCC atomics on the target platform.

Let us know how it works.

Thanks for reporting the problem,

Rainer

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to