Changeset 575a6e5 for tests/pybin


Ignore:
Timestamp:
Aug 9, 2018, 11:07:05 AM (6 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, no_list, persistent-indexer, pthread-emulation, qualifiedEnum
Children:
7a7ab42
Parents:
a5121bf
Message:

Cross compilation appears to be working

Location:
tests/pybin
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • tests/pybin/settings.py

    ra5121bf r575a6e5  
    2929        }
    3030
     31        CrossCompileFlags = {
     32                'x64' : 'ARCH_FLAGS=-m64',
     33                'x86' : 'ARCH_FLAGS=-m32',
     34        }
     35
    3136        def __init__(self, arch):
     37                try:
     38                        canonical_host = Architecture.makeCanonical( config.HOSTARCH )
     39                except KeyError:
     40                        print("Unkown host architecture %s" % config.HOSTARCH, file=sys.stderr)
     41                        sys.exit(1)
     42
    3243                if arch:
     44                        try:
     45                                arch = Architecture.makeCanonical( arch )
     46                        except KeyError:
     47                                print("Unkown architecture %s" % arch, file=sys.stderr)
     48                                sys.exit(1)
     49
     50                if arch and arch != canonical_host:
     51                        self.target = arch
    3352                        self.cross_compile = True
    34                         try:
    35                                 self.target = Architecture.makeCanonical( arch )
     53                        try :
     54                                self.flags = Architecture.CrossCompileFlags[arch]
    3655                        except KeyError:
    37                                 print("Unkown architecture %s" % arch)
     56                                print("Cross compilation not available for architecture %s" % arch, file=sys.stderr)
    3857                                sys.exit(1)
     58
    3959                else:
     60                        self.target = canonical_host
    4061                        self.cross_compile = False
    41                         try:
    42                                 arch = config.HOSTARCH
    43                                 self.target = Architecture.makeCanonical( arch )
    44                         except KeyError:
    45                                 print("Running on unkown architecture %s" % arch)
    46                                 sys.exit(1)
     62                        self.flags = ""
    4763
    4864                self.string = self.target
     
    6581        def __init__(self, value):
    6682                self.string = "debug" if value else "no debug"
    67                 self.flags  = """DEBUG_FLAGS="%s" """ % ("-debug" if value else "-nodebug")
     83                self.flags  = """DEBUG_FLAGS="%s" """ % ("-debug -O0" if value else "-nodebug -O2")
    6884
    6985class Install:
     
    98114                with open (".validate.err", "r") as myfile:
    99115                        error=myfile.read()
    100                 print('ERROR: Invalid configuration', file=sys.stderr)
     116                print("ERROR: Invalid configuration %s:%s" % (arch.string, debug.string), file=sys.stderr)
    101117                print("       verify returned : \n%s" % error, file=sys.stderr)
    102118                tools.rm("%s/.validate.err" % BUILDDIR)
  • tests/pybin/tools.py

    ra5121bf r575a6e5  
    101101                '-s' if silent else '',
    102102                test_param,
     103                settings.arch.flags,
    103104                settings.debug.flags,
    104105                settings.install.flags,
Note: See TracChangeset for help on using the changeset viewer.