debian: simplify LTO configuration to work around newer libtool

Libtool 2.4.7 breaks if AR_FLAGS contains a space. See
https://lists.gnu.org/archive/html/bug-libtool/2022-03/msg00009.html

* debian/rules: Use gcc-{nm,ar,ranlib} so we do not have to pass
the plugin explicitly.
This commit is contained in:
Alexandre Duret-Lutz 2022-03-29 11:13:19 +02:00
parent 27d455389e
commit 5e1b751971

22
debian/rules vendored
View file

@ -20,20 +20,16 @@ include /usr/share/dpkg/default.mk
%:
dh $@ --with=python3
# Find the LTO plugin, which we need to pass to ar, nm, and ranlib.
LTOPLUG := $(shell gcc -v 2>&1 | \
sed -n 's:COLLECT_LTO_WRAPPER=\(/.*/\)[^/]*:\1:p')liblto_plugin.so
# ARFLAGS is for Automake
# AR_FLAGS is for Libtool
# These activate the LTO pluggin, but also remove the 'u' option
# from ar, since its now ignored with Debian's default to 'D'.
LTOSETUP = \
LDFLAGS='-fuse-linker-plugin' \
NM='nm --plugin $(LTOPLUG)' \
ARFLAGS='cr --plugin $(LTOPLUG)' \
AR_FLAGS='cr --plugin $(LTOPLUG)' \
RANLIB='ranlib --plugin $(LTOPLUG)' \
# AR_FLAGS is for Libtool, (but libtool 2.4.7 will now use ARFLAGS as well)
# The gcc-tools activate the LTO plugin.
LTOSETUP = \
LDFLAGS='-fuse-linker-plugin' \
NM='gcc-nm' \
AR='gcc-ar' \
ARFLAGS='cr' \
AR_FLAGS='cr' \
RANLIB='gcc-ranlib' \
VALGRIND=false
GCDADIR := $(shell pwd)/gcda