Gentoolto: For Some Reason I cant Compile Systemd With Safe Cflags.

Created on 4 Jun 2019  路  5Comments  路  Source: InBetweenNames/gentooLTO

https://gist.github.com/javashin/08dbdb8df627c1a43c9bbdcdfafac96b

im trying to compile systemd with :
LD="ld.gold"
CFLAGS="-O3 -march=native -pipe"
CXXFLAGS="-O3 -march=native -pipe"
CPPFLAGS="-O3 -march=native -pipe"
FFLAGS="-O3 -march=native -pipe"
FCFLAGS="-O3 -march=native -pipe"
F77FLAGS="-O3 -march=native -pipe"
LDFLAGS="-Wl,-O2 -Wl,--as-needed,-z,now -Wl,--hash-style=gnu"

and dont build fails with : cc1: some warnings being treated as errors

but builds fine with
sys-apps/systemd-242-r2::gentoo was built with the following:
USE="acl curl gcrypt http kmod lz4 lzma pam pcre policykit resolvconf seccomp split-usr sysv-utils -apparmor -audit -build -cryptsetup -dns-over-tls -elfutils -gnuefi -gnutls -idn -importd -libidn2 -nat -qrcode (-selinux) -test -vanilla -xkb" ABI_X86="32 (64) (-x32)"
CFLAGS="-march=native -mfpmath=both -funroll-loops -falign-functions=32 -fuse-ld=gold -O3 -fgraphite-identity -floop-nest-optimize -fdevirtualize-at-ltrans -fipa-pta -fno-semantic-interposition -flto=3 -fuse-linker-plugin -fno-plt -fno-math-errno -fno-trapping-math -fno-stack-protector -pipe -Wl,-O2 -Wl,--as-needed,-z,now -Wl,--hash-style=gnu"
CXXFLAGS="-march=native -mfpmath=both -funroll-loops -falign-functions=32 -fuse-ld=gold -O3 -fgraphite-identity -floop-nest-optimize -fdevirtualize-at-ltrans -fipa-pta -fno-semantic-interposition -flto=3 -fuse-linker-plugin -fno-plt -fno-math-errno -fno-trapping-math -fno-stack-protector -pipe -Wl,-O2 -Wl,--as-needed,-z,now -Wl,--hash-style=gnu"
FEATURES="preserve-libs network-sandbox userfetch userpriv unmerge-logs binpkg-docompress pid-sandbox unmerge-orphans usersandbox usersync binpkg-logs fixlafiles ipc-sandbox strict unknown-features-warn xattr binpkg-dostrip ebuild-locks sandbox parallel-fetch distlocks protect-owned ccache merge-sync multilib-strict assume-digests config-protect-if-modified news sfperms"
LDFLAGS="-Wl,-O2 -Wl,--as-needed,-z,now -Wl,--hash-style=gnu -march=native -mfpmath=both -funroll-loops -falign-functions=32 -fuse-ld=gold -O3 -fgraphite-identity -floop-nest-optimize -fdevirtualize-at-ltrans -fipa-pta -fno-semantic-interposition -flto=3 -fuse-linker-plugin -fno-plt -fno-math-errno -fno-trapping-math -fno-stack-protector -pipe"

Most helpful comment

you're stuck with us now

All 5 comments

this is strange after adding -flto=3 -fuse-linker-plugin to -O3 -march=native -pipe is compiling fine with
"-O3 -march=native -flto=3 -fuse-linker-plugin"

Why ?
my system noow needs LTO .......

you're stuck with us now

lol

systemd compiled fine now with no LTO , i dont know safe CFLAGS

but this ones with no lto just work fine

sys-apps/systemd-242-r6::gentoo was built with the following:
USE="acl curl gcrypt gnuefi http kmod lz4 lzma pam pcre policykit resolvconf seccomp split-usr sysv-utils -apparmor -audit -build -cryptsetup -dns-over-tls -elfutils -idn -importd -libidn2 -nat -qrcode (-selinux) -test -vanilla -xkb" ABI_X86="32 (64) (-x32)"
CFLAGS="-march=native -mfpmath=both -funroll-loops -falign-functions=32 -fgraphite-identity -floop-nest-optimize -fno-semantic-interposition -fuse-ld=bfd -O3 -fipa-pta -fno-plt -fno-math-errno -fno-trapping-math -fdevirtualize-at-ltrans -fno-stack-protector -pipe -Wl,-O2 -Wl,--as-needed,-z,now -Wl,--hash-style=gnu"
CXXFLAGS="-march=native -mfpmath=both -funroll-loops -falign-functions=32 -fgraphite-identity -floop-nest-optimize -fno-semantic-interposition -fuse-ld=bfd -O3 -fipa-pta -fno-plt -fno-math-errno -fno-trapping-math -fdevirtualize-at-ltrans -fno-stack-protector -pipe -Wl,-O2 -Wl,--as-needed,-z,now -Wl,--hash-style=gnu"

Was this page helpful?
0 / 5 - 0 ratings