From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 0D063384A045; Wed, 15 Apr 2020 15:53:18 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0D063384A045 From: "kloczko.tomasz at gmail dot com" To: elfutils-devel@sourceware.org Subject: [Bug general/24498] 0.176: isn't LTO ready Date: Wed, 15 Apr 2020 15:53:17 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: elfutils X-Bugzilla-Component: general X-Bugzilla-Version: unspecified X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: kloczko.tomasz at gmail dot com X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: elfutils-devel@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Elfutils-devel mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Apr 2020 15:53:18 -0000 https://sourceware.org/bugzilla/show_bug.cgi?id=3D24498 --- Comment #14 from kloczek --- > Sorry, but what are the clto_cflags and lto_ldflags precisely? And we now= (also) have some c++ code for the debuginfod server, which I assume needs = some CXXFLAGS too? Here is example from my own build environment. Below macro is used by %meso, %configure, %cmake and few other. Only changing that macro it is possible to control LTO and other things 100% transparently without touching any rpm spec file, or build framework toolin= g. $ rpm -E %set_build_flags export CFLAGS=3D"${CFLAGS:--O2 -g -pipe -Wall -Werror=3Dformat-secu= rity -Wp,-D_FORTIFY_SOURCE=3D2 -Wp,-D_GLIBCXX_ASSERTIONS -fstack-protector-strong -grecord-gcc-switches -specs=3D/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=3D/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=3Dgeneric -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -flto=3Dauto -flto-partition=3Dnone}"; export CXXFLAGS=3D"${CXXFLAGS:--O2 -g -pipe -Wall -Werror=3Dformat-= security -Wp,-D_FORTIFY_SOURCE=3D2 -Wp,-D_GLIBCXX_ASSERTIONS -fstack-protector-strong -grecord-gcc-switches -specs=3D/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=3D/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=3Dgeneric -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -flto=3Dauto -flto-partition=3Dnone}"; export FFLAGS=3D"${FFLAGS:--O2 -g -pipe -Wall -Werror=3Dformat-secu= rity -Wp,-D_FORTIFY_SOURCE=3D2 -Wp,-D_GLIBCXX_ASSERTIONS -fstack-protector-strong -grecord-gcc-switches -specs=3D/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=3D/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=3Dgeneric -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -I/usr/lib64/gfortran/modules -flto=3Dauto -flto-partition=3Dnone}"; export FCFLAGS=3D"${FCFLAGS:--O2 -g -pipe -Wall -Werror=3Dformat-se= curity -Wp,-D_FORTIFY_SOURCE=3D2 -Wp,-D_GLIBCXX_ASSERTIONS -fstack-protector-strong -grecord-gcc-switches -specs=3D/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=3D/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=3Dgeneric -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -I/usr/lib64/gfortran/modules -flto=3Dauto -flto-partition=3Dnone}"; export LDFLAGS=3D"${LDFLAGS:--Wl,-z,relro -Wl,--as-needed -Wl,-z,n= ow -specs=3D/usr/lib/rpm/redhat/redhat-hardened-ld -flto=3Dauto -flto-partitio= n=3Dnone -fuse-linker-plugin}"; export AR=3D"/usr/bin/gcc-ar" RANLIB=3D"/usr/bin/gcc-ranlib" NM=3D"/usr/bin/gcc-nm"; export CC=3D"gcc" CXX=3D"g++" I can change as well from GCC to CLang without changes in any build framewo= rk or rpm spec file. So again: things like LTO, PGO and any even any future optimizations should= be NEVER EVER implemented in build frameworks because all currently available frameworks are using above env variables. --=20 You are receiving this mail because: You are on the CC list for the bug.=