Revamp CFLAGS/CXXFLAGS mechanism and enable -D_GLIBCXX_DEBUG

This commit is contained in:
Sergio Durigan Junior 2018-04-12 15:33:46 -04:00
parent e18f272411
commit 024bacf9cc

View file

@ -936,7 +936,15 @@ The parameters of the class are:
be called to test GDB. It needs to accept the same arguments as
the TestGDB class above. The default is to use TestGDB.
- extra_conf_flags: extra flags to be passed to "configure".
- extra_conf_flags: extra configure flags to be passed to
"configure". Should be a list (i.e., []). The default is None.
Do not pass CFLAGS/CXXFLAGS here; use the variables below for
that.
- extra_CFLAGS: extra CFLAGS to be passed to "configure".
Should be a list (i.e., []). The default is None.
- extra_CXXFLAGS: extra CXXFLAGS to be passed to "configure".
Should be a list (i.e., []). The default is None.
- enable_targets_all: set this to True to pass
@ -968,6 +976,12 @@ The parameters of the class are:
- system_debuginfo_location: Set this to the location of the
debuginfo files in the system. Default: "/usr/lib/debug"
- default_CFLAGS: The default CFLAGS options that are always
passed to configure. These are joined with extra_CFLAGS.
- default_CXXFLAGS: The default CXXFLAGS options that are always
passed to configure. These are joined with extra_CXXFLAGS.
"""
ConfigureClass = ConfigureGDB
CompileClass = CompileGDB
@ -977,6 +991,8 @@ The parameters of the class are:
# Set this to False to skip the test
run_testsuite = True
extra_CFLAGS = None
extra_CXXFLAGS = None
extra_conf_flags = None
enable_targets_all = True
@ -997,6 +1013,10 @@ The parameters of the class are:
use_system_debuginfo = True
system_debuginfo_location = "/usr/lib/debug"
# Default CFLAGS/CXXFLAGS that are always passed to "configure".
default_CFLAGS = "-D_GLIBCXX_DEBUG"
default_CXXFLAGS= "-D_GLIBCXX_DEBUG"
def __init__ (self, architecture_triplet = [], initial_delay = None):
factory.BuildFactory.__init__ (self)
@ -1025,14 +1045,23 @@ The parameters of the class are:
if not self.extra_conf_flags:
self.extra_conf_flags = []
if not self.extra_CFLAGS:
self.extra_CFLAGS = []
if not self.extra_CXXFLAGS:
self.extra_CXXFLAGS = []
if self.enable_targets_all:
self.extra_conf_flags.append ('--enable-targets=all')
if self.use_system_debuginfo:
self.extra_conf_flags.append ('--with-separate-debug-dir=%s' % self.system_debuginfo_location)
self.addStep (self.ConfigureClass (self.extra_conf_flags + architecture_triplet,
haltOnFailure = True))
self.extra_conf_flags.append ("CFLAGS=%s" % default_CFLAGS + ' '.join (extra_CFLAGS))
self.extra_conf_flags.append ("CXXFLAGS=%s" % default_CXXFLAGS + ' '.join (extra_CXXFLAGS))
self.extra_conf_flags.append (architecture_triplet)
self.addStep (self.ConfigureClass (extra_conf_flags, haltOnFailure = True))
if not self.extra_make_flags:
self.extra_make_flags = []
@ -1122,7 +1151,8 @@ class RunTestGDBPlain_c64t64 (BuildAndTestGDBFactory):
class RunTestGDBPlain_c32t32 (BuildAndTestGDBFactory):
"""Compiling on 32-bit, testing on 32-bit."""
def __init__ (self, **kwargs):
self.extra_conf_flags = [ r'CFLAGS=-m32', 'CXXFLAGS=-m32' ]
self.extra_CFLAGS = [ '-m32' ]
self.extra_CXXFLAGS = self.extra_CFLAGS
self.extra_make_check_flags = [ r'RUNTESTFLAGS=--target_board unix/-m32' ]
BuildAndTestGDBFactory.__init__ (self, **kwargs)
@ -1147,7 +1177,8 @@ class RunTestGDBNativeGDBServer_c64t32 (BuildAndTestGDBFactory):
class RunTestGDBNativeGDBServer_c32t32 (BuildAndTestGDBFactory):
"""Compiling on 32-bit, testing native-gdbserver on 32-bit."""
def __init__ (self, **kwargs):
self.extra_conf_flags = [ 'CFLAGS=-m32', 'CXXFLAGS=-m32' ]
self.extra_CFLAGS = [ '-m32' ]
self.extra_CXXFLAGS = self.extra_CFLAGS
self.extra_make_check_flags = [ 'RUNTESTFLAGS=--target_board native-gdbserver/-m32']
BuildAndTestGDBFactory.__init__ (self, **kwargs)
@ -1166,7 +1197,8 @@ class RunTestGDBNativeExtendedGDBServer_c64t32 (BuildAndTestGDBFactory):
class RunTestGDBNativeExtendedGDBServer_c32t32 (BuildAndTestGDBFactory):
"""Compiling on 64-bit, testing native-extended-gdbserver on 32-bit."""
def __init__ (self, **kwargs):
self.extra_conf_flags = [ 'CFLAGS=-m32', 'CXXFLAGS=-m32' ]
self.extra_CFLAGS = [ '-m32' ]
self.extra_CXXFLAGS = self.extra_CFLAGS
self.extra_make_check_flags = [ r'RUNTESTFLAGS=--target_board native-extended-gdbserver/-m32' ]
BuildAndTestGDBFactory.__init__ (self, **kwargs)
@ -1180,7 +1212,8 @@ class RunTestGDBIndexBuild (BuildAndTestGDBFactory):
class RunTestGDBIndexBuild_c32t32 (BuildAndTestGDBFactory):
"""Testing with the "cc-with-tweaks.sh" passing -i. 32-bit version"""
def __init__ (self, **kwargs):
self.extra_conf_flags = [ 'CFLAGS=-m32', 'CXXFLAGS=-m32' ]
self.extra_CFLAGS = [ '-m32' ]
self.extra_CXXFLAGS = self.extra_CFLAGS
self.extra_make_check_flags = [ util.Interpolate ('CC_FOR_TARGET=/bin/sh %(prop:builddir)s/binutils-gdb/gdb/contrib/cc-with-tweaks.sh -i gcc'),
util.Interpolate ('CXX_FOR_TARGET=/bin/sh %(prop:builddir)s/binutils-gdb/gdb/contrib/cc-with-tweaks.sh -i g++'),
'RUNTESTFLAGS=--target_board unix/-m32' ]