Your message dated Mon, 8 Feb 2021 18:51:32 +0100
with message-id <[email protected]>
and subject line Re: Bug#862002: apt-cacher-ng: Please link against libatomic 
with --as-needed
has caused the Debian Bug report #862002,
regarding apt-cacher-ng: Please link against libatomic with --as-needed
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)


-- 
862002: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=862002
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Source: apt-cacher-ng
Version: 3-5
Severity: normal
Tags: patch
User: [email protected]
Usertags: m68k

Hello!

Currently, apt-cacher-ng fails to build from source on m68k,
powerpc, powerpcspe and sh4 because it's missing '-latomic'
from the linker options. This happens because the current
approach for passing -latomic is done based on a white-list
basis which is not the optimal approach:

# libatomic provides 8-bytes atomic operation for 32-bit MIPS
ifneq (,$(filter $(DEB_HOST_ARCH), mips mipsel))
 EXTRA_LIBS="-DEXTRA_LIBS_ACNG=-latomic"
endif

It's rather better to just use "--as-needed" and let the linker
decided whether -latomic is needed. This way, it's not longer
necessary to maintain a whitelist and adjust it for future
architectures:

EXTRA_LIBS="-DEXTRA_LIBS_ACNG=-Wl,--as-needed -latomic"

With the attached patch, apt-cacher-ng builds fine on all
affected architectures, including mips and mipsel.

Thanks,
Adrian

--
 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer - [email protected]
`. `'   Freie Universitaet Berlin - [email protected]
  `-    GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913
diff -Nru apt-cacher-ng-3/debian/changelog apt-cacher-ng-3/debian/changelog
--- apt-cacher-ng-3/debian/changelog    2017-04-27 20:12:02.000000000 +0200
+++ apt-cacher-ng-3/debian/changelog    2017-05-07 11:30:17.000000000 +0200
@@ -1,3 +1,11 @@
+apt-cacher-ng (3-5.1) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * Pass -latomic with --as-needed to linker options instead
+    of white-listing separate architectures (closes: #NNNNNN)
+
+ -- John Paul Adrian Glaubitz <[email protected]>  Sun, 07 May 2017 
11:30:17 +0200
+
 apt-cacher-ng (3-5) unstable; urgency=low
 
   * Moving RequiresMountsFor to Unit section (closes: #859520)
diff -Nru apt-cacher-ng-3/debian/rules apt-cacher-ng-3/debian/rules
--- apt-cacher-ng-3/debian/rules        2017-04-27 20:12:02.000000000 +0200
+++ apt-cacher-ng-3/debian/rules        2017-05-07 11:29:49.000000000 +0200
@@ -13,10 +13,7 @@
 
 DEB_HOST_ARCH ?= $(shell dpkg-architecture -qDEB_HOST_ARCH)
 
-# libatomic provides 8-bytes atomic operation for 32-bit MIPS
-ifneq (,$(filter $(DEB_HOST_ARCH), mips mipsel))
- EXTRA_LIBS="-DEXTRA_LIBS_ACNG=-latomic"
-endif
+EXTRA_LIBS="-DEXTRA_LIBS_ACNG=-Wl,-latomic"
 
 %:
        dh $@ --parallel --with systemd

--- End Message ---
--- Begin Message ---
Version: 3.5-3

> And the new scheme has been working for a while and broke again now, and
> because of the remains of the mentioned workaround the issue was not
> spotted immediately.
>
> The check code is:
>
> FIND_LIBRARY(HAVE_ATOMICLIB atomic) # needed for global atomic vars on some 
> 32bit architectures
> if(HAVE_ATOMICLIB)
>         MESSAGE("-- Found libatomic development files, will link libatomic")
>         LIST(APPEND BaseNetworkLibs atomic)
> endif()

Forgotten to close this, the Testing version should be fine.

Best regards,
Eduard.

--- End Message ---

Reply via email to