Skip to contentSkip to conversation

sane-toolchain-glibc.inc and old g++ versions

DISCUSSION Martin Dietze 2 participants 4 messages Mar 30, 2009

lore
Share & tools
lore
#0 lore raw

Hi,

the include file sane-toolchain-glibc.inc contains this line:

| CXXFLAGS += "-fvisibility-inlines-hidden"

This option is not supported by g++ 3.3.4 which is used for mtx-1/2/3. I am aware that this compiler is rather old, however it is known to produce stable code for the above platforms.

If possible, I would like to use the sane-toolchain.inc in my conf/distro/nylon.conf, but this does not seem possible straightaway. There seem to be two obvious solutions:

a) I don't use sane-toolchain.inc and need to merge any changes in it and its includes into my configuration file by hand

b) I move all but the offending line into a new file sane-toolchain-glibc-oldg++.inc (or whatever name I assign to it), include it in sane-toolchain-glibc.inc and set PREFERRED_LIBC to "glibc-oldg++" in conf/distro/nylon.conf; this of course would be a (hopefully not harmful) change to a mechanism used by all the other distros

Needless to say, I'd prefer option (b), if it were fine with you?

Cheers,

Martin

Signature · 4 lines
----------- / http://herbert.the-little-red-haired-girl.org / -------------
=+= 
Katz' Law: Man and nations will act rationally when all other 
           possibilities have been exhausted. 
#1 lore raw
Quoted 1 line · On Monday 30 March 2009 16:27:37 Martin Dietze wrote:

| CXXFLAGS += "-fvisibility-inlines-hidden"

c) enhance bitbake so that you can do

include sane-toolchain-glibc.inc
# My old compiler doesn't like this:
CXXFLAGS -= "-fvisibility-inlines-hidden"

You'd do this in lib/bb/parse/parse_py/ConfHandler.py, and need to start with __config_regexp__. Then search for "prepend" in the source. Near this place you'll need to add your new "remove" handling.

qmake from Qt 3.x and 4.x for example has this feature. It also has the cool feature of

XXX *= blah
XXX *= muh
XXX *= blah

... and afterwards, "blah" is only once in ${XXX}.

#2 lore raw
In reply to Martin Dietze

Upon thinking about that, it occured to me that you can do this without modifying bitbake: by using python code that modifies CXXFLAGS and an anonymous function.

For example, in any *.bb, *.inc, *.conf and *.bbclass file you can use anonmyous python functions like this:

SRCDATE=${@bb.data.getVar('PV', d, 1)[9:]}

And no one hinders you to do:

CXXFLAGS=${@bb.data.getVar('CXXFLAGS', d,
1).replace(" -fvisibility-inlines-hidden",""))

That's pretty all untested, but I think it will work. One recipe that uses this trick is mesa/mesa_6.0.1.bb.

#3 lore raw
Quoted 3 lines

CXXFLAGS=${@bb.data.getVar('CXXFLAGS', d,
1).replace(" -fvisibility-inlines-hidden",""))

Yes, that is almost it, seems like I'm slowly learning some Python now :)

Cheers,

Martin

Signature · 4 lines
----------- / http://herbert.the-little-red-haired-girl.org / -------------
=+= 
while (!asleep)
  ++sheep;