Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 905711 - sys-libs/libselinux-3.5 does not build on musl-1.2.4: selinux_restorecon.c:440:23: error: storage size of 'sb' isn't known
Summary: sys-libs/libselinux-3.5 does not build on musl-1.2.4: selinux_restorecon.c:44...
Status: CONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 Linux
: Normal major (vote)
Assignee: SE Linux Bugs
URL:
Whiteboard:
Keywords:
: 908440 912310 (view as bug list)
Depends on:
Blocks: musl-1.2.4
  Show dependency tree
 
Reported: 2023-05-04 19:27 UTC by Nikita Romaniuk
Modified: 2024-04-28 11:17 UTC (History)
4 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
build log (build.log,17.09 KB, patch)
2023-05-04 19:27 UTC, Nikita Romaniuk
Details | Diff
musl patch (0001-libselinux-musl.patch,381 bytes, patch)
2023-05-04 19:29 UTC, Nikita Romaniuk
Details | Diff
build log (build.log,17.09 KB, text/plain)
2023-05-04 19:29 UTC, Nikita Romaniuk
Details
libselinux-3.5-r1.ebuild patch including a patch for musl based builds (libselinux-3.5-r1.ebuild.patch,329 bytes, patch)
2024-02-17 16:27 UTC, rajas
Details | Diff
libselinux-3.5-musl-lfs.patch (libselinux-3.5-musl-lfs.patch,703 bytes, patch)
2024-02-17 16:28 UTC, rajas
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Nikita Romaniuk 2023-05-04 19:27:16 UTC
_GNU_SOURCE does not enable stat64, etc now.

https://git.musl-libc.org/cgit/musl/commit/include/sys/stat.h?id=25e6fee27f4a293728dd15b659170e7b9c7db9bc

Reproducible: Always

Steps to Reproduce:
1. Emerge sys-libs/libselinux-3.5



Portage 3.0.47 (python 3.11.3-final-0, default/linux/amd64/17.0/musl/hardened/selinux, gcc-13, musl-1.2.4, 6.3.0-gentoo-kelvium-musl x86_64)
=================================================================
System uname: Linux-6.3.0-gentoo-kelvium-musl-x86_64-Intel-R-_Xeon-R-_CPU_E5-2650_v3_@_2.30GHz-with-libc
KiB Mem:    16241720 total,  11983268 free
KiB Swap:    4194300 total,   3799668 free
Timestamp of repository gentoo: Wed, 03 May 2023 17:45:01 +0000
Head commit of repository gentoo: 22e74d138e3432ce4ec4b1efec418674ec094ef9
Timestamp of repository guru: Tue, 02 May 2023 19:18:31 +0000
Head commit of repository guru: 55fe2a42ee748779ee27d5ddc92fd5e0fb2b3ab3

Timestamp of repository musl: Mon, 01 May 2023 13:50:20 +0000
Head commit of repository musl: a9f3d0405cf9a479a29bcd22b7763b93aa2bf17d

Head commit of repository polymc: f219527ba3c921fc82605105be9d09272c773e2a

sh bash 5.2_p15-r2
ld GNU ld (Gentoo 2.40 p4) 2.40.0
ccache version 4.8 [disabled]
app-misc/pax-utils:        1.3.7::gentoo
app-shells/bash:           5.2_p15-r2::gentoo
dev-java/java-config:      2.3.1::gentoo
dev-lang/perl:             5.36.1-r1::gentoo
dev-lang/python:           3.8.16_p4::gentoo, 3.10.11::gentoo, 3.11.3::gentoo
dev-lang/rust:             1.69.0-r1::gentoo
dev-lang/rust-bin:         1.69.0::gentoo
dev-util/ccache:           4.8::gentoo
dev-util/cmake:            3.26.3::gentoo
dev-util/meson:            1.1.0::gentoo
sec-policy/selinux-base:   2.20221101-r4::gentoo
sys-apps/baselayout:       2.13-r1::gentoo
sys-apps/openrc:           0.47.1::gentoo
sys-apps/sandbox:          2.30-r1::gentoo
sys-devel/autoconf:        2.13-r8::gentoo, 2.71-r6::gentoo
sys-devel/automake:        1.16.5-r1::gentoo
sys-devel/binutils:        2.40-r4::gentoo
sys-devel/binutils-config: 5.5::gentoo
sys-devel/clang:           15.0.7-r1::gentoo, 16.0.3::gentoo
sys-devel/gcc:             13.1.0-r1::gentoo
sys-devel/gcc-config:      2.10::gentoo
sys-devel/libtool:         2.4.7-r1::gentoo
sys-devel/lld:             16.0.3::gentoo
sys-devel/llvm:            15.0.7::gentoo, 16.0.3::gentoo
sys-devel/make:            4.4.1::gentoo
sys-kernel/linux-headers:  6.3::gentoo (virtual/os-headers)
sys-libs/libselinux:       3.5::gentoo
sys-libs/musl:             1.2.4::gentoo
Repositories:

gentoo
    location: /var/db/repos/gentoo
    sync-type: rsync
    sync-uri: rsync://rsync.ru.gentoo.org/gentoo-portage
    priority: -1000
    volatile: False
    sync-rsync-verify-metamanifest: yes
    sync-rsync-verify-jobs: 1
    sync-rsync-extra-opts: 
    sync-rsync-verify-max-age: 24

guru
    location: /var/db/repos/guru
    sync-type: git
    sync-uri: https://github.com/gentoo-mirror/guru.git
    masters: gentoo
    volatile: False

kelvium
    location: /home/kelvium/src/gentoo-overlay
    masters: gentoo
    volatile: True

musl
    location: /var/db/repos/musl
    sync-type: git
    sync-uri: https://github.com/gentoo-mirror/musl.git
    masters: gentoo
    volatile: False

polymc
    location: /var/db/repos/polymc
    sync-type: git
    sync-uri: https://git.swurl.xyz/PolyMC/overlay.git
    masters: gentoo
    volatile: True

Installed sets: @vulkan
ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="@FREE"
CBUILD="x86_64-gentoo-linux-musl"
CFLAGS="-march=haswell -O2 -pipe"
CHOST="x86_64-gentoo-linux-musl"
CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-march=haswell -O2 -pipe"
DISTDIR="/var/cache/distfiles"
ENV_UNSET="CARGO_HOME DBUS_SESSION_BUS_ADDRESS DISPLAY GDK_PIXBUF_MODULE_FILE GOBIN GOPATH PERL5LIB PERL5OPT PERLPREFIX PERL_CORE PERL_MB_OPT PERL_MM_OPT XAUTHORITY XDG_CACHE_HOME XDG_CONFIG_HOME XDG_DATA_HOME XDG_RUNTIME_DIR XDG_STATE_HOME"
FCFLAGS="-march=haswell -O2 -pipe"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs binpkg-multi-instance buildpkg-live config-protect-if-modified distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync network-sandbox news parallel-fetch preserve-libs protect-owned qa-unresolved-soname-deps sandbox selinux sesandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-march=haswell -O2 -pipe"
GENTOO_MIRRORS="https://mirror.yandex.ru/gentoo-distfiles/"
INSTALL_MASK="charset.alias /usr/share/locale/locale.alias"
LANG="C.UTF8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
LEX="flex"
MAKEOPTS="-j18"
PKGDIR="/var/cache/binpkgs"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --exclude=/.git"
PORTAGE_TMPDIR="/var/tmp"
RUSTFLAGS="-C target-cpu=haswell -C opt-level=2"
SHELL="/usr/local/bin/dinitsh"
USE="X acl alsa amd64 audit bzip2 caps cet cli crypt dbus dri egl fortran hardened iconv ipv6 libglvnd libtirpc ncurses nls nptl opengl openmp pam pcre peer_perms pie pipewire readline screencast seatd seccomp selinux split-usr ssl ssp test-rust ubac udev unconfined unicode vaapi vdpau vulkan wayland xattr xtpax zeroconf zlib" ABI_X86="64" ADA_TARGET="gnat_2021" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="karbon sheets words" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="aes avx avx2 f16c fma3 mmx mmxext pclmul popcnt rdrand sse sse2 sse3 sse4_1 sse4_2 ssse3" ELIBC="musl" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock greis isync itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 timing tsip tripmate tnt ublox ubx" INPUT_DEVICES="libinput" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LUA_SINGLE_TARGET="lua5-1" LUA_TARGETS="lua5-1" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php7-4 php8-0" POSTGRES_TARGETS="postgres12 postgres13" PYTHON_SINGLE_TARGET="python3_11" PYTHON_TARGETS="python3_11" QEMU_SOFTMMU_TARGETS="x86_64" RUBY_TARGETS="ruby30" USERLAND="GNU" VIDEO_CARDS="nouveau" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq proto steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  ADDR2LINE, AR, ARFLAGS, AS, ASFLAGS, CC, CCLD, CONFIG_SHELL, CPP, CPPFLAGS, CTARGET, CXX, CXXFILT, ELFEDIT, EMERGE_DEFAULT_OPTS, EXTRA_ECONF, F77FLAGS, FC, GCOV, GPROF, LC_ALL, LD, LFLAGS, LIBTOOL, LINGUAS, MAKE, MAKEFLAGS, NM, OBJCOPY, OBJDUMP, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, RANLIB, READELF, SIZE, STRINGS, STRIP, YACC, YFLAGS
Comment 1 Nikita Romaniuk 2023-05-04 19:27:52 UTC
Created attachment 861140 [details, diff]
build log
Comment 2 Nikita Romaniuk 2023-05-04 19:28:59 UTC
Selected "patch" option on the wrong attachment...
Comment 3 Nikita Romaniuk 2023-05-04 19:29:26 UTC
Created attachment 861141 [details, diff]
musl patch
Comment 4 Nikita Romaniuk 2023-05-04 19:29:52 UTC
Created attachment 861142 [details]
build log
Comment 5 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-05-04 22:46:56 UTC
(In reply to Nikita Romanyuk from comment #3)
> Created attachment 861141 [details, diff] [details, diff]
> musl patch

See my explanation in bug 903611.
Comment 6 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-06-13 12:19:30 UTC
*** Bug 908440 has been marked as a duplicate of this bug. ***
Comment 7 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-12-08 12:01:09 UTC
*** Bug 912310 has been marked as a duplicate of this bug. ***
Comment 8 rajas 2024-02-17 16:23:42 UTC
My suggestion was to to just use the regular functions and not anything _LARGEFILE64_SOURCE as explained in bug 903611.
Comment 9 rajas 2024-02-17 16:27:30 UTC
Created attachment 885227 [details, diff]
libselinux-3.5-r1.ebuild patch including a patch for musl based builds
Comment 10 rajas 2024-02-17 16:28:35 UTC
Created attachment 885228 [details, diff]
libselinux-3.5-musl-lfs.patch
Comment 11 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-02-17 16:33:46 UTC
We try to avoid conditional patching, see https://devmanual.gentoo.org/ebuild-writing/misc-files/patches/index.html#conditional-patching.

The patch should be fine to apply unconditionally as long as _FILE_OFFSET_BITS is passed for glibc. The main way of doing that is AC_SYS_LARGEFILE in configure.ac.
Comment 12 Larry the Git Cow gentoo-dev 2024-03-04 19:10:29 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=de09050c4aac94f373b6e2354990bbc6566ac01c

commit de09050c4aac94f373b6e2354990bbc6566ac01c
Author:     Andreas K. Hüttel <dilfridge@gentoo.org>
AuthorDate: 2024-03-04 19:09:55 +0000
Commit:     Andreas K. Hüttel <dilfridge@gentoo.org>
CommitDate: 2024-03-04 19:09:55 +0000

    sys-libs/libselinux: Apply musl-1.2.4 largefile workaround
    
    Bug: https://bugs.gentoo.org/905711
    Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org>

 sys-libs/libselinux/libselinux-3.5-r1.ebuild | 7 +++++--
 sys-libs/libselinux/libselinux-3.6-r1.ebuild | 5 ++++-
 sys-libs/libselinux/libselinux-9999.ebuild   | 5 ++++-
 3 files changed, 13 insertions(+), 4 deletions(-)