Bug#907106: squid FTBFS on armel/mips/mipsel: undefined reference to `__atomic_store_8'

2018-08-23 Thread Amos Jeffries
Accepting this for next upload. BUT,

... is there any info known about why these platforms suddenly need the
-latomic flag to be hard-coded by the packaging?

Squid configure script auto-detects this symbols existence. It has for
some time on both working and non-working buildd's had the same results
and linker lines which are now suddenly FTBFS. See the working 4.1
upload for reference.

Amos



Bug#907106: squid FTBFS on armel/mips/mipsel: undefined reference to `__atomic_store_8'

2018-08-23 Thread Adrian Bunk
Source: squid
Version: 4.2-1
Severity: serious
Tags: ftbfs

https://buildd.debian.org/status/package.php?p=squid=sid

...
/usr/include/c++/8/bits/atomic_base.h:374: undefined reference to 
`__atomic_store_8'
/usr/bin/ld: MemStore.o: in function 
`MemStore::updateHeadersOrThrow(Ipc::StoreMapUpdate&)':
/usr/include/c++/8/bits/atomic_base.h:396: undefined reference to 
`__atomic_load_8'
/usr/bin/ld: /usr/include/c++/8/bits/atomic_base.h:396: undefined reference to 
`__atomic_load_8'
/usr/bin/ld: /usr/include/c++/8/bits/atomic_base.h:396: undefined reference to 
`__atomic_load_8'
/usr/bin/ld: /usr/include/c++/8/bits/atomic_base.h:320: undefined reference to 
`__atomic_fetch_sub_8'
/usr/bin/ld: /usr/include/c++/8/bits/atomic_base.h:312: undefined reference to 
`__atomic_fetch_add_8'
...


Background:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81358


Workaround:

--- debian/rules.old2018-08-23 17:57:11.107166113 +
+++ debian/rules2018-08-23 17:58:15.251499522 +
@@ -2,7 +2,13 @@
 
 export DEB_BUILD_MAINT_OPTIONS = hardening=+all
 export DEB_CFLAGS_MAINT_APPEND = -Wall
-export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed
+
+DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed
+ifneq (,$(filter $(DEB_HOST_ARCH), armel m68k mips mipsel powerpc powerpcspe 
sh4))
+export DEB_LDFLAGS_MAINT_APPEND += -latomic
+endif
+export DEB_LDFLAGS_MAINT_APPEND
+
 export DEB_BUILD_PARALLEL = yes
 include /usr/share/dpkg/buildflags.mk