09.07.2023 10:05, Michael Tokarev wrote:
...
Now after thought about all this in the morning, I think the following should
do it:
diff --git a/debian/changelog b/debian/changelog
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,11 @@
+samba (2:4.17.9+dfsg-0+deb12u2) bookworm; urgency=medium
+
+ * link with -latomic explicitly on a few architectures where gcc misses it
+ (notable armel & mipsel), to fix FTBFS there, - the same as on sid.
+ https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81358
+
+ -- Michael Tokarev <m...@tls.msk.ru> Sun, 09 Jul 2023 09:44:29 +0300
+
samba (2:4.17.9+dfsg-0+deb12u1) bookworm-proposed-updates; urgency=medium
* d/copyright: filter out autogenerated manpages from the upstream source
diff --git a/debian/rules b/debian/rules
--- a/debian/rules
+++ b/debian/rules
@@ -103,6 +103,20 @@ with-ceph =
with-glusterfs =
endif
+ifneq (,$(filter armel mipsel m68k powerpc sh4,${DEB_HOST_ARCH}))
+# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81358
+# on these platforms gcc does not link with -latomic, resulting in
+# third_party/heimdal/lib/krb5/krcache.c.55.o: in function
`krcc_get_principal':
+# third_party/heimdal/lib/krb5/krcache.c:1395: undefined reference to
`__atomic_load_8'
+# ids.krcu_cache_and_princ_id =
heim_base_atomic_load(&data->krc_cache_and_principal_id);
+# third_party/heimdal/lib/base/heimbase-atomics.h:
+# #include <stdatomic.h>
+# #define heim_base_atomic_load(x) atomic_load((x))
+# include a workaround for now
+# (-latomic and <stdatomic.h> comes from gcc, --as-needed is already in use)
+LDFLAGS := ${LDFLAGS} -latomic
+endif
+
config-args += $(if ${with-ceph},\
--enable-cephfs --enable-ceph-reclock,\
--disable-cephfs)
(this is the same changes as on sid, *plus* a bit more, which updates the
comment
with the gcc bug reference and drops -Wl,--no-as-needed, - since this one is
already
enabled).
So I built this on armel and mipsel (and on amd64 too) and verified it works
fine.
Uploading the fixed package (with the above diff from -0+deb12u1) now, feel
free to
accept it as the fix for the previous broken upload.
Thank you for your time!
/mjt