[DSE-Dev] Bug#1123905: libselinux FTBFS on x32: links without -fPIC

Helmut Grohne helmut at subdivi.de
Tue Dec 23 12:19:24 GMT 2025


Source: libselinux
Version: 3.9-4
Severity: important
Justification: build regression for essential package on non-release architecture
Tags: ftbfs upstream
X-Debbugs-Cc: debian-amd64 at lists.debian.org
User: debian-x32 at lists.debian.org
Usertags: x32
User: helmutg at debian.org
Usertags: rebootstrap

Since a while, libselinux fails linking on x32.

| x86_64-linux-gnux32-gcc -Wdate-time -D_FORTIFY_SOURCE=2 -D_LARGEFILE64_SOURCE -g -O2 -Werror=implicit-function-declaration -ffile-prefix-map=/build/reproducible-path/libselinux-3.9=. -flto=auto -ffat-lto-objects -specs=/usr/share/dpkg/pie-compile.specs -fstack-protector-strong -Wformat -Werror=format-security -fcf-protection -fno-semantic-interposition -Wall -Wextra -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I../include -D_GNU_SOURCE -DNO_ANDROID_BACKEND -DUSE_PCRE2 -DPCRE2_CODE_UNIT_WIDTH=8 -DHAVE_STRLCPY -DHAVE_REALLOCARRAY -flto=auto -ffat-lto-objects -specs=/usr/share/dpkg/pie-link.specs -Wl,-z,relro -Wl,-z,now -shared -o libselinux.so.1 avc.lo avc_internal.lo avc_sidtab.lo booleans.lo callbacks.lo canonicalize_context.lo checkAccess.lo check_context.lo checkreqprot.lo compute_av.lo compute_create.lo compute_member.lo compute_relabel.lo compute_user.lo context.lo deny_unknown.lo disable.lo enabled.lo fgetfilecon.lo freecon.lo freeconary.lo fsetfilecon.lo get_context_list.lo get_default_type.lo get_initial_context.lo getenforce.lo getfilecon.lo getpeercon.lo init.lo is_customizable_type.lo label.lo label_db.lo label_file.lo label_media.lo label_support.lo label_x.lo lgetfilecon.lo load_policy.lo lsetfilecon.lo mapping.lo matchmediacon.lo matchpathcon.lo policyvers.lo procattr.lo query_user_context.lo regex.lo reject_unknown.lo selinux_check_securetty_context.lo selinux_config.lo selinux_internal.lo selinux_restorecon.lo sestatus.lo setenforce.lo setexecfilecon.lo setfilecon.lo setrans_client.lo seusers.lo sha1.lo stringrep.lo validatetrans.lo -lpcre2-8   -ldl -Wl,-soname,libselinux.so.1,--version-script=libselinux.map,-z,defs,-z,relro
| /usr/bin/ld: /tmp/cclRaeek.ltrans0.ltrans.o: relocation R_X86_64_TPOFF32 against hidden symbol `prev_current.lto_priv.0' can not be used when making a shared object
| /usr/bin/ld: failed to set dynamic section sizes: bad value
| collect2: error: ld returned 1 exit status
| make[3]: *** [Makefile:171: libselinux.so.1] Error 1
| make[3]: Leaving directory '/build/reproducible-path/libselinux-3.9/src'
| make[2]: *** [Makefile:54: all] Error 1
| make[2]: Leaving directory '/build/reproducible-path/libselinux-3.9'
| make[1]: *** [debian/rules:46: build-all] Error 2
| make[1]: Leaving directory '/build/reproducible-path/libselinux-3.9'
| make: *** [debian/rules:37: binary-arch] Error 2

Since LTO is being used, code can be generated at the linking stage.
Unless passing -fPIC, this code is not position-independent as is
required for shared libraries. This happens to work on most
architectures but x32 by chance. The -fPIC flag really needs to passed
to the linker as well. It might also fix sh4 and it seems likely to also
fix m68k.

Patch attached.

Helmut
-------------- next part --------------
A non-text attachment was scrubbed...
Name: x32.patch
Type: text/x-diff
Size: 751 bytes
Desc: not available
URL: <http://alioth-lists.debian.net/pipermail/selinux-devel/attachments/20251223/a0f5c71f/attachment.patch>


More information about the SELinux-devel mailing list