public inbox for elfutils@sourceware.org
 help / color / mirror / Atom feed
From: "kloczko.tomasz at gmail dot com" <sourceware-bugzilla@sourceware.org>
To: elfutils-devel@sourceware.org
Subject: [Bug general/24498] 0.176: isn't LTO ready
Date: Wed, 15 Apr 2020 15:53:17 +0000	[thread overview]
Message-ID: <bug-24498-10460-MHE4BYU6RJ@http.sourceware.org/bugzilla/> (raw)
In-Reply-To: <bug-24498-10460@http.sourceware.org/bugzilla/>

https://sourceware.org/bugzilla/show_bug.cgi?id=24498

--- Comment #14 from kloczek <kloczko.tomasz at gmail dot com> ---
> 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 tooling.

$ rpm -E %set_build_flags

        export CFLAGS="${CFLAGS:--O2 -g -pipe -Wall -Werror=format-security
-Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fstack-protector-strong
-grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1
-specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic
-fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection
-flto=auto -flto-partition=none}";
        export CXXFLAGS="${CXXFLAGS:--O2 -g -pipe -Wall -Werror=format-security
-Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fstack-protector-strong
-grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1
-specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic
-fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection
-flto=auto -flto-partition=none}";
        export FFLAGS="${FFLAGS:--O2 -g -pipe -Wall -Werror=format-security
-Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fstack-protector-strong
-grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1
-specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic
-fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection
-I/usr/lib64/gfortran/modules -flto=auto -flto-partition=none}";
        export FCFLAGS="${FCFLAGS:--O2 -g -pipe -Wall -Werror=format-security
-Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fstack-protector-strong
-grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1
-specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic
-fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection
-I/usr/lib64/gfortran/modules -flto=auto -flto-partition=none}";
        export LDFLAGS="${LDFLAGS:--Wl,-z,relro -Wl,--as-needed  -Wl,-z,now
-specs=/usr/lib/rpm/redhat/redhat-hardened-ld -flto=auto -flto-partition=none
-fuse-linker-plugin}";
        export AR="/usr/bin/gcc-ar" RANLIB="/usr/bin/gcc-ranlib"
NM="/usr/bin/gcc-nm";
        export CC="gcc" CXX="g++"

I can change as well from GCC to CLang without changes in any build framework
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.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

  parent reply	other threads:[~2020-04-15 15:53 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-28 19:49 [Bug general/24498] New: " kloczko.tomasz at gmail dot com
2019-04-28 20:25 ` [Bug general/24498] " mark at klomp dot org
2019-04-28 20:25 ` mark at klomp dot org
2019-04-28 20:37 ` kloczko.tomasz at gmail dot com
2019-04-28 20:43 ` mark at klomp dot org
2019-09-15 13:57 ` kloczko.tomasz at gmail dot com
2019-10-04  7:39 ` mark at klomp dot org
2020-03-30 22:11 ` kloczko.tomasz at gmail dot com
2020-04-02 11:14 ` mark at klomp dot org
2020-04-10 19:47 ` mark at klomp dot org
2020-04-15  5:12 ` marxin.liska at gmail dot com
2020-04-15  7:03 ` kloczko.tomasz at gmail dot com
2020-04-15  7:07 ` marxin.liska at gmail dot com
2020-04-15 12:50 ` mark at klomp dot org
2020-04-15 13:56 ` mark at klomp dot org
2020-04-15 15:53 ` kloczko.tomasz at gmail dot com [this message]
2020-04-16 16:00 ` mark at klomp dot org
2020-04-16 17:04 ` mark at klomp dot org
2020-04-17  9:42 ` mark at klomp dot org
2020-04-17 10:36 ` mark at klomp dot org
2020-05-06 14:39 ` mark at klomp dot org
2020-05-06 15:23 ` kloczko.tomasz at gmail dot com
2020-05-06 15:25 ` kloczko.tomasz at gmail dot com
2020-05-06 16:10 ` mark at klomp dot org
2020-05-06 16:10 ` [Bug general/24498] 0.179: " mark at klomp dot org
2020-05-06 17:28 ` kloczko.tomasz at gmail dot com
2022-04-24 18:14 ` mark at klomp dot org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-24498-10460-MHE4BYU6RJ@http.sourceware.org/bugzilla/ \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=elfutils-devel@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).