I'm looking into packaging framewave into Fedora. Fedora has a set of C++ flags that are applied to all packages. It appears that the normal(?) way of specifying extra flags with CCFLAGS= on the scons command line doesn't work with framewave. How can I do this?
There is a document which describe how to add additional flags into SCONS based build system. Please refer this link http://framewave.sourceforge.net/DesignDoc/FramewaveBuildSystem-CompilerFlagsSetup.htm
Please go through it and see if it would help. Also, we will be more interested to know what flags you would intend to use because It will help us know of any issues due to usage of additional flags.
Try using scons CCFLAGS=$CCFLAGS
Compilation flag options:
Common to all passes of Compilation:
eg: scons fwSignal CCFLAGS=$CCFLAGS
Specific to a particular code-path:
REF_CCFLAGS="add the reference path compiation flags here"
SSE2_CCFLAGS ="add the sse2 path compiation flags here"
F10H_CCFLAGS ="add the sse2 path compiation flags here"
eg: 1) scons fwSignal REF_CCFLAGS="-DREF_PATH"
2) scons fwSignal REF_CCFLAGS="-O3" SSE2_CCFLAGS="-O3"
3) scons fwSignal F10H_CCFLAGS="-O3" SSE2_CCFLAGS="-O2"
Thanks for link. Note that it is quite cumbersome to programmatically add the required flags (given as an RPM macro) to the python file, but possible.
Fedora defines the following flags on all platforms:
-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4
The following on x86_32:
-m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables
and the following on x86_64:
The following cause problems:
-Wall - turns on lots of warnings and framewave specifies -Werror
-Wp,-D_FORTIFY_SOURCE=2 - triggers warnings like;
cc1plus: warnings being treated as errors
domain/fwBase/src/system.cpp: In function 'void* AlignedMalloc(size_t)':
domain/fwBase/src/system.cpp:89: error: ignoring return value of 'int posix_memalign(void**, size_t, size_t)', declared with attribute warn_unused_result
It would be interesting to know if the -march=i386 -mtune=generic parameters would interfere with the multiple pass build system framewave uses to support different processors.
thanks for listing out those flags.FW build never tried with those flags. We wouuld like to try and see if there is any impact.
We'll come back more on this.
Regarding "-march=i386 -mtune=generic" flags, we recommend not to use this flags since it would cause incompatibility issue with K7 based system and we need to maintain backward compatibility with K7 for some more time. Also, I didn't see much performance gain with -mtune=generic on K8 systems. The reference code will see some difference if it used with -mtune=<cpu_type> instead of GENERIC TYPE.
How does "-march=i386 -mtune=generic" cause incompatibility? It should generate perfectly valid code, right?
I would like to give bit of background...
Framewave(FW) LIBS are required to be compatible with older generation x86 processors(which does not support SSE2).
In order to achieve that, FW Build system makes sure to generate regular x86 instructions for a Reference Code path (plain C code ) which will not have SSE2 instructions in it. Hence, in each pass of multi-pass compilation, we have specified set of flags suitable only to that code path. Meaning, a Reference code path will have only regular x86 instructions and SSE2 code path will have only SSE2 instructions likewise.
Therefore, we don’t advise to make use of –mtune=generic for building FW since there would be possibility that compiler would generate SSE/SSE2 code for a Reference Code path which may crash on x86 processors that do not support SSE/SSE2 instructions.
SCONS provides command-line option for specifying CCFLAG but due to above mentioned requirement, we wanted to make sure that flags specified for each path are as appropriate as they should be.
Log in to post a comment.