View previous topic :: View next topic |
Author |
Message |
FilthyPitDog Apprentice
Joined: 12 Jan 2021 Posts: 196 Location: South Pacific
|
Posted: Mon Dec 23, 2024 8:27 am Post subject: [Solved] Cant use clang LTO |
|
|
I followed https://wiki.gentoo.org/wiki/Clang#Advanced_examples
/etc/portage/env/compiler-clang-lto
Code: | CFLAGS="${CFLAGS} -flto=thin"
CXXFLAGS="${CXXFLAGS} -flto=thin"
# -O2 in LDFLAGS refers to binary size optimization during linking, it is NOT related to the -O levels of the compiler
LDFLAGS="${LDFLAGS} -Wl,-O2 -Wl,--as-needed"
CC="clang"
CXX="clang++"
CPP="clang-cpp" # necessary for xorg-server and possibly other packages
AR="llvm-ar"
NM="llvm-nm"
RANLIB="llvm-ranlib" |
and have added
/etc/portage/package.env
sys-apps/less compiler-clang-lto
When I try to emerge it I get this Code: | clang: error: linker command failed with exit code 1 (use -v to see invocation) | (Build log) https://paste.gentoo.zip/tTOdJgbS
This happens on any pakage Ive tried adding to /etc/portage/package.env
Any help would be greatly appreciated _________________ Gentoo is a way of life...
Last edited by FilthyPitDog on Mon Dec 23, 2024 10:34 am; edited 1 time in total |
|
Back to top |
|
|
sam_ Developer
Joined: 14 Aug 2020 Posts: 2038
|
Posted: Mon Dec 23, 2024 10:28 am Post subject: |
|
|
You need -fuse-ld=lld in *FLAGS or to set default-lld on clang-common. |
|
Back to top |
|
|
FilthyPitDog Apprentice
Joined: 12 Jan 2021 Posts: 196 Location: South Pacific
|
Posted: Mon Dec 23, 2024 10:33 am Post subject: |
|
|
sam_ wrote: | You need -fuse-ld=lld in *FLAGS or to set default-lld on clang-common. |
Thanks alot setting default-lld on clang-common did the trick _________________ Gentoo is a way of life... |
|
Back to top |
|
|
|