Package: python3-dev
Version: 3.7.3-1
Severity: important
Dear Maintainer,
Compilation fails on Debian when relying on `python3-config`. The reason is
that `python3-config --cflags` returns the custom debian `-specs=...` thing,
but `python3-config --ldflags` doesn't:
% python3-config --cflags
-I/usr/include/python3.7m -I/usr/include/python3.7m -Wno-unused-result
-Wsign-compare -g -fdebug-prefix-map=/build/python3.7-3.7.3=.
-specs=/usr/share/dpkg/no-pie-compile.specs -fstack-protector -Wformat
-Werror=format-security -DNDEBUG -g -fwrapv -O3 -Wall
% python3-config --ldflags
-L/usr/lib/python3.7/config-3.7m-x86_64-linux-gnu -L/usr/lib -lpython3.7m
-lcrypt -lpthread -ldl -lutil -lm -Xlinker -export-dynamic -Wl,-O1
-Wl,-Bsymbolic-functions
On Debian side, it was decided to have the following injected:
- CFLAGS="-specs=/usr/share/dpkg/no-pie-compile.specs"
- LDFLAGS="-specs=/usr/share/dpkg/no-pie-link.specs"
And unfortunately, the former can not go without the latter: otherwise there is
a link error:
This -fPIE is a workaround for the following link issue:
relocation R_X86_64_32 against `.rodata.str1.8' can not be used
when making a PIE object; recompile with -fPIE
Note: the `python3-config --ldflags` is a superset of `python3-config --libs`
(the latter only returns the libraries but never the flags such as `-L` so it's
pretty much useless) and is the actual equivalent of `pkg-config --libs`.
On Python side, `python3-config` is a script generated from a template using a
global `CFLAGS`. But at the same time, the script uses `LIBS` and `SYSLIBS` to
construct the `LDFLAGS` (and not `LDFLAGS` for some moronic reason).
Regards,
-- System Information:
Debian Release: 10.3
APT prefers stable
APT policy: (500, 'stable')
Architecture: amd64 (x86_64)
Kernel: Linux 4.19.0-8-amd64 (SMP w/2 CPU cores)
Kernel taint flags: TAINT_CRAP
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8),
LANGUAGE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled
Versions of packages python3-dev depends on:
ii dh-python 3.20190308
ii libpython3-dev 3.7.3-1
ii python3 3.7.3-1
ii python3-distutils 3.7.3-1
ii python3.7-dev 3.7.3-2+deb10u1
python3-dev recommends no packages.
python3-dev suggests no packages.
-- no debconf information