Bug 58285 - Atomics missing - undefined symbol __sync_sub_and_fetch_4
Summary: Atomics missing - undefined symbol __sync_sub_and_fetch_4
Status: RESOLVED FIXED
Alias: None
Product: Tomcat Connectors
Classification: Unclassified
Component: Common (show other bugs)
Version: 1.2.41
Hardware: All All
: P2 normal with 10 votes (vote)
Target Milestone: ---
Assignee: Tomcat Developers Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-08-26 18:06 UTC by Rainer Jung
Modified: 2015-08-26 18:27 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Rainer Jung 2015-08-26 18:06:13 UTC
Connectors 1.2.41 introduced the use of atomics. When using GCC 4.1 or newer, support for atomics is assumed, but actually on some platforms not available. For platforms where gcc does not support atomics, it compiles in a function call to e.g. __sync_add_and_fetch_4() and trying to load mod_jk.so results in an undefined symbol error for __sync_add_and_fetch_4.

This should not happen on the Windows platform, where we use another atomics implementation. It should also not happen for AMD 64 processors, because GCC 4.1 and later implement atomics for them.

It does happen in x86 32 Bit processors at least for old GCC and also on Solaris Sparc for GCC 4.1.2 (not for 4.2.4 and later).

This will be fixed by using a configure auto-detection for atomics support. If support is not detected, and we are not on WIN32, we fall back to APR provided atomics. If APR is not available, we fall back to non-atomic increment/decrement plus a startup warning.
Comment 1 Rainer Jung 2015-08-26 18:11:58 UTC
Fixed by adding a configure test in r1697985.
Will be part of version 1.2.42.
Comment 2 Rainer Jung 2015-08-26 18:27:00 UTC
For the sake of completeness: this regression was introduced by the fix to 	BZ 44454 and BZ 56703.