[Mesa-dev] cflags mess with llvm builds

Xavier Chantry chantry.xavier at gmail.com
Sat Sep 25 10:24:20 PDT 2010


On Fri, Sep 24, 2010 at 11:36 PM, Xavier Chantry
<chantry.xavier at gmail.com> wrote:
> On Fri, Sep 24, 2010 at 3:15 PM, Luca Barbieri <luca at luca-barbieri.com> wrote:
>> Yes, that used to happen for me too.
>>
>> Just edit llvm-config to remove the offending text and ideally file a
>> bug on the LLVM bug tracker.
>>
>
> looks like nobled did this for me : http://llvm.org/bugs/show_bug.cgi?id=8220
> thanks :)
>

The first answer is very negative and reports the bug as invalid.
http://llvm.org/bugs/show_bug.cgi?id=8220#c1

The only suggestion is that custom flags could be appended.
Another problem is indeed that mesa puts these llvm flags at the end,
and the custom user CFLAGS first.

irc discussion on oftc #llvm :

18:16   shining^ >> hopefully someone will look at
http://llvm.org/bugs/show_bug.cgi?id=8220 , it should be easy to fix
18:16   gccbot >> tools bug #8220: llvm-config prints unnecessary
cflags Product: tools, Component: llvm-config, Severity: normal,
Assigned to:
                  unassignedbugs, Status: NEW
18:20 @ aKor >> shining^: the PR looks invalid to me.
18:20 @ aKor >> shining^: all the printed tools are also required for projects
18:21 @ aKor >> e.g. sometimes O3 is lowered to O2 to workaround
compiler miscompilation
18:21 @ aKor >> if you want to override the settings, you should just
append the necessary stuff to the end of cflags / cxxflags
18:54   shining^ >> aKor: why are they required for projects ?
18:56 @ aKor >> shining^: because in the projects decent amount of
LLVM code is compiled and used. This is mostly the code coming from
the headers.
18:57   shining^ >> I dont think the purpose of that tool is to
workaround compiler bugs. its just to provide the minimum set of flags
required to build llvm
                    code. maybe there isnt actually any ?
18:58 @ aKor >> well, if -O2 is *required* to workaround compiler
bugs, then it's surely should be included into minimal set of options
18:58 @ aKor >> (as opposed to -O3)
18:59   shining^ >> otherwise we need both a minimum set of flags and
an optimal set , working around bugs and all
18:59   shining^ >> why -O2 or -O3 ? maybe I dont want any
19:00 @ aKor >> ok, then just override it
19:00 @ aKor >> -O2 -O0 will yield -O0
19:00   shining^ >> well, its indeed very problematic in mesa, since
these flags are appended last :P
19:01 @ aKor >> then the problem is in mesa's build system :)
19:01   shining^ >> so my CFLAGS=-O0 settings didnt work at all. I
suppose I will go back to mesa people then ..
19:01   shining^ >> which is where I reported the problem in the first
place, of course
19:01 @ aKor >> in the list in PR only -fomit-frame-pointer -fPIC are redundant
19:02   ddunbar_ >> shining^: fwiw, I agree with you the -O doesn't belong there
19:02   ddunbar_ >> or we should have two sets
19:02 @ aKor >> ddunbar_: it depends on the platform and compiler used
19:02   shining^ >> well -fomit-frame-pointer annoyed me too, I
specifically build with no-omit-frame-pointer so I can get useful
profiles
19:04   ddunbar_ >> aKor: I agree with the principle that it there
should be a way to just get the required flags
19:05 @ aKor >> one should just define "required", e.g. "required to
just build" or "required to build usable binaries". The latter seems
should include more
                flags :)
19:05   ddunbar_ >> not that many
19:05   ddunbar_ >> I think the -D_GNU belong, and -frtti perhaps, but
not much more
19:07 @ aKor >> ddunbar_: rtti settings should always be required,
otherwise link will fail
19:07   ddunbar_ >> which is why I mentioned it :)


More information about the mesa-dev mailing list