When building some of the open source applications like MySQL Cluster Carrier Grade Edition with the GCC compiler, the linking step may fail with the fatal error message
library -lgcc_s: not found
despite the fact that the gcc_s library is available on the system and is in the linker search path -- for example,
on Solaris.Quick Fix / Workaround:
- Add the absolute path to the gcc_s library on the link line, OR
- (Recommended) If the library's filename has any major and minor version numbers appended to it, simply create a soft link to the library in the same location without the major and minor version numbers in the target filename.
On a Solaris 10 system, by default, the gcc_s library might be available under
(32-bit SPARC and x86 copy),
(64-bit SPARC copy) and
(64-bit x64 copy). If all you can find is the gcc_s library with the version number(s) in the filename like libgcc_s.so.1, simply run the command '
ln -s libgcc_s.so.1 libgcc_s.so
' in the same directory where you found the libgcc_s.so.1.Note:
Probably this particular error message may show up on any OS platform with any compiler, and the workaround mentioned in this post may work on all those failed cases. I cannot guarantee that, but I know for sure that it works on Solaris (both SPARC and x86/x64 versions).