Package: python3-distutils
Version: 3.9.12-1
Severity: important

Hello,

When trying to build matplotlib (that uses hardening +pie) on x32,
-specs=/usr/share/dpkg/pie-compile.specs ends up being added to the
flags passed to the linker. This breaks the build with:

x86_64-linux-gnux32-g++ -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions 
-specs=/usr/share/dpkg/pie-link.specs -Wl,-z,relro -Wl,-z,now -g -O2 
-ffile-prefix-map=/tmp/matplotlib-3.5.1=. 
-specs=/usr/share/dpkg/pie-compile.specs -fstack-protector-strong -Wformat 
-Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 
build/temp.linux-x86_64-3.9/matplotlib.backends._backend_agg/extern/agg24-svn/src/agg_bezier_arc.o
 
build/temp.linux-x86_64-3.9/matplotlib.backends._backend_agg/extern/agg24-svn/src/agg_curves.o
 
build/temp.linux-x86_64-3.9/matplotlib.backends._backend_agg/extern/agg24-svn/src/agg_image_filters.o
 
build/temp.linux-x86_64-3.9/matplotlib.backends._backend_agg/extern/agg24-svn/src/agg_trans_affine.o
 
build/temp.linux-x86_64-3.9/matplotlib.backends._backend_agg/extern/agg24-svn/src/agg_vcgen_contour.o
 
build/temp.linux-x86_64-3.9/matplotlib.backends._backend_agg/extern/agg24-svn/src/agg_vcgen_dash.o
 
build/temp.linux-x86_64-3.9/matplotlib.backends._backend_agg/extern/agg24-svn/src/agg_vcgen_stroke.o
 
build/temp.linux-x86_64-3.9/matplotlib.backends._backend_agg/extern/agg24-svn/src/agg_vpgen_segmentator.o
 
build/temp.linux-x86_64-3.9/matplotlib.backends._backend_agg/src/_backend_agg.o 
build/temp.linux-x86_64-3.9/matplotlib.backends._backend_agg/src/_backend_agg_wrapper.o
 
build/temp.linux-x86_64-3.9/matplotlib.backends._backend_agg/src/checkdep_freetype2.o
 
build/temp.linux-x86_64-3.9/matplotlib.backends._backend_agg/src/py_converters.o
 -o 
build/lib.linux-x86_64-3.9/matplotlib/backends/_backend_agg.cpython-39-x86_64-linux-gnux32.so
 -lfreetype
/usr/bin/ld: /tmp/cc7JfqHN.ltrans3.ltrans.o: warning: relocation against 
`PyExc_ValueError' in read-only section `.text'
/usr/bin/ld: /tmp/cc7JfqHN.ltrans0.ltrans.o: relocation R_X86_64_PC32 against 
undefined symbol `_Py_NoneStruct' can not be used when making a shared object; 
recompile with -fPIC
/usr/bin/ld: final link failed: bad value
collect2: error: ld returned 1 exit status

Looking in distutils code (/usr/lib/python3.9/distutils/sysconfig.py) it
seems that the CFLAGS and CPPFLAGS are leaking in the flags passed to
the linkers (LDFLAGS/LDSHARED)

Is that expected?

Kind regards,
Laurent Bigonville


-- System Information:
Debian Release: bookworm/sid
  APT prefers unstable-debug
  APT policy: (500, 'unstable-debug'), (500, 'unstable'), (1, 
'experimental-debug'), (1, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 5.17.0-3-amd64 (SMP w/8 CPU threads; PREEMPT)
Locale: LANG=fr_BE.UTF-8, LC_CTYPE=fr_BE.UTF-8 (charmap=UTF-8), 
LANGUAGE=fr_BE:fr
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: SELinux: enabled - Mode: Permissive - Policy name: refpolicy

Versions of packages python3-distutils depends on:
ii  python3          3.10.4-1+b1
ii  python3-lib2to3  3.9.12-1

python3-distutils recommends no packages.

python3-distutils suggests no packages.

-- no debconf information

Reply via email to