According to the GCC documentation the -frandom-seed=string
should have a unique string for each compiled file, see GCC Developer Options. One common approach is to use the source file path. How can I teach the waf build system to use the source file path for the option? I tried to use -frandom-seed=${SRC[0].abspath()}
in bld.objects(cflags=...)
.
Asked
Active
Viewed 185 times
1

Sebastian Huber
- 11
- 1
1 Answers
0
You can change the command used by waf to compile file:
from waflib.Tools.c import c
class modified_c(c):
run_str = '${CC} -frandom-seed=${SRC[0].abspath()} ${ARCH_ST:ARCH} ${CFLAGS} ${FRAMEWORKPATH_ST:FRAMEWORKPATH} ${CPPPATH_ST:INCPATHS} ${DEFINES_ST:DEFINES} ${CC_SRC_F}${SRC} ${CC_TGT_F}$
from waflib.Task import classes
classes['c'] = modified_c
You put that at the beginning of yout wscript. You can also put it oin a file you load à a plugin.

neuro
- 14,948
- 3
- 36
- 59