scons: Address issues related to gcc 4.9.1

Fix a number few minor issues to please gcc 4.9.1. Removing the
'-fuse-linker-plugin' flag means no libraries are part of the LTO
process, but hopefully this is an acceptable loss, as the flag causes
issues on a lot of systems (only certain combinations of gcc, ld and
ar work).
This commit is contained in:
Andreas Hansson 2014-09-27 09:08:34 -04:00
parent 4836aef1e4
commit deb2200671
3 changed files with 8 additions and 8 deletions

View file

@ -602,14 +602,12 @@ if main['GCC']:
if not GetOption('no_lto'): if not GetOption('no_lto'):
# Pass the LTO flag when compiling to produce GIMPLE # Pass the LTO flag when compiling to produce GIMPLE
# output, we merely create the flags here and only append # output, we merely create the flags here and only append
# them later/ # them later
main['LTO_CCFLAGS'] = ['-flto=%d' % GetOption('num_jobs')] main['LTO_CCFLAGS'] = ['-flto=%d' % GetOption('num_jobs')]
# Use the same amount of jobs for LTO as we are running # Use the same amount of jobs for LTO as we are running
# scons with, we hardcode the use of the linker plugin # scons with
# which requires either gold or GNU ld >= 2.21 main['LTO_LDFLAGS'] = ['-flto=%d' % GetOption('num_jobs')]
main['LTO_LDFLAGS'] = ['-flto=%d' % GetOption('num_jobs'),
'-fuse-linker-plugin']
main.Append(TCMALLOC_CCFLAGS=['-fno-builtin-malloc', '-fno-builtin-calloc', main.Append(TCMALLOC_CCFLAGS=['-fno-builtin-malloc', '-fno-builtin-calloc',
'-fno-builtin-realloc', '-fno-builtin-free']) '-fno-builtin-realloc', '-fno-builtin-free'])

View file

@ -856,7 +856,9 @@ class PCStateOperand(Operand):
ctype = 'TheISA::PCState' ctype = 'TheISA::PCState'
if self.isPCPart(): if self.isPCPart():
ctype = self.ctype ctype = self.ctype
return "%s %s;\n" % (ctype, self.base_name) # Note that initializations in the declarations are solely
# to avoid 'uninitialized variable' errors from the compiler.
return '%s %s = 0;\n' % (ctype, self.base_name)
def isPCState(self): def isPCState(self):
return 1 return 1

View file

@ -298,10 +298,10 @@ CheckerCPU::writeMem(uint8_t *data, unsigned size,
// Cannot check this is actually what went to memory because // Cannot check this is actually what went to memory because
// there stores can be in ld/st queue or coherent operations // there stores can be in ld/st queue or coherent operations
// overwriting values. // overwriting values.
bool extraData; bool extraData = false;
if (unverifiedReq) { if (unverifiedReq) {
extraData = unverifiedReq->extraDataValid() ? extraData = unverifiedReq->extraDataValid() ?
unverifiedReq->getExtraData() : 1; unverifiedReq->getExtraData() : true;
} }
if (unverifiedReq && unverifiedMemData && if (unverifiedReq && unverifiedMemData &&