Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 862981 - sys-devel/clang-14.0.6-r1 has an automagic dependency detection for sys-libs/libunwind
Summary: sys-devel/clang-14.0.6-r1 has an automagic dependency detection for sys-libs/...
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: LLVM support project
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-08-02 09:48 UTC by Joonas Niilola
Modified: 2022-08-02 10:24 UTC (History)
1 user (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Joonas Niilola gentoo-dev 2022-08-02 09:48:18 UTC
After running emerge -a --depclean which cleaned 
  >>> Unmerging (1 of 11) sys-libs/libunwind-1.6.2...

I get:
!!! existing preserved libs:
>>> package: sys-libs/libunwind-1.6.2
 *  - /usr/lib64/libunwind.so.8
 *  - /usr/lib64/libunwind.so.8.0.1
 *      used by /usr/lib/llvm/14/bin/c-index-test (sys-devel/clang-14.0.6-r1)
 *      used by /usr/lib/llvm/14/bin/clang-14 (sys-devel/clang-14.0.6-r1)
 *      used by /usr/lib/llvm/14/bin/clang-apply-replacements (sys-devel/clang-14.0.6-r1)
 *      used by 23 other files
 *  - /usr/lib/libunwind.so.8
 *  - /usr/lib/libunwind.so.8.0.1
 *      used by /usr/lib/llvm/14/lib/libclang-cpp.so.14 (sys-devel/clang-14.0.6-r1)
 *      used by /usr/lib/llvm/14/lib/libclang.so.14.0.6 (sys-devel/clang-14.0.6-r1)
Use emerge @preserved-rebuild to rebuild packages using these libraries

# emerge -av @preserved-rebuild

These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild   R    ] sys-devel/clang-14.0.6-r1:14::gentoo  USE="default-lld (pie) static-analyzer xml -debug -default-compiler-rt -default-libcxx -doc -llvm-libunwind -test -verify-sig" ABI_X86="32 (64) (-x32)" LLVM_TARGETS="(AArch64) (AMDGPU) (ARM) (AVR) (BPF) (Hexagon) (Lanai) (MSP430) (Mips) (NVPTX) (PowerPC) (RISCV) (Sparc) (SystemZ) (VE) (WebAssembly) (X86) (XCore) (-ARC) (-CSKY) (-M68k)" PYTHON_SINGLE_TARGET="python3_10 -python3_8 -python3_9" 0 KiB
Comment 1 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2022-08-02 09:58:26 UTC
I can't reproduce and looking at the code, I don't see how this would happen.  Are you sure you aren't building with clang w/ libunwind as unwinder lib?
Comment 2 Joonas Niilola gentoo-dev 2022-08-02 10:05:30 UTC
Here's info about the system. I'll try to emerge libunwind and clang again, but I haven't switched USE flags or changed anything from what's below. Although for compiler-rt I compile it without thinlto because it doesn't compile with thinlto.

[ebuild   R    ] sys-libs/libomp-14.0.6-r1::gentoo  USE="(-cuda) -debug -hwloc -offload -ompt -test -verify-sig" ABI_X86="32 (64) (-x32)" LLVM_TARGETS="AMDGPU -NVPTX" 0 KiB
[ebuild   R    ] sys-devel/llvm-14.0.6-r2:14::gentoo  USE="binutils-plugin libffi ncurses xml -debug -doc -exegesis -libedit -test -verify-sig -xar -z3" ABI_X86="32 (64) (-x32)" LLVM_TARGETS="(AArch64) (AMDGPU) (ARM) (AVR) (BPF) (Hexagon) (Lanai) (MSP430) (Mips) (NVPTX) (PowerPC) (RISCV) (Sparc) (SystemZ) (VE) (WebAssembly) (X86) (XCore) (-ARC) (-CSKY) (-M68k)" 0 KiB
[ebuild   R    ] sys-devel/lld-14.0.6::gentoo  USE="-debug -test -verify-sig" 0 KiB
[ebuild   R    ] sys-devel/clang-14.0.6-r1:14::gentoo  USE="default-lld (pie) static-analyzer xml -debug -default-compiler-rt -default-libcxx -doc -llvm-libunwind -test -verify-sig" ABI_X86="32 (64) (-x32)" LLVM_TARGETS="(AArch64) (AMDGPU) (ARM) (AVR) (BPF) (Hexagon) (Lanai) (MSP430) (Mips) (NVPTX) (PowerPC) (RISCV) (Sparc) (SystemZ) (VE) (WebAssembly) (X86) (XCore) (-ARC) (-CSKY) (-M68k)" PYTHON_SINGLE_TARGET="python3_10 -python3_8 -python3_9" 0 KiB
[ebuild   R    ] sys-libs/compiler-rt-14.0.6:14.0.6::gentoo  USE="clang -debug -test -verify-sig" ABI_X86="32 (64)" 0 KiB
[ebuild   R    ] sys-libs/compiler-rt-sanitizers-14.0.6:14.0.6::gentoo  USE="asan cfi clang dfsan gwp-asan hwasan libfuzzer lsan memprof msan orc profile safestack scudo tsan ubsan xray -debug (-shadowcallstack) -test -verify-sig" ABI_X86="32 (64)" 0 KiB

$ emerge --info
Portage 3.0.30 (python 3.10.5-final-0, default/linux/amd64/17.1/desktop, gcc-11.3.0, glibc-2.35-r8, 5.15.52-gentoo x86_64)
=================================================================
System uname: Linux-5.15.52-gentoo-x86_64-AMD_Ryzen_9_5950X_16-Core_Processor-with-glibc2.35
KiB Mem:    98782428 total,   4528412 free
KiB Swap:          0 total,         0 free
Timestamp of repository gentoo: Tue, 02 Aug 2022 08:02:00 +0000
Head commit of repository gentoo: 8c56a7646601dbd0794e4de3203337033781b89b

Head commit of repository jps-gentoo: ea978138d5068ba9e942a29fe762d76bd42c88e3

sh bash 5.1_p16-r1
ld GNU ld (Gentoo 2.38 p4) 2.38
app-misc/pax-utils:        1.3.4::gentoo
app-shells/bash:           5.1_p16-r1::gentoo
dev-lang/perl:             5.34.1-r3::gentoo
dev-lang/python:           3.10.5::gentoo
dev-lang/rust:             1.62.1::gentoo
dev-util/cmake:            3.22.4::gentoo
dev-util/meson:            0.62.2::gentoo
sys-apps/baselayout:       2.8::gentoo
sys-apps/openrc:           0.44.10::gentoo
sys-apps/sandbox:          2.29::gentoo
sys-devel/autoconf:        2.13-r2::gentoo, 2.71-r1::gentoo
sys-devel/automake:        1.16.5::gentoo
sys-devel/binutils:        2.38-r2::gentoo
sys-devel/binutils-config: 5.4.1::gentoo
sys-devel/clang:           14.0.6-r1::gentoo
sys-devel/gcc:             11.3.0::gentoo
sys-devel/gcc-config:      2.5-r1::gentoo
sys-devel/libtool:         2.4.7::gentoo
sys-devel/lld:             14.0.6::gentoo
sys-devel/llvm:            14.0.6-r2::gentoo
sys-devel/make:            4.3::gentoo
sys-kernel/linux-headers:  5.15-r3::gentoo (virtual/os-headers)
sys-libs/glibc:            2.35-r8::gentoo
Repositories:

gentoo
    location: /var/db/repos/gentoo
    sync-type: git
    sync-uri: https://anongit.gentoo.org/git/repo/sync/gentoo.git
    priority: -1000

localhost
    location: /home/joonas/git/localhost
    masters: gentoo

jps-gentoo
    location: /var/db/repos/jps-gentoo
    sync-type: git
    sync-uri: https://github.com/juippis/jps-gentoo.git
    masters: gentoo
    priority: 50

Installed sets: @optfeature
ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="*"
AR="llvm-ar"
CBUILD="x86_64-pc-linux-gnu"
CC="clang"
CFLAGS="-march=native -O3 -pipe -flto=thin"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/lib64/libreoffice/program/sofficerc /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"
CXX="clang++"
CXXFLAGS="-march=native -O3 -pipe -flto=thin"
DISTDIR="/var/cache/distfiles"
EMERGE_DEFAULT_OPTS="--jobs=10"
ENV_UNSET="CARGO_HOME DBUS_SESSION_BUS_ADDRESS DISPLAY 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"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs buildpkg-live config-protect-if-modified distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync multilib-strict network-sandbox news parallel-fetch parallel-install pid-sandbox preserve-libs protect-owned qa-unresolved-soname-deps sandbox sfperms strict strict-keepdir unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="https://ftp-stud.hs-esslingen.de/pub/Mirrors/gentoo/"
LANG="en_US.utf-8"
LDFLAGS="-Wl,-O2 -Wl,--as-needed"
LINGUAS=" en  en_US  en-US  fi  sv "
MAKEOPTS="-j32"
NM="llvm-nm"
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"
RANLIB="llvm-ranlib"
SHELL="/bin/bash"
USE="X a52 aac acl acpi alsa amd64 archive branding bzip2 cairo cdr clang cli crypt cups dbus dri drm dts dvdr elogind encode exif ffmpeg flac fontconfig fortran freetype gdbm gif gpm gstreamer gtk gtk3 gui harfbuzz iconv icu jpeg jpeg2k lcms libglvnd libnotify libtirpc lto mad mng mp3 mp4 mpeg multilib ncurses nptl ogg opengl openmp openrc pam pango pcre pdf pipewire png policykit ppds pulseaudio rar readline seccomp split-usr ssl startup-notification svg theora threads tiff truetype udev udisks unicode upower usb vaapi vdpau vim-syntax voikko vorbis vulkan wxwidgets x264 xattr xcb xinerama xml xv xvid zfs zlib" ABI_X86="64 32" ADA_TARGET="gnat_2020" 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 sha sse sse2 sse3 sse4_1 sse4_2 sse4a ssse3" ELIBC="glibc" 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="joystick libinput" KERNEL="linux" L10N="en en_US en-US fi sv" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LLVM_TARGETS="AMDGPU BPF" 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_10" PYTHON_TARGETS="python3_10" QEMU_USER_TARGETS="x86_64" RUBY_TARGETS="ruby27" SANE_BACKENDS="pixma" USERLAND="GNU" VIDEO_CARDS="amdgpu radeonsi" 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, ARFLAGS, AS, ASFLAGS, CCLD, CONFIG_SHELL, CPP, CPPFLAGS, CTARGET, CXXFILT, ELFEDIT, EXTRA_ECONF, F77FLAGS, FC, GCOV, GPROF, INSTALL_MASK, LC_ALL, LD, LEX, LFLAGS, LIBTOOL, MAKE, MAKEFLAGS, OBJCOPY, OBJDUMP, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, READELF, RUSTFLAGS, SIZE, STRINGS, STRIP, YACC, YFLAGS
Comment 3 Arfrever Frehtes Taifersar Arahesis 2022-08-02 10:21:10 UTC
You have CC="clang", CXX="clang++".
Do you have package-specific overrides of CFLAGS/CXXFLAGS/LDFLAGS (e.g. for sys-devel/clang)?

$ cat /var/db/pkg/sys-devel/clang-14.0.6-r1/CFLAGS
$ cat /var/db/pkg/sys-devel/clang-14.0.6-r1/CXXFLAGS
$ cat /var/db/pkg/sys-devel/clang-14.0.6-r1/LDFLAGS
Comment 4 Joonas Niilola gentoo-dev 2022-08-02 10:22:05 UTC
Worked now... I don't know. Nothing should've changed before and after @world update, other than package versions.

vidar ~ # emerge -1av libunwind

These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild  N     ] sys-libs/libunwind-1.6.2:0/8::gentoo  USE="zlib -debug -debug-frame -doc -libatomic -lzma -static-libs -test" ABI_X86="32 (64) (-x32)" 0 KiB

Total: 1 package (1 new), Size of downloads: 0 KiB

Would you like to merge these packages? [Yes/No] y
>>> Verifying ebuild manifests
>>> Emerging (1 of 1) sys-libs/libunwind-1.6.2::gentoo
>>> Installing (1 of 1) sys-libs/libunwind-1.6.2::gentoo
>>> Jobs: 1 of 1 complete                           Load avg: 3.0, 16.6, 18.0
>>> Auto-cleaning packages...

>>> No outdated packages were found on your system.

 * GNU info directory index is up-to-date.
vidar ~ # emerge -1av clang

These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild   R    ] sys-devel/clang-14.0.6-r1:14::gentoo  USE="default-lld (pie) static-analyzer xml -debug -default-compiler-rt -default-libcxx -doc -llvm-libunwind -test -verify-sig" ABI_X86="32 (64) (-x32)" LLVM_TARGETS="(AArch64) (AMDGPU) (ARM) (AVR) (BPF) (Hexagon) (Lanai) (MSP430) (Mips) (NVPTX) (PowerPC) (RISCV) (Sparc) (SystemZ) (VE) (WebAssembly) (X86) (XCore) (-ARC) (-CSKY) (-M68k)" PYTHON_SINGLE_TARGET="python3_10 -python3_8 -python3_9" 0 KiB

Total: 1 package (1 reinstall), Size of downloads: 0 KiB

Would you like to merge these packages? [Yes/No] y
>>> Verifying ebuild manifests
>>> Emerging (1 of 1) sys-devel/clang-14.0.6-r1::gentoo
>>> Installing (1 of 1) sys-devel/clang-14.0.6-r1::gentoo
>>> Jobs: 1 of 1 complete                           Load avg: 27.4, 34.5, 27.9

 * Messages for package sys-devel/clang-14.0.6-r1:

 * You can find additional utility scripts in:
 *   /usr/lib/llvm/14/share/clang
 * Some of them are vim integration scripts (with instructions inside).
 * The run-clang-tidy.py script requires the following additional package:
 *   dev-python/pyyaml
>>> Auto-cleaning packages...

>>> No outdated packages were found on your system.

 * GNU info directory index is up-to-date.
vidar ~ # emerge -C libunwind
 * This action can remove important packages! In order to be safer, use
 * `emerge -pv --depclean <atom>` to check for reverse dependencies before
 * removing packages.

 sys-libs/libunwind
    selected: 1.6.2 
   protected: none 
     omitted: none 

All selected packages: =sys-libs/libunwind-1.6.2

>>> 'Selected' packages are slated for removal.
>>> 'Protected' and 'omitted' packages will not be removed.

>>> Waiting 5 seconds before starting...
>>> (Control-C to abort)...
>>> Unmerging in: 5 4 3 2 1
>>> Unmerging (1 of 1) sys-libs/libunwind-1.6.2...

 * GNU info directory index is up-to-date.
Comment 5 Joonas Niilola gentoo-dev 2022-08-02 10:24:45 UTC
(In reply to Arfrever Frehtes Taifersar Arahesis from comment #3)
> You have CC="clang", CXX="clang++".
> Do you have package-specific overrides of CFLAGS/CXXFLAGS/LDFLAGS (e.g. for
> sys-devel/clang)?
> 
> $ cat /var/db/pkg/sys-devel/clang-14.0.6-r1/CFLAGS
> $ cat /var/db/pkg/sys-devel/clang-14.0.6-r1/CXXFLAGS
> $ cat /var/db/pkg/sys-devel/clang-14.0.6-r1/LDFLAGS

No.

cat /var/db/pkg/sys-devel/clang-14.0.6-r1/*FLAGS
-march=native -O3 -pipe -flto=thin
-march=native -O3 -pipe -flto=thin
-Wl,-O2 -Wl,--as-needed

sys-libs/compiler-rt clang-no-lto.conf this is the only clang-related package in package.env.