[squid-users] Different squid-3.5.2 compile error on OpenBSD 5.6

Amos Jeffries squid3 at treenet.co.nz
Fri Feb 27 12:34:21 UTC 2015


On 27/02/2015 8:03 a.m., Alan Palmer wrote:
> While waiting with baited breath for --with-libressl support, I
> installed openssl-1.02 on openbsd-5.6 to
> get squid to compile, but got this error in the final linking:
> 
> MemStore.o(.text+0x4fe0): In function
> `MemStore::copyFromShm(StoreEntry&, int, Ipc::StoreMapAnchor const&)':
> : undefined reference to `__sync_fetch_and_add_8'
> MemStore.o(.text+0x5197): more undefined references to
> `__sync_fetch_and_add_8' follow
> 
> Now this is a bit odd because, from the config.log:
> 
> configure:20105: inlining optimizations enabled: yes
> configure:20124: checking for GNU atomic operations support
> configure:20151: c++ -o conftest -O2 -pipe -I/usr/local/include
> -L/usr/local/lib
>  conftest.cpp  >&5
> configure:20151: $? = 0
> configure:20151: ./conftest
> configure:20151: $? = 0
> configure:20156: result: yes
> 
> now configure only checks for __sync_fetch_and_add not
> __sync_fetch_and_add_8.

Because Squid does not use __sync_fetch_and_add_8. It uses
__sync_fetch_and_add()

The OS is itelf defining __sync_fetch_and_add() in terms of
__sync_fetch_and_add_8 but then not providing the operator it depends on.

> 
> The issue, I believe, is libc++ hasnt been ported to openbsd so it uses
> libstdc++
> 
> the compiler in question:
> [apalmer]:/data/src/squid-3.5.2# g++ -v
> Reading specs from /usr/lib/gcc-lib/i386-unknown-openbsd5.6/4.2.1/specs
> Target: i386-unknown-openbsd5.6
> Configured with: OpenBSD/i386 system compiler
> Thread model: posix
> gcc version 4.2.1 20070719
> 
> soooooo, manually editing autoconf.h to:
> #define HAVE_ATOMIC_OPS 0
> 
> Is there a more graceful way to deal with this?


Perhapse building with Clang instead of the old GCC.

The recent BSD operating systems have all given up on GCC due to GPLv3
compatibility issues.

Amos


More information about the squid-users mailing list