These functions where correctly returning whether a flag had existed,
and also correctly not installing it if asked not to. Unfortunately if
they *were* asked to install the flag, they ignored whether or not it
had actually existed to begin with.
Change-Id: I2dca0e1a0ddbc182576d48237aeea5452a02c51b
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/41159
Maintainer: Gabe Black <gabe.black@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
last_cxxflags = context.env['CXXFLAGS']
context.env.Append(CXXFLAGS=[flag])
ret = context.TryCompile('', '.cc')
- if not autoadd:
+ if not (ret and autoadd):
context.env['CXXFLAGS'] = last_cxxflags
context.Result(ret)
return ret
last_linkflags = context.env['LINKFLAGS']
context.env.Append(LINKFLAGS=[flag])
ret = context.TryLink('int main(int, char *[]) { return 0; }', '.cc')
- if not autoadd:
+ if not (ret and autoadd):
context.env['LINKFLAGS'] = last_linkflags
if set_for_shared:
assert(autoadd)