Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 936793 - dev-libs/openssl libcrypto.pc contains invalid linker flags (sys-fs/cryptsetup-2.7.3: error: unrecognized command-line option '-Wl'; (and more))
Summary: dev-libs/openssl libcrypto.pc contains invalid linker flags (sys-fs/cryptsetu...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-07-27 20:21 UTC by Conrad Kostecki
Modified: 2024-07-28 17:02 UTC (History)
2 users (show)

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


Attachments
build.log (build.log,128.03 KB, text/plain)
2024-07-27 20:22 UTC, Conrad Kostecki
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Conrad Kostecki gentoo-dev 2024-07-27 20:21:24 UTC
I've no idea, from there that comes from, as I don't have set those flags?

libtool: link: x86_64-pc-linux-gnu-gcc -Wall -march=native -mfpmath=sse,387 -mtune=intel -O3 -frecord-gcc-switches -fomit-frame-pointer -malign-data=abi -mtls-dialect=gnu2 -pipe -static -Wl,--as-needed -Wl,--defsym=__gentoo_check_ldflags__=0 -Wl,-O1 -Wl,--sort-common -Wl,-z -Wl,now -o cryptsetup.static lib/utils_crypt.o lib/utils_loop.o lib/utils_io.o lib/utils_blkid.o src/utils_args.o src/utils_tools.o src/utils_password.o src/utils_luks.o src/utils_blockdev.o src/utils_reencrypt.o src/utils_reencrypt_luks1.o src/utils_progress.o src/cryptsetup.o -Wl --push-state --as-needed --pop-state  ./.libs/libcryptsetup.a -ljson-c -lpopt -luuid -lblkid -lcrypto -ldl //usr/lib/gcc/x86_64-pc-linux-gnu/13/libatomic.a -lpwquality -lcrack -lz -ldevmapper -lm -lpthread -pthread
x86_64-pc-linux-gnu-gcc: error: unrecognized command-line option '-Wl'; did you mean '-W'?
x86_64-pc-linux-gnu-gcc: error: unrecognized command-line option '--push-state'
x86_64-pc-linux-gnu-gcc: error: unrecognized command-line option '--as-needed'; did you mean '-mno-needed'?
x86_64-pc-linux-gnu-gcc: error: unrecognized command-line option '--pop-state'; did you mean '--no-stats'?
make[2]: *** [Makefile:1829: cryptsetup.static] Error 1
make[2]: Leaving directory '/var/tmp/portage/sys-fs/cryptsetup-2.7.3/work/cryptsetup-2.7.3'
make[1]: *** [Makefile:2718: all-recursive] Error 1
make[1]: Leaving directory '/var/tmp/portage/sys-fs/cryptsetup-2.7.3/work/cryptsetup-2.7.3'
make: *** [Makefile:1315: all] Error 2
 * ERROR: sys-fs/cryptsetup-2.7.3::gentoo failed (compile phase):
 *   emake failed
 *
 * If you need support, post the output of `emerge --info '=sys-fs/cryptsetup-2.7.3::gentoo'`,
 * the complete build log and the output of `emerge -pqv '=sys-fs/cryptsetup-2.7.3::gentoo'`.
 * The complete build log is located at '/var/tmp/portage/sys-fs/cryptsetup-2.7.3/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/sys-fs/cryptsetup-2.7.3/temp/environment'.
 * Working directory: '/var/tmp/portage/sys-fs/cryptsetup-2.7.3/work/cryptsetup-2.7.3'
 * S: '/var/tmp/portage/sys-fs/cryptsetup-2.7.3/work/cryptsetup-2.7.3'
Comment 1 Conrad Kostecki gentoo-dev 2024-07-27 20:22:37 UTC
Created attachment 898415 [details]
build.log
Comment 2 Conrad Kostecki gentoo-dev 2024-07-27 20:22:49 UTC
Portage 3.0.65 (python 3.11.9-final-0, default/linux/amd64/23.0/split-usr, gcc-13, glibc-2.40, 6.6.30-1-lts x86_64)
=================================================================
System uname: Linux-6.6.30-1-lts-x86_64-Intel-R-_Core-TM-_i7-6600U_CPU_@_2.60GHz-with-glibc2.40
KiB Mem:    32594608 total,   3739496 free
KiB Swap:          0 total,         0 free
Timestamp of repository gentoo: Sat, 27 Jul 2024 10:15:00 +0000
Head commit of repository gentoo: 7888717f7f28b2136b18b0ff1e9751fd7387bc87
Timestamp of repository guru: Sat, 27 Jul 2024 00:06:51 +0000
Head commit of repository guru: 27427f1ec56748b8480263d0dad2d9f6058b5c33

sh bash 5.2_p26-r8
ld GNU ld (Gentoo 2.42 p6) 2.42.0
ccache version 4.10.1 [enabled]
app-misc/pax-utils:        1.3.7::gentoo
app-shells/bash:           5.2_p26-r8::gentoo
dev-build/autoconf:        2.13-r8::gentoo, 2.72-r1::gentoo
dev-build/automake:        1.16.5-r2::gentoo, 1.17-r1::gentoo
dev-build/cmake:           3.30.1::gentoo
dev-build/libtool:         2.4.7-r4::gentoo
dev-build/make:            4.4.1-r1::gentoo
dev-build/meson:           1.5.0::gentoo
dev-java/java-config:      2.3.4::gentoo
dev-lang/perl:             5.40.0::gentoo
dev-lang/python:           3.11.9-r1::gentoo, 3.12.4_p2::gentoo, 3.13.0_beta4::gentoo
dev-lang/rust:             1.79.0::gentoo
dev-lang/rust-bin:         1.79.0::gentoo
dev-util/ccache:           4.10.1::gentoo
sys-apps/baselayout:       2.15::gentoo
sys-apps/openrc:           0.54.2::gentoo
sys-apps/sandbox:          2.39::gentoo
sys-devel/binutils:        2.42-r2::gentoo
sys-devel/binutils-config: 5.5::gentoo
sys-devel/clang:           15.0.7-r3::gentoo, 17.0.6::gentoo, 18.1.8::gentoo
sys-devel/gcc:             13.2.1_p20240503::gentoo, 14.1.1_p20240720::gentoo
sys-devel/gcc-config:      2.11::gentoo
sys-devel/lld:             15.0.7::gentoo, 17.0.6::gentoo, 18.1.8::gentoo
sys-devel/llvm:            15.0.7-r3::gentoo, 17.0.6-r2::gentoo, 18.1.8-r2::gentoo
sys-kernel/linux-headers:  6.9::gentoo (virtual/os-headers)
sys-libs/glibc:            2.40::gentoo
Repositories:

gentoo
    location: /var/db/repos/gentoo
    sync-type: rsync
    sync-uri: rsync://rsync.de.gentoo.org/gentoo-portage
    priority: -1000
    volatile: False
    sync-rsync-verify-jobs: 1
    sync-rsync-verify-max-age: 24
    sync-rsync-verify-metamanifest: yes
    sync-rsync-extra-opts: --compress --exclude-from=/etc/portage/rsync_excludes --new-compress

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

serenity
    location: /usr/local/portage
    masters: gentoo
    volatile: True

ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="*"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=native -mfpmath=sse,387 -mtune=intel -O3 -frecord-gcc-switches -fomit-frame-pointer -malign-data=abi -mtls-dialect=gnu2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/config /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 /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CXXFLAGS="-march=native -mfpmath=sse,387 -mtune=intel -O3 -frecord-gcc-switches -fomit-frame-pointer -malign-data=abi -mtls-dialect=gnu2 -pipe -fvisibility-inlines-hidden"
DISTDIR="/var/cache/distfiles"
EMERGE_DEFAULT_OPTS="--autounmask=y --quiet-build=n --with-bdeps=y"
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=native -mfpmath=sse,387 -mtune=intel -O3 -frecord-gcc-switches -fomit-frame-pointer -malign-data=abi -mtls-dialect=gnu2 -pipe"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs binpkg-multi-instance buildpkg-live ccache config-protect-if-modified distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync merge-wait multilib-strict network-sandbox news parallel-fetch pid-sandbox pkgdir-index-trusted preserve-libs protect-owned qa-unresolved-soname-deps sandbox sfperms sign strict strict-keepdir unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync warn-on-large-env xattr"
FFLAGS="-march=native -mfpmath=sse,387 -mtune=intel -O3 -frecord-gcc-switches -fomit-frame-pointer -malign-data=abi -mtls-dialect=gnu2 -pipe"
GENTOO_MIRRORS="https://packages.hetzner.com/gentoo/"
INSTALL_MASK="/etc/systemd/* /etc/xinetd.d/* /usr/lib/systemd/*"
LANG="de_DE.UTF-8"
LC_ALL="de_DE.UTF-8"
LDFLAGS="-Wl,--as-needed -Wl,--defsym=__gentoo_check_ldflags__=0 -Wl,-O1 -Wl,--sort-common -Wl,-z,now"
LEX="flex"
LINGUAS="de de_DE"
MAKEOPTS="-j5 -l4"
PKGDIR="/var/cache/binpkgs"
PORTAGE_BUNZIP2_COMMAND="pbunzip2"
PORTAGE_BZIP2_COMMAND="pbzip2"
PORTAGE_COMPRESS="xz"
PORTAGE_COMPRESS_FLAGS="-9e"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_EXTRA_OPTS="--compress --exclude-from=/etc/portage/rsync_excludes --new-compress"
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"
SHELL="/usr/bin/bash"
USE="X aalib accessibility acl alsa amd64 ao appindicator asm avif bash-completion berkdb bluetooth brotli bzip2 cairo caps cdda cddb cjk colord crypt cups curl cvs cxx dbus dga djvu dri dvb egl elogind encode exif expat fbcon ffmpeg fftw filecaps flac fontconfig fortran ftp fttw gd gdbm geolocation gif git gles2 gmp gnome-keyring gnutls gphoto2 gpm graphviz gsm gstreamer gtk gui iconv icu idn ieee1394 imap imlib inotify introspection ios ipv6 java javascript jbig jemalloc jit joystick jpeg jpeg2k keyring latex lcms ldap libass libcaca libnotify libsamplerate lm-sensors lto lua luajit lz4 lzma lzo mad magic maildir mbox mhash mikmod milter mng modplug modules-compress modules-sign mp3 mtp ncurses networkmanager nls nntp offensive ogg openal opencl openexr opengl openmp opus orc oss pam pcre pdf perl pie png policykit postscript pulseaudio python qt5 qt6 raw readline rtmp samba sasl scanner screencast sctp sdl seccomp slang smartcard sndfile snmp socks5 sound sox speech speex spell split-usr sqlite ssl startup-notification strip subversion suid svg symlink syslog tcl test-rust theora threads tiff truetype udev udisks unicode upnp usb v4l vaapi vdpau verify-sig vim-syntax vnc vorbis vulkan wavpack wayland webkit webp wifi wmf x264 xattr xface xft xinetd xml xpm xscreensaver xv xvid zeroconf zip zlib zstd" ABI_X86="32 64" CAMERAS="aox" COLLECTD_PLUGINS="apcups battery buddyinfo capabilities cgroups check_uptime connectivity conntrack contextswitch cpu cpufreq cpusleep df disk dns entropy ethstat exec fhcount filecount hddtemp hugepages interface ipc ipmi iptables irq load java mcelog md memory mysql netlink nfs nginx ntpd openldap openvpn pcie_errors ping postgresql processes procevent protocols rrdcached sensors serial smart snmp swap syslog tcpconns thermal turbostat unixsock uptime users wireless" CPU_FLAGS_X86="aes avx avx2 f16c rdrand mmx mmxext sse sse2 sse3 sse4_1 sse4_2 ssse3" CURL_SSL="openssl" ELIBC="glibc" GPSD_PROTOCOLS="garmin garmintxt nmea0183" GRUB_PLATFORMS="pc" INPUT_DEVICES="libinput synaptics" KERNEL="linux" L10N="de de_DE" LCD_DEVICES="cfontzpacket crystalfontz glcd2usb hd44780 lcd2usb" LLVM_SLOT="17" LUA_SINGLE_TARGET="lua5-3" LUA_TARGETS="lua5-3 lua5-4" NGINX_MODULES_HTTP="access addition auth_basic autoindex brotli browser charset fancyindex fastcgi geo geoip geoip2 gunzip gzip gzip_static headers_more image_filter javascript limit_conn limit_req map metrics proxy realip referer rewrite secure_link sticky stub_status upload_progress upstream_keepalive vhost_traffic_status xslt" NGINX_MODULES_MAIL="imap pop3 smtp" NGINX_MODULES_STREAM="access geo geoip geoip2 javascript limit_conn map realip return ssl_preread" PERL_FEATURES="ithreads quadmath" PHP_TARGETS="php8-3" PYTHON_SINGLE_TARGET="python3_11" PYTHON_TARGETS="python3_11 python3_12" RUBY_TARGETS="ruby32 ruby33" SANE_BACKENDS="hp net" VIDEO_CARDS="intel"
Unset:  ADDR2LINE, AR, ARFLAGS, AS, ASFLAGS, CC, CCLD, CONFIG_SHELL, CPP, CPPFLAGS, CTARGET, CXX, CXXFILT, ELFEDIT, EXTRA_ECONF, F77FLAGS, FC, GCOV, GPROF, LD, LFLAGS, LIBTOOL, MAKE, MAKEFLAGS, NM, OBJCOPY, OBJDUMP, PORTAGE_BINHOST, PYTHONPATH, RANLIB, READELF, RUSTFLAGS, SIZE, STRINGS, STRIP, YACC, YFLAGS
Comment 3 Conrad Kostecki gentoo-dev 2024-07-27 20:24:37 UTC
I noticed, that I sill had here gcc-13 enabled. I switched to gcc-14 , but this fails the same way.
Comment 4 Mike Gilbert gentoo-dev 2024-07-28 00:09:06 UTC
On my local system:

% pkg-config --static --libs libcrypto
-lcrypto -ldl -pthread -Wl --push-state --as-needed -latomic --pop-state

Looks like a bug in libcrypto.pc (openssl):

libdir=/usr/lib64
includedir=/usr/include
enginesdir=/usr/lib64/engines-3
modulesdir=/usr/lib64/ossl-modules

Name: OpenSSL-libcrypto
Description: OpenSSL cryptography library
Version: 3.3.1
Libs: -L${libdir} -lcrypto
Libs.private: -ldl -pthread -Wl --push-state --as-needed -latomic --pop-state
Cflags: -I${includedir}
Comment 5 Mike Gilbert gentoo-dev 2024-07-28 00:20:29 UTC
The "-Wl,--push-state,--as-needed,-latomic,--pop-state" comes from append-atomic-flags in flag-o-matic.eclass.

I think this Perl script is treating the commas as an argument separator, and ends up replacing them with spaces when the array is later expanded.

https://github.com/openssl/openssl/blob/openssl-3.3.1/util/mkinstallvars.pl#L90-L92
Comment 6 Jerzy Kołosowski 2024-07-28 13:00:14 UTC
Upstream bug report: https://github.com/openssl/openssl/issues/24986
Comment 7 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-07-28 13:06:38 UTC
(In reply to Jerzy Kołosowski from comment #6)
> Upstream bug report: https://github.com/openssl/openssl/issues/24986

(It's already linked in "See Also")
Comment 8 Conrad Kostecki gentoo-dev 2024-07-28 14:18:37 UTC
PR from GH issue seems to fix it. After recompiling openssl with patch, I get this:

$ pkg-config --static --libs libcrypto
-lcrypto -ldl -pthread -Wl,--push-state,--as-needed,-latomic,--pop-state

Compilation of cryptsetup did now succeed.
Comment 9 Larry the Git Cow gentoo-dev 2024-07-28 17:02:54 UTC
The bug has been closed via the following commit(s):

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

commit 06a2a7a940e40c6057924e633c1504fd3e0292c8
Author:     Mike Gilbert <floppym@gentoo.org>
AuthorDate: 2024-07-28 17:01:23 +0000
Commit:     Mike Gilbert <floppym@gentoo.org>
CommitDate: 2024-07-28 17:01:23 +0000

    dev-libs/openssl: fix Libs.private in libcrypto.pc
    
    Closes: https://bugs.gentoo.org/936793
    Signed-off-by: Mike Gilbert <floppym@gentoo.org>

 .../openssl/files/openssl-3.3.1-pkg-config.patch   | 31 ++++++++++++++++++++++
 ...penssl-3.3.1.ebuild => openssl-3.3.1-r1.ebuild} |  2 ++
 2 files changed, 33 insertions(+)