Disko Forum logo Login  |  Register  |  Lost Password
Re:Passing compiler options (CXXFLAGS) to scons

nahsah
Posts: 24
graphgraph

Passing compiler options (CXXFLAGS) to scons 6 Years ago  
After successfully running Disko on QEMU, I'm trying to get Disko to work on my real hardware (MINI2440).

QEMU allows to run "general" ARM code. The real hardware only allows armv4t.
That's why I need to set CXXFLAGS to

CXXFLAGS="-march=armv4t -mtune=arm920t -I..."

where -I... stands for all my include paths.

Unfortunately scons doesn't work with the -march and -mtune flags. Without these flags and exactly the same setup, scons works perfect.
Here's the output of scons when trying to build disko with -march and -mtune flags:

...
scons: done reading SConscript files.
scons: Building targets ...
scons: done building targets.

That's all. Nothing is built!
I was looking in the SConstruct and the SConsript file but didn't find out why these flags are irritating scons so much.

Imho scons should pass the -march and -mtune flags to the compiler. So is this a bug in SConstruct?

Any help would be greatly appreciated.

Regards
Nahsah

Btw: Please correct the Makefiles in disko-benchmarks.git and replace g++ by $(CXX) as already reported in disko-tutorials.git. Thanks
 
  The administrator has disabled public write access.
Re:Passing compiler options (CXXFLAGS) to scons

Stefan
Posts: 91
graph

Re:Passing compiler options (CXXFLAGS) to scons 6 Years ago  
Hi Nahsah,

I double checked your experience, but I found that the CXXFLAGS are passed correcty. You can check what is passed if you comment out the lines in the SConstruct file:

env['SHCXXCOMSTR'] = ' [CXX] $SOURCE'
env['CXXCOMSTR'] = ' [CXX] $SOURCE'

Then you will see how the compiler is actually called by scons. Hope that helps a little.

Also I updated benchmark makefiles. Thanks for the note.

kind regards
Stefan
 
 
Last Edit: 2009/08/20 16:00 By Stefan.
  The administrator has disabled public write access.
Re:Passing compiler options (CXXFLAGS) to scons

nahsah
Posts: 24
graphgraph

Re:Passing compiler options (CXXFLAGS) to scons 6 Years ago  
Hi Stefan

Thanks for the hints.
Unfortunately commenting out 'SHCXXCOMSTR' and 'CXXCOMSTR' didn't work. No compiler flags are shown on the console. It seems that the error occurs earlier in the script. As stated in my first post, the only output of the scons build process is:

scons: done reading SConscript files.
scons: Building targets ...
scons: done building targets.

Finally I found the solution. I had to set the -march=armv4t and -mtune=920t flags in the CXX variable and not in the CXXFLAGS.

My CXX is now set as follows:

CXX="/home/user/CodeSourcery/bin/arm-none-linux-gnueabi-g++ -march=armv4t -mtune=arm920t"

Imho it should be possible to pass the -march and -mtune flags in either CXXFLAGS or CXX.
Unfortunately setting -march and -mtune in CXXFLAGS doesn't work with the Disko scons script.

What do you think?

Regards
Nahsah
 
  The administrator has disabled public write access.
Re:Passing compiler options (CXXFLAGS) to scons

Matthias
Posts: 64
graphgraph

Gender: Male Disko Location: Berlin, Germany Birthdate: 1979-04-25
Re:Passing compiler options (CXXFLAGS) to scons 6 Years ago  
Hi nahsah,

setting the CXXFLAGS should work. We're using this
in all our cross-compile environments.
From your output I guess, that scons didn't realize
to rebuild the sources.

This should ensure rebuilding:
Code:

scons -c && CXXFLAGS=... scons
Best regards, Matthias
 
  The administrator has disabled public write access.
Powered by FireBoard
get the latest posts directly to your desktop