GP-4995: Updated pcodetest framework to python3 and additional config

This commit is contained in:
ghidorahrex 2025-04-10 14:44:56 -04:00
parent 93c19e3cc6
commit 00687c8db8
9 changed files with 473 additions and 385 deletions

View file

@ -13,6 +13,9 @@ options needed to build the pcode test.
The defaults.py script should be modified to suit your environment The defaults.py script should be modified to suit your environment
reflecting the installation location of your toolchains, build artifacts, etc. reflecting the installation location of your toolchains, build artifacts, etc.
Options and parameters for building individual pcodetests are contained
in the pcode_defs.py script.
USAGE USAGE
----- -----
@ -23,9 +26,14 @@ arguments.
It is possible to build everything from scratch with this command: It is possible to build everything from scratch with this command:
./build --pcodetest-all ./build -a
Typically, pcode test binaries are built individually per processor, Typically, pcode test binaries are built individually per processor,
such as: such as:
./build --pcodetest MIPS16 ./build -t MIPS16
To see a list of all processor tests, run with the --list options:
./build -l

View file

@ -13,7 +13,6 @@ from pcodetest import *
# set default properties first, then update values from the command # set default properties first, then update values from the command
# line before they are instantiated. # line before they are instantiated.
def test_action(action_class, deprecate=False): def test_action(action_class, deprecate=False):
class pcodeTestAction(action_class): class pcodeTestAction(action_class):
def __call__(self, parser, namespace, values, option_string=None): def __call__(self, parser, namespace, values, option_string=None):
@ -25,7 +24,7 @@ def test_action(action_class, deprecate=False):
action_class.__call__(self, parser, namespace, values, option_string) action_class.__call__(self, parser, namespace, values, option_string)
return pcodeTestAction return pcodeTestAction
exec(compile(open('defaults.py', "rb").read(), 'defaults.py', 'exec')) from defaults import *
parser = argparse.ArgumentParser(description='''Build pcodetests. parser = argparse.ArgumentParser(description='''Build pcodetests.
One and only one of the following options must be given: One and only one of the following options must be given:
@ -48,48 +47,52 @@ required_group.add_argument('--pcodetest-list', dest='list', action=test_action(
# all-applicable arguments # all-applicable arguments
parser.add_argument('-f', '--force', action='store_true', help='force a build') parser.add_argument('-f', '--force', action='store_true', default=pcodeTestDefaults.force, help='force a build')
parser.add_argument('-v', '--verbose', action='store_true', help='verbose output where available ') parser.add_argument('-v', '--verbose', action='store_true', help='verbose output where available ')
parser.add_argument('--toolchain-root', default=PCodeTest.defaults.toolchain_root, help='directory where toolchain directories can be found (*)') parser.add_argument('--toolchain-root', default=pcodeTestDefaults.toolchain_root, help='directory where toolchain directories can be found (*)')
parser.add_argument('--build-root', default=PCodeTest.defaults.build_root, help='temporary directory to hold build files (*)') parser.add_argument('--build-root', default=pcodeTestDefaults.build_root, help='temporary directory to hold build files (*)')
parser.add_argument('--gcc-version', default=PCodeTest.defaults.gcc_version, help='default version of gcc (*)') parser.add_argument('--gcc-version', default=pcodeTestDefaults.gcc_version, help='default version of gcc (*)')
parser.add_argument('--gcc-config', default=pcodeTestDefaults.gcc_version, help='default configuration of gcc (*)')
# pcodetest arguments # pcodetest arguments
pcodetest_group = parser.add_argument_group('Pcodetest Options') pcodetest_group = parser.add_argument_group('Pcodetest Options')
pcodetest_group.add_argument('--no-publish', action='store_true', help='do not publish pcode test binaries to pcode test root') pcodetest_group.add_argument('--no-publish', action='store_true', help='do not publish pcode test binaries to pcode test root')
pcodetest_group.add_argument('--pcodetest-root', default=PCodeTest.defaults.pcodetest_root, help='location to publish pcode tests binaries (*)') pcodetest_group.add_argument('--export-root', default=pcodeTestDefaults.export_root, help='location to publish pcode tests binaries (*)')
pcodetest_group.add_argument('--pcodetest-src', default=PCodeTest.defaults.pcodetest_src, help='location of pcode test .c and .h source files (*)') pcodetest_group.add_argument('--pcodetest-src', default=pcodeTestDefaults.pcodetest_src, help='location of pcode test .c and .h source files (*)')
pcodetest_group.add_argument('--skip-files', nargs='+', default=PCodeTest.defaults.skip_files, help='default .c files to remove from the pcode test image (*)') pcodetest_group.add_argument('--skip-files', nargs='+', default=pcodeTestDefaults.skip_files, help='default .c files to remove from the pcode test image (*)')
pcodetest_group.add_argument('--strip-symbols', action='store_true', help='strip symbols from image') pcodetest_group.add_argument('--strip-symbols', action='store_true', help='strip symbols from image')
pcodetest_group.add_argument('--add-ccflags', default='', help='additional flags to pass to compiler (must be quoted)') pcodetest_group.add_argument('--add-ccflags', default='', help='additional flags to pass to compiler (must be quoted)')
pcodetest_group.add_argument('--gcc-libdir', default='', help='location of gcc libraries')
pcodetest_group.add_argument('--add-cclibs', default='', help='additional libraries to pass to the linker')
pcodetest_group.add_argument('--add-info', action='store_true', help='add data to binary with information about types and symbols') pcodetest_group.add_argument('--add-info', action='store_true', help='add data to binary with information about types and symbols')
pcodetest_group.add_argument('--build-exe', action='store_true', help='build a guest executable binary (exe)') pcodetest_group.add_argument('--build-exe', action='store_true', help='build a guest executable binary (exe)')
pcodetest_group.add_argument('--variants', default=json.dumps(PCodeTest.defaults.variants, sort_keys=True, separators=(',',':')), type=json.loads, help='build the (optimization) variants, encoded as a json dict') pcodetest_group.add_argument('--variants', default=json.dumps(pcodeTestDefaults.variants, sort_keys=True, separators=(',',':')), type=json.loads, help='build the (optimization) variants, encoded as a json dict')
sys.argv.pop(0) sys.argv.pop(0)
args = parser.parse_args(sys.argv) args = parser.parse_args(sys.argv)
PCodeTest.defaults.skip_files = args.skip_files pcodeTestDefaults.skip_files = args.skip_files
PCodeTest.defaults.pcodetest_root = args.pcodetest_root pcodeTestDefaults.export_root = args.export_root
PCodeTest.defaults.pcodetest_src = args.pcodetest_src pcodeTestDefaults.pcodetest_src = args.pcodetest_src
PCodeTest.defaults.strip_symbols = args.strip_symbols pcodeTestDefaults.strip_symbols = args.strip_symbols
PCodeTest.defaults.add_ccflags = args.add_ccflags pcodeTestDefaults.add_ccflags = args.add_ccflags
PCodeTest.defaults.add_info = args.add_info pcodeTestDefaults.gcc_libdir = args.gcc_libdir
PCodeTest.defaults.build_exe = args.build_exe pcodeTestDefaults.add_cclibs = args.add_cclibs
PCodeTest.defaults.variants = args.variants pcodeTestDefaults.add_info = args.add_info
PCodeTest.defaults.verbose = args.verbose pcodeTestDefaults.build_exe = args.build_exe
PCodeTest.defaults.force = args.force pcodeTestDefaults.variants = args.variants
PCodeTest.defaults.no_publish = args.no_publish pcodeTestDefaults.verbose = args.verbose
PCodeTest.defaults.toolchain_root = args.toolchain_root pcodeTestDefaults.force = args.force
PCodeTest.defaults.build_root = args.build_root pcodeTestDefaults.no_publish = args.no_publish
PCodeTest.defaults.gcc_version = args.gcc_version pcodeTestDefaults.toolchain_root = args.toolchain_root
pcodeTestDefaults.build_root = args.build_root
pcodeTestDefaults.gcc_version = args.gcc_version
pcodeTestDefaults.gcc_config = args.gcc_config
# load the known pcodetests # load the known pcodetests
from pcode_defs import *
exec(compile(open('pcode_defs.py', "rb").read(), 'pcode_defs.py', 'exec'))
cwd = os.getcwd() cwd = os.getcwd()

View file

@ -20,6 +20,7 @@ import sys
import pwd import pwd
import grp import grp
import re import re
from types import SimpleNamespace
class BuildUtil: class BuildUtil:
@ -286,7 +287,10 @@ class Config:
def format(self, val): def format(self, val):
if isinstance(val, str) and '%' in val: if isinstance(val, str) and '%' in val:
try:
return val % self.__dict__ return val % self.__dict__
except KeyError:
return val
elif isinstance(val, dict): elif isinstance(val, dict):
return {k: self.format(v) for k, v in val.items()} return {k: self.format(v) for k, v in val.items()}
else: return val else: return val

View file

@ -23,21 +23,33 @@ u4 u4_adc_carry(u4 a, u4 b, u1 carry)
if (carry == 1) { if (carry == 1) {
__asm__( __asm__(
".syntax unified\n" ".syntax unified\n"
#ifdef THUMB
"adds %[x_res],%[y]\n" /* set the carry flag */
#else
"adds %[x_res],%[x],%[y]\n" /* set the carry flag */ "adds %[x_res],%[x],%[y]\n" /* set the carry flag */
#endif
: [x_res] "=r" (x) : [x_res] "=r" (x)
: [x] "r" (x), [y] "r" (y) : [x] "r" (x), [y] "r" (y)
); );
} else { } else {
__asm__( __asm__(
".syntax unified\n" ".syntax unified\n"
#ifdef THUMB
"adds %[x_res],%[y]\n" /* clear the carry flag */
#else
"adds %[x_res],%[y],%[y]\n" /* clear the carry flag */ "adds %[x_res],%[y],%[y]\n" /* clear the carry flag */
#endif
: [x_res] "=r" (x) : [x_res] "=r" (x)
: [y] "r" (y) : [y] "r" (y)
); );
} }
__asm__( __asm__(
".syntax unified\n" ".syntax unified\n"
#ifdef THUMB
"adcs %[input_a],%[input_b]\n"
#else
"adcs %[input_a],%[input_a],%[input_b]\n" "adcs %[input_a],%[input_a],%[input_b]\n"
#endif
"bcc adc_nocarry\n" "bcc adc_nocarry\n"
"ldr %[result], =0x1\n" "ldr %[result], =0x1\n"
"b adc_end\n" "b adc_end\n"
@ -58,21 +70,33 @@ u4 u4_adc_overflow(u4 a, u4 b, u1 carry)
if (carry == 1) { if (carry == 1) {
__asm__( __asm__(
".syntax unified\n" ".syntax unified\n"
"adds %[x_res],%[x],%[y]\n" /* set the carry flag */ #ifdef THUMB
"adds %[x_res],%[y]\n" /* clear the carry flag */
#else
"adds %[x_res],%[y],%[y]\n" /* clear the carry flag */
#endif
: [x_res] "=r" (x) : [x_res] "=r" (x)
: [x] "r" (x), [y] "r" (y) : [x] "r" (x), [y] "r" (y)
); );
} else { } else {
__asm__( __asm__(
".syntax unified\n" ".syntax unified\n"
#ifdef THUMB
"adds %[x_res],%[y]\n" /* clear the carry flag */
#else
"adds %[x_res],%[y],%[y]\n" /* clear the carry flag */ "adds %[x_res],%[y],%[y]\n" /* clear the carry flag */
#endif
: [x_res] "=r" (x) : [x_res] "=r" (x)
: [y] "r" (y) : [y] "r" (y)
); );
} }
__asm__( __asm__(
".syntax unified\n" ".syntax unified\n"
"adcs %[input_a],%[input_a],%[input_b], lsr #1\n" #ifdef THUMB
"adcs %[input_a],%[input_b]\n"
#else
"adcs %[input_a],%[input_a],%[input_b]\n"
#endif
"bvc adc_noover\n" "bvc adc_noover\n"
"ldr %[result], =0x1\n" "ldr %[result], =0x1\n"
"b adc_o_end\n" "b adc_o_end\n"

View file

@ -13,6 +13,8 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
#if defined(__GNUC__) && !defined(__llvm__) #if defined(__GNUC__) && !defined(__llvm__)
#define HAS_GNU_ATTRIBUTES 1 #define HAS_GNU_ATTRIBUTES 1
@ -82,192 +84,110 @@
#define IS_COMPILER_UNKNOWN #define IS_COMPILER_UNKNOWN
#endif #endif
#if defined(IS_COMPILER_UNKNOWN) || defined(IS_COMPILER_PRE48_GCC) #if defined(U1)
typedef U1 u1;
/* Catch specific platforms */
#ifdef __AVR_ARCH__ /* defined(IS_COMPILER_UNKNOWN) || defined(IS_COMPILER_PRE48_GCC) && defined(__AVR_ARCH__) */
typedef unsigned char u1;
typedef signed char i1;
typedef unsigned short u2;
typedef signed short i2;
typedef unsigned long u4;
typedef signed long i4;
typedef long long i8;
typedef unsigned long long u8;
typedef float f4;
#ifdef HAS_DOUBLE
#endif
typedef i4 size_t;
#elif __AVR32__
typedef unsigned char u1;
typedef signed char i1;
typedef unsigned short u2;
typedef signed short i2;
typedef unsigned int u4;
typedef signed int i4;
#ifdef HAS_LONGLONG
typedef long long i8;
#endif
#if defined(HAS_LONGLONG) || defined(HAS__DOUBLE)
typedef unsigned long long u8;
#endif
#ifdef HAS_FLOAT
typedef float f4;
#endif
#ifdef HAS_DOUBLE
typedef double f8;
#endif
typedef __SIZE_TYPE__ size_t;
#else /* defined(IS_COMPILER_UNKNOWN) || defined(IS_COMPILER_PRE48_GCC) && !defined(__AVR_ARCH__) */
/* This is for non-GNU non CodeComposerStudio generic case. */
typedef unsigned char u1;
typedef signed char i1;
typedef unsigned short u2;
typedef signed short i2;
#ifdef INT4_IS_LONG
typedef unsigned long u4;
typedef signed long i4;
#else #else
typedef unsigned int u4; #if defined(__UINT8_TYPE__)
typedef signed int i4;
#endif
#ifdef HAS_LONGLONG
typedef long long i8;
#endif
#if defined(HAS_LONGLONG) || defined(HAS__DOUBLE)
typedef unsigned long long u8;
#endif
#ifdef HAS_FLOAT
typedef float f4;
#endif
#ifdef HAS_DOUBLE
#ifdef dsPIC30
typedef long double f8;
#else
typedef double f8;
#endif
#endif
#ifdef HAS_LONGLONG
typedef i8 size_t;
#else
typedef i4 size_t;
#endif
#endif
#endif /* #if defined(IS_COMPILER_UNKNOWN) || defined(IS_COMPILER_PRE48_GCC) */
/* For CodeComposerStudio */
#if defined(IS_COMPILER_CODECOMPOSERSTUDIO)
#if defined(__MSP430__) /* defined(IS_COMPILER_CODECOMPOSERSTUDIO) && defined(__MSP430__) */
typedef unsigned char u1;
typedef signed char i1;
typedef unsigned short u2;
typedef signed short i2;
typedef unsigned long u4;
typedef signed long i4;
#undef HAS_FLOAT
#undef HAS_DOUBLE
#undef HAS_LONGLONG
#undef HAS_GNU_ATTRIBUTES
typedef unsigned int size_t;
#endif /* #if defined(__MSP430__) */
#endif /* #if defined(IS_COMPILER_CODECOMPOSERSTUDIO) */
/* For GNU compilers */
/* Modern GNU compilers > 4.7 have size macros to uses to give us definitions. */
#if defined(IS_COMPILER_POST48_GCC)
typedef __SIZE_TYPE__ size_t;
typedef __INT8_TYPE__ i1;
typedef __INT16_TYPE__ i2;
typedef __INT32_TYPE__ i4;
#if defined(__INT64_TYPE__)
#ifdef HAS_LONGLONG
typedef __INT64_TYPE__ i8;
#endif
#endif
typedef __UINT8_TYPE__ u1; typedef __UINT8_TYPE__ u1;
#else
typedef unsigned char u1;
#endif
#endif
#if defined(I1)
typedef I1 i1;
#else
#if defined(__INT8_TYPE__)
typedef __INT8_TYPE__ i1;
#else
typedef signed char i1;
#endif
#endif
#if defined(U2)
typedef U2 u2;
#else
#if defined(__UINT16_TYPE__)
typedef __UINT16_TYPE__ u2; typedef __UINT16_TYPE__ u2;
#else
typedef unsigned short u2;
#endif
#endif
#if defined(I2)
typedef I2 i2;
#else
#if defined(__INT16_TYPE__)
typedef __INT16_TYPE__ i2;
#else
typedef signed short i2;
#endif
#endif
#if defined(U4)
typedef U4 u4;
#else
#if defined(__UINT32_TYPE__)
typedef __UINT32_TYPE__ u4; typedef __UINT32_TYPE__ u4;
#else
typedef unsigned long u4;
#endif
#endif
#if defined(I4)
typedef I4 i4;
#else
#if defined(__INT32_TYPE__)
typedef __INT32_TYPE__ i4;
#else
typedef signed long i4;
#endif
#endif
#if defined(U8)
typedef U8 u8;
#else
#if defined(__UINT64_TYPE__) #if defined(__UINT64_TYPE__)
typedef __UINT64_TYPE__ u8; typedef __UINT64_TYPE__ u8;
#else
typedef unsigned long long u8;
#endif
#endif #endif
#ifdef __SIZEOF_FLOAT__ #if defined(I8)
#ifdef HAS_FLOAT typedef I8 i8;
#else
#if defined(__INT64_TYPE__)
typedef __INT64_TYPE__ i8;
#else
typedef signed long long i8;
#endif
#endif
#if defined(F4)
typedef F4 f4;
#else
typedef float f4; typedef float f4;
#endif #endif
#endif
#ifdef __SIZEOF_DOUBLE__ #if defined(F8)
#ifdef HAS_DOUBLE typedef F8 f8;
#else
typedef double f8; typedef double f8;
#endif #endif
#if defined(F16)
typedef F16 f16;
#else
typedef long double f16;
#endif #endif
#define TYPES_ARE_DEFINED 1
#endif /* #if defined(IS_COMPILER_POST48_GCC) */
/* Microsoft VisualC++ compiler */ #if defined(__SIZE_TYPE__)
#if defined(IS_COMPILER_MSVC) typedef __SIZE_TYPE__ size_t;
#else
/* ARM on Visual C++ */
#if defined(_M_ARM_FP) /* defined(IS_COMPILER_MSVC) && defined(_M_ARM_FP) */
typedef unsigned char u1;
typedef signed char i1;
typedef unsigned short u2;
typedef signed short i2;
typedef unsigned long u4;
typedef signed long i4;
#undef HAS_FLOAT
#undef HAS_DOUBLE
#undef HAS_LONGLONG
#undef HAS_GNU_ATTRIBUTES
typedef unsigned int size_t;
#endif /* #if defined(IS_COMPILER_MSVC) */
#endif /* #if defined(_M_ARM_FP) */
#ifdef IS_COMPILER_LLVM #ifdef IS_COMPILER_LLVM
typedef unsigned char u1;
typedef signed char i1;
typedef unsigned short u2;
typedef signed short i2;
typedef unsigned __INT32_TYPE__ u4;
typedef signed __INT32_TYPE__ i4;
#ifdef __INT64_TYPE__
typedef unsigned long long u8;
typedef signed long long i8;
#define HAS_LONGLONG
#else
#undef HAS_LONGLONG
#endif /* LONGLONG */
#ifdef __SIZEOF_FLOAT__
typedef float f4;
#define HAS_FLOAT
#else
#undef HAS_FLOAT
#endif /* FLOAT */
#ifdef __SIZEOF_DOUBLE__
typedef double f8;
#define HAS_DOUBLE
#else
#undef HAS_DOUBLE
#endif /* DOUBLE */
/* __is_identifier __has_feature */ /* __is_identifier __has_feature */
#ifdef __has_feature /* LLVM clang magic (see clang docs) */ #ifdef __has_feature /* LLVM clang magic (see clang docs) */
@ -290,7 +210,26 @@ typedef i1 size_t;
#pragma message "has NOT __has_feature" #pragma message "has NOT __has_feature"
#endif /* #ifdef __has_feature */ #endif /* #ifdef __has_feature */
#else
#if defined(HAS_LONGLONG)
typedef u8 size_t;
#else
typedef u4 size_t;
#endif /* HAS_LONGLONG */
#endif /* #ifdef IS_COMPILER_LLVM */ #endif /* #ifdef IS_COMPILER_LLVM */
#endif /* defined(__SIZE_TYPE__) */
/* For CodeComposerStudio */
#if defined(IS_COMPILER_CODECOMPOSERSTUDIO) || defined(IS_COMPILER_MSVC)
#undef HAS_GNU_ATTRIBUTES
#endif /* #if defined(IS_COMPILER_CODECOMPOSERSTUDIO) || defined(IS_COMPILER_MSVC) */
/* Simulated limit.h */ /* Simulated limit.h */
#define U1_MAX 0xFF #define U1_MAX 0xFF

View file

@ -16,36 +16,43 @@
# Default values can be modified here, or (in # Default values can be modified here, or (in
# some cases) on the build command line (see ./build --help) # some cases) on the build command line (see ./build --help)
# PCodeTest.defaults that can be overridden on command line # defaults that can be overridden on command line
PCodeTest.defaults.toolchain_root = '/local/ToolChains' from types import SimpleNamespace
PCodeTest.defaults.build_root = '/local/build-pcodetest' import os
PCodeTest.defaults.gcc_version = '9.2.0'
PCodeTest.defaults.skip_files = []
PCodeTest.defaults.export_root = os.getcwd() + '/../../../../../ghidra.bin/Ghidra/Test/TestResources/data/pcodetests/'
PCodeTest.defaults.pcodetest_src = os.getcwd() + '/c_src'
# PCodeTest.defaults that cannot be overridden on the command line filePath = os.path.abspath(os.path.dirname(__file__))
pcodeTestDefaults = SimpleNamespace()
pcodeTestDefaults.toolchain_root = '/data/ToolChains'
pcodeTestDefaults.build_root = '/data/build'
pcodeTestDefaults.gcc_version = 'latest'
pcodeTestDefaults.gcc_config = pcodeTestDefaults.gcc_version
pcodeTestDefaults.skip_files = []
pcodeTestDefaults.export_root = os.path.join(filePath, '../../../../../ghidra.bin/Ghidra/Test/TestResources/data/pcodetests/')
pcodeTestDefaults.pcodetest_src = os.path.join(filePath, 'c_src')
# defaults that cannot be overridden on the command line
# These are set by processor test definitions in the pcode_defs.py file # These are set by processor test definitions in the pcode_defs.py file
PCodeTest.defaults.build_all = 0 pcodeTestDefaults.build_all = 0
PCodeTest.defaults.ccflags = '' pcodeTestDefaults.ccflags = ''
PCodeTest.defaults.has_decimal128 = 0 pcodeTestDefaults.cclibs = ''
PCodeTest.defaults.has_decimal32 = 0 pcodeTestDefaults.has_decimal128 = 0
PCodeTest.defaults.has_decimal64 = 0 pcodeTestDefaults.has_decimal32 = 0
PCodeTest.defaults.has_double = 1 pcodeTestDefaults.has_decimal64 = 0
PCodeTest.defaults.has_float = 1 pcodeTestDefaults.has_double = 1
PCodeTest.defaults.has_longlong = 1 pcodeTestDefaults.has_float = 1
PCodeTest.defaults.has_shortfloat = 0 pcodeTestDefaults.has_longlong = 1
PCodeTest.defaults.has_vector = 0 pcodeTestDefaults.has_shortfloat = 0
PCodeTest.defaults.small_build = 0 pcodeTestDefaults.has_vector = 0
PCodeTest.defaults.ld_library_path = '' pcodeTestDefaults.small_build = 0
PCodeTest.defaults.toolchain_type = 'gcc' pcodeTestDefaults.ld_library_path = ''
PCodeTest.defaults.compile_exe = 'bin/gcc' pcodeTestDefaults.toolchain_type = 'gcc'
PCodeTest.defaults.objdump_exe = 'bin/objdump' pcodeTestDefaults.compile_exe = 'bin/gcc'
PCodeTest.defaults.objdump_option = '' pcodeTestDefaults.objdump_exe = 'bin/objdump'
PCodeTest.defaults.readelf_exe = 'bin/readelf' pcodeTestDefaults.objdump_option = ''
PCodeTest.defaults.nm_exe = 'bin/nm' pcodeTestDefaults.readelf_exe = 'bin/readelf'
PCodeTest.defaults.strip_exe = 'bin/strip' pcodeTestDefaults.nm_exe = 'bin/nm'
PCodeTest.defaults.variants = {'O0': '-O0', 'O3': '-O3'} pcodeTestDefaults.strip_exe = 'bin/strip'
PCodeTest.defaults.proc_test = '' pcodeTestDefaults.variants = {'O0': '-O0', 'O3': '-O3'}
pcodeTestDefaults.proc_test = ''
pcodeTestDefaults.force = False

View file

@ -15,6 +15,7 @@
## ##
# The available pcode tests are recorded here as instances of the 'name' # The available pcode tests are recorded here as instances of the 'name'
# python class. # python class.
from pcodetest import PCodeTest
PCodeTest({ PCodeTest({
'name': 'ARM', 'name': 'ARM',
@ -23,7 +24,7 @@ PCodeTest({
'qemu_command': 'qemu-arm', 'qemu_command': 'qemu-arm',
'toolchain': 'ARM/arm-eabi', 'toolchain': 'ARM/arm-eabi',
'language_id': 'ARM:LE:32:v7', 'language_id': 'ARM:LE:32:v7',
'ccflags': '-L %(toolchain_dir)s/lib/gcc/arm-eabi/%(gcc_version)s -lgcc', 'cclibs': '-lgcc',
'proc_test': 'arm', 'proc_test': 'arm',
}) })
@ -34,7 +35,8 @@ PCodeTest({
'qemu_command': 'qemu-armbe', 'qemu_command': 'qemu-armbe',
'toolchain': 'ARM/armbe-eabi', 'toolchain': 'ARM/armbe-eabi',
'language_id': 'ARM:BE:32:v7', 'language_id': 'ARM:BE:32:v7',
'ccflags': '-mbig-endian -L %(toolchain_dir)s/lib/gcc/arm-eabi/%(gcc_version)s -lgcc', 'ccflags': '-mbig-endian',
'cclibs': '-lgcc',
'proc_test': 'arm', 'proc_test': 'arm',
'has_float': 0, 'has_float': 0,
'has_double': 0, 'has_double': 0,
@ -45,7 +47,8 @@ PCodeTest({
PCodeTest({ PCodeTest({
'name': 'ARM2', 'name': 'ARM2',
'toolchain': 'ARM/arm-eabi', 'toolchain': 'ARM/arm-eabi',
'ccflags': '-mcpu=arm2 -L %(toolchain_dir)s/lib/gcc/arm-eabi/%(gcc_version)s -lgcc', 'ccflags': '-mcpu=arm2',
'cclibs': '-lgcc',
'language_id': 'ARM:LE:32:v7', 'language_id': 'ARM:LE:32:v7',
'proc_test': 'arm', 'proc_test': 'arm',
}) })
@ -57,13 +60,27 @@ PCodeTest({
'qemu_command': 'qemu-arm', 'qemu_command': 'qemu-arm',
'toolchain': 'ARM/arm-eabi', 'toolchain': 'ARM/arm-eabi',
'language_id': 'ARM:LE:32:v5', 'language_id': 'ARM:LE:32:v5',
'ccflags': '-march=armv5 -L %(toolchain_dir)s/lib/gcc/arm-eabi/%(gcc_version)s -lgcc', 'gcc_version': '7.3.0',
'ccflags': '-march=armv5',
'cclibs': '-lgcc',
})
PCodeTest({
'name': 'ARMv6',
'build_all': 1,
'build_exe': 1,
'qemu_command': 'qemu-arm',
'toolchain': 'ARM/arm-eabi',
'language_id': 'ARM:LE:32:v6',
'ccflags': '-march=armv6+fp',
'cclibs': '-lgcc',
}) })
PCodeTest({ PCodeTest({
'name': 'ARM7', 'name': 'ARM7',
'toolchain': 'ARM/arm-eabi', 'toolchain': 'ARM/arm-eabi',
'ccflags': '-mcpu=arm7 -L %(toolchain_dir)s/lib/gcc/arm-eabi/%(gcc_version)s -lgcc', 'ccflags': '-march=armv7-a+simd',
'cclibs': '-lgcc',
'language_id': 'ARM:LE:32:v7', 'language_id': 'ARM:LE:32:v7',
'proc_test': 'arm', 'proc_test': 'arm',
}) })
@ -71,7 +88,8 @@ PCodeTest({
PCodeTest({ PCodeTest({
'name': 'ARM8', 'name': 'ARM8',
'toolchain': 'ARM/arm-eabi', 'toolchain': 'ARM/arm-eabi',
'ccflags': '-mcpu=arm8 -L %(toolchain_dir)s/lib/gcc/arm-eabi/%(gcc_version)s -lgcc', 'ccflags': '-mcpu=arm8',
'cclibs': '-lgcc',
'language_id': 'ARM:LE:32:v7', 'language_id': 'ARM:LE:32:v7',
'proc_test': 'arm', 'proc_test': 'arm',
}) })
@ -79,7 +97,8 @@ PCodeTest({
PCodeTest({ PCodeTest({
'name': 'ARM9', 'name': 'ARM9',
'toolchain': 'ARM/arm-eabi', 'toolchain': 'ARM/arm-eabi',
'ccflags': '-mcpu=arm9 -L %(toolchain_dir)s/lib/gcc/arm-eabi/%(gcc_version)s -lgcc', 'ccflags': '-mcpu=arm9',
'cclibs': '-lgcc',
'language_id': 'ARM:LE:32:v7', 'language_id': 'ARM:LE:32:v7',
'proc_test': 'arm', 'proc_test': 'arm',
}) })
@ -90,7 +109,8 @@ PCodeTest({
'build_exe': 1, 'build_exe': 1,
'qemu_command': 'qemu-arm', 'qemu_command': 'qemu-arm',
'toolchain': 'ARM/arm-eabi', 'toolchain': 'ARM/arm-eabi',
'ccflags': '-mcpu=arm10e -L %(toolchain_dir)s/lib/gcc/arm-eabi/%(gcc_version)s -lgcc', 'ccflags': '-mcpu=arm10e',
'cclibs': '-lgcc',
'language_id': 'ARM:LE:32:v7', 'language_id': 'ARM:LE:32:v7',
'proc_test': 'arm', 'proc_test': 'arm',
}) })
@ -101,7 +121,9 @@ PCodeTest({
'build_exe': 1, 'build_exe': 1,
'qemu_command': 'qemu-arm -cpu cortex-a8', 'qemu_command': 'qemu-arm -cpu cortex-a8',
'toolchain': 'ARM/arm-eabi', 'toolchain': 'ARM/arm-eabi',
'ccflags': '-mthumb -L %(toolchain_dir)s/lib/gcc/arm-eabi/%(gcc_version)s/thumb -lgcc', 'ccflags': '-mthumb -DTHUMB -march=armv7-a+simd',
'gcc_libdir': '%(toolchain_dir)s/lib/gcc/arm-eabi/%(gcc_version)s/thumb',
'cclibs': '-lgcc',
'language_id': 'ARM:LE:32:v7', 'language_id': 'ARM:LE:32:v7',
'proc_test': 'arm', 'proc_test': 'arm',
}) })
@ -110,7 +132,9 @@ PCodeTest({
'name': 'ARM_BE_thumb', 'name': 'ARM_BE_thumb',
'build_all': 1, 'build_all': 1,
'toolchain': 'ARM/armbe-eabi', 'toolchain': 'ARM/armbe-eabi',
'ccflags': '-mthumb -mbig-endian -L %(toolchain_dir)s/lib/gcc/armbe-eabi/%(gcc_version)s/thumb -lgcc', 'ccflags': '-mthumb -DTHUMB -mbig-endian',
'gcc_libdir': '%(toolchain_dir)s/lib/gcc/arm-eabi/%(gcc_version)s/thumb',
'cclibs': '-lgcc',
'language_id': 'ARM:BE:32:v7', 'language_id': 'ARM:BE:32:v7',
'proc_test': 'arm', 'proc_test': 'arm',
'has_float': 0, 'has_float': 0,
@ -124,7 +148,9 @@ PCodeTest({
'build_exe': 1, 'build_exe': 1,
'qemu_command': 'qemu-arm -cpu cortex-a8', 'qemu_command': 'qemu-arm -cpu cortex-a8',
'toolchain': 'ARM/arm-eabi', 'toolchain': 'ARM/arm-eabi',
'ccflags': '-mthumb -mcpu=cortex-a8 -mfloat-abi=softfp -L %(toolchain_dir)s/lib/gcc/arm-eabi/%(gcc_version)s/thumb -lgcc', 'ccflags': '-mthumb -DTHUMB -mcpu=cortex-a8 -mfloat-abi=softfp',
'gcc_libdir': '%(toolchain_dir)s/lib/gcc/arm-eabi/%(gcc_version)s/thumb',
'cclibs': '-lgcc',
'language_id': 'ARM:LE:32:v7', 'language_id': 'ARM:LE:32:v7',
'proc_test': 'arm', 'proc_test': 'arm',
}) })
@ -135,7 +161,9 @@ PCodeTest({
'build_exe': 1, 'build_exe': 1,
'qemu_command': 'qemu-arm -cpu cortex-m33', 'qemu_command': 'qemu-arm -cpu cortex-m33',
'toolchain': 'ARM/arm-eabi', 'toolchain': 'ARM/arm-eabi',
'ccflags': '-mthumb -march=armv8-m.main -mfloat-abi=softfp -L %(toolchain_dir)s/lib/gcc/arm-eabi/%(gcc_version)s/thumb -lgcc', 'ccflags': '-mthumb -DTHUMB -march=armv8-m.main -mfloat-abi=softfp',
'gcc_libdir': '%(toolchain_dir)s/lib/gcc/arm-eabi/%(gcc_version)s/thumb',
'cclibs': '-lgcc',
'language_id': 'ARM:LE:32:Cortexv8m', 'language_id': 'ARM:LE:32:Cortexv8m',
}) })
@ -174,6 +202,7 @@ PCodeTest({
'build_all': 1, 'build_all': 1,
'toolchain': 'AVR/avr-elf', 'toolchain': 'AVR/avr-elf',
'ccflags': '-mmcu=avr6 -lgcc', 'ccflags': '-mmcu=avr6 -lgcc',
'cclibs': '-lgcc',
'language_id': 'avr32:BE:32:default', 'language_id': 'avr32:BE:32:default',
'processor': 'Atmel', 'processor': 'Atmel',
'has_float': 0, 'has_float': 0,
@ -184,6 +213,7 @@ PCodeTest({
'name': 'AVR8_31', 'name': 'AVR8_31',
'toolchain': 'AVR/avr-elf', 'toolchain': 'AVR/avr-elf',
'ccflags': '-mmcu=avr31 -lgcc', 'ccflags': '-mmcu=avr31 -lgcc',
'cclibs': '-lgcc',
'language_id': 'avr8:LE:16:default', 'language_id': 'avr8:LE:16:default',
'has_float': 0, 'has_float': 0,
'has_double': 0, 'has_double': 0,
@ -206,6 +236,7 @@ PCodeTest({
'name': 'AVR8_6', 'name': 'AVR8_6',
'toolchain': 'AVR/avr-elf', 'toolchain': 'AVR/avr-elf',
'ccflags': '-mmcu=avr6 -lgcc', 'ccflags': '-mmcu=avr6 -lgcc',
'cclibs': '-lgcc',
'language_id': 'avr8:LE:16:atmega256', 'language_id': 'avr8:LE:16:atmega256',
'has_float': 0, 'has_float': 0,
'has_double': 0, 'has_double': 0,
@ -223,7 +254,19 @@ PCodeTest({
'name': 'HPPA1.1', 'name': 'HPPA1.1',
'build_all': 1, 'build_all': 1,
'toolchain': 'HPPA/hppa-linux', 'toolchain': 'HPPA/hppa-linux',
'ccflags': '-march=1.1 -static -mlong-calls -L %(toolchain_dir)s/lib/gcc/hppa-linux/%(gcc_version)s -lgcc', 'ccflags': '-march=1.1 -static -mlong-calls',
'cclibs': '-lgcc',
'language_id': 'pa-risc:BE:32:default',
'processor': 'PA-RISC',
'architecture_test': 'PARISC',
})
PCodeTest({
'name': 'HPPA2.0',
'build_all': 1,
'toolchain': 'HPPA/hppa-linux',
'ccflags': '-march=2.0 -static -mlong-calls',
'cclibs': '-lgcc',
'language_id': 'pa-risc:BE:32:default', 'language_id': 'pa-risc:BE:32:default',
'processor': 'PA-RISC', 'processor': 'PA-RISC',
'architecture_test': 'PARISC', 'architecture_test': 'PARISC',
@ -233,11 +276,9 @@ PCodeTest({
'name': 'Loongarch64', 'name': 'Loongarch64',
'build_all': 1, 'build_all': 1,
'build_exe': 0, 'build_exe': 0,
'gcc_version': '12.3.0',
'qemu_command': 'qemu-loongarch64', 'qemu_command': 'qemu-loongarch64',
'target': 'loongson-linux', 'toolchain': 'LoongArch/loongarch64-linux-gnu',
'toolchain': '%(name)s/%(target)s', #%(toolchain_dir)s/lib/gcc/loongarch64-linux/%(gcc_version)s 'ccflags': '-march=loongarch64 -mabi=lp64d',
'ccflags': '-march=loongarch64 -mabi=lp64d -L /local/cross/lib/gcc/loongarch64-linux/12.3.0/ -lgcc',
'language_id': 'Loongarch:LE:64:default', 'language_id': 'Loongarch:LE:64:default',
#'has_longlong': 0, #'has_longlong': 0,
}) })
@ -249,8 +290,9 @@ PCodeTest({
'gcc_version': '12.3.0', 'gcc_version': '12.3.0',
'qemu_command': 'qemu-loongarch64', 'qemu_command': 'qemu-loongarch64',
'target': 'loongson-linux', 'target': 'loongson-linux',
'toolchain': 'Loongarch64/%(target)s', #%(toolchain_dir)s/lib/gcc/loongarch64-linux/%(gcc_version)s 'toolchain': 'LoongArch/loongarch64-linux-gnu',
'ccflags': '-march=loongarch64 -mabi=lp64f -mfpu=32 -L /local/cross/lib/gcc/loongarch64-linux/12.3.0/ -lgcc', 'ccflags': '-march=loongarch64 -mabi=lp64f',
#'cclibs': '-lgcc',
'language_id': 'Loongarch:LE:64:lp64f', 'language_id': 'Loongarch:LE:64:lp64f',
'has_double': 0, 'has_double': 0,
}) })
@ -264,7 +306,8 @@ PCodeTest({
'build_exe': 0, 'build_exe': 0,
'qemu_command': 'qemu-m68k', # qemu: fatal: Illegal instruction 'qemu_command': 'qemu-m68k', # qemu: fatal: Illegal instruction
'toolchain': 'm68k/m68k-elf', 'toolchain': 'm68k/m68k-elf',
'ccflags': '-mcpu=68020 -m68020 -L %(toolchain_dir)s/lib/gcc/m68k-elf/%(gcc_version)s -lgcc', 'ccflags': '-mcpu=68020 -m68020',
'cclibs': '-lgcc',
'language_id': '68000:BE:32:default', 'language_id': '68000:BE:32:default',
}) })
@ -274,7 +317,9 @@ PCodeTest({
'build_exe': 1, 'build_exe': 1,
'qemu_command': 'qemu-mips', 'qemu_command': 'qemu-mips',
'toolchain': 'MIPS/mips-elf', 'toolchain': 'MIPS/mips-elf',
'ccflags': '-L %(toolchain_dir)s/lib/gcc/mips-mti-elf/%(gcc_version)s -lgcc -mno-gpopt', 'ccflags': '-mno-gpopt',
'gcc_libdir': '%(toolchain_dir)s/lib/gcc/mips-mti-elf/%(gcc_actual_version)s',
'cclibs': '-lgcc',
'language_id': 'MIPS:BE:32:default', 'language_id': 'MIPS:BE:32:default',
}) })
@ -283,7 +328,9 @@ PCodeTest({
'build_all': 1, 'build_all': 1,
'build_exe': 1, 'build_exe': 1,
'toolchain': 'MIPS/mips-elf', 'toolchain': 'MIPS/mips-elf',
'ccflags': '-L %(toolchain_dir)s/lib/gcc/mips-mti-elf/%(gcc_version)s/el -lgcc -mno-gpopt -mel', 'ccflags': '-mno-gpopt -mel',
'gcc_libdir': '%(toolchain_dir)s/lib/gcc/mips-mti-elf/%(gcc_actual_version)s/el',
'cclibs': '-lgcc',
'language_id': 'MIPS:LE:32:default', 'language_id': 'MIPS:LE:32:default',
}) })
@ -317,7 +364,9 @@ PCodeTest({
'name': 'MIPSMIC', 'name': 'MIPSMIC',
'build_all': 1, 'build_all': 1,
'toolchain': 'MIPS/mips-elf', 'toolchain': 'MIPS/mips-elf',
'ccflags': '-mmicromips -L %(toolchain_dir)s/lib/gcc/mips-mti-elf/%(gcc_version)s/micromips -lgcc', 'ccflags': '-mmicromips',
'gcc_libdir': '%(toolchain_dir)s/lib/gcc/mips-mti-elf/%(gcc_actual_version)s/micromips',
'cclibs': '-lgcc',
'language_id': 'MIPS:BE:32:micro', 'language_id': 'MIPS:BE:32:micro',
'architecture_test': 'MIPSMICRO', 'architecture_test': 'MIPSMICRO',
}) })
@ -326,7 +375,9 @@ PCodeTest({
'name': 'MIPSMICMIX', 'name': 'MIPSMICMIX',
'build_all': 1, 'build_all': 1,
'toolchain': 'MIPS/mips-elf', 'toolchain': 'MIPS/mips-elf',
'ccflags': '-minterlink-compressed -D BODYNEW=micromips -L %(toolchain_dir)s/lib/gcc/mips-mti-elf/%(gcc_version)s/micromips -lgcc', 'ccflags': '-minterlink-compressed -D BODYNEW=micromips',
'gcc_libdir': '%(toolchain_dir)s/lib/gcc/mips-mti-elf/%(gcc_actual_version)s/micromips',
'cclibs': '-lgcc',
'language_id': 'MIPS:BE:32:micro', 'language_id': 'MIPS:BE:32:micro',
'architecture_test': 'MIPSMICROMIX', 'architecture_test': 'MIPSMICROMIX',
}) })
@ -367,7 +418,9 @@ PCodeTest({
'name': 'MIPSR6', 'name': 'MIPSR6',
'build_all': 1, 'build_all': 1,
'toolchain': 'MIPS/mipsr6-elf', 'toolchain': 'MIPS/mipsr6-elf',
'ccflags': '-mips32r6 -L %(toolchain_dir)s/lib/gcc/mips-mti-elf/%(gcc_version)s -lgcc', 'ccflags': '-mips32r6',
'gcc_libdir': '-L %(toolchain_dir)s/lib/gcc/mips-img-elf/%(gcc_actual_version)s',
'cclibs': '-lgcc',
'language_id': 'MIPS:BE:32:R6', 'language_id': 'MIPS:BE:32:R6',
}) })
@ -383,7 +436,8 @@ PCodeTest({
'name': 'NDS32BE', 'name': 'NDS32BE',
'build_all': 1, 'build_all': 1,
'toolchain': 'NDS32/nds32be-elf', 'toolchain': 'NDS32/nds32be-elf',
'ccflags': '-L %(toolchain_dir)s/lib/gcc/nds32be-linux-elf/%(gcc_version)s -lgcc', 'ccflags': '',
'cclibs': '-lgcc',
'language_id': 'NDS32:BE:32:default', 'language_id': 'NDS32:BE:32:default',
}) })
@ -391,14 +445,16 @@ PCodeTest({
'name': 'NDS32LE', 'name': 'NDS32LE',
'build_all': 1, 'build_all': 1,
'toolchain': 'NDS32/nds32le-elf', 'toolchain': 'NDS32/nds32le-elf',
'ccflags': '-L %(toolchain_dir)s/lib/gcc/nds32le-linux-elf/%(gcc_version)s -lgcc', 'ccflags': '',
'cclibs': '-lgcc',
'language_id': 'NDS32:LE:32:default', 'language_id': 'NDS32:LE:32:default',
}) })
PCodeTest({ PCodeTest({
'name': 'power6', 'name': 'power6',
'toolchain': 'PPC/powerpc-elf', 'toolchain': 'PPC/powerpc-elf',
'ccflags': '-mcpu=G5 -m32 -mno-relocatable -L %(toolchain_dir)s/lib/gcc/powerpc-elf/%(gcc_version)s -lgcc', 'ccflags': '-mcpu=G5 -m32 -mno-relocatable',
'cclibs': '-lgcc',
'language_id': 'PowerPC:BE:32:default', 'language_id': 'PowerPC:BE:32:default',
}) })
@ -408,7 +464,8 @@ PCodeTest({
'build_exe': 1, 'build_exe': 1,
'qemu_command': 'qemu-ppc64abi32', 'qemu_command': 'qemu-ppc64abi32',
'toolchain': 'PPC/powerpc-elf', 'toolchain': 'PPC/powerpc-elf',
'ccflags': '-mcpu=powerpc -m32 -maltivec -mno-relocatable -L %(toolchain_dir)s/lib/gcc/powerpc-elf/%(gcc_version)s -lgcc', 'ccflags': '-mcpu=powerpc -m32 -maltivec -mno-relocatable',
'cclibs': '-lgcc',
'language_id': 'PowerPC:BE:32:default', 'language_id': 'PowerPC:BE:32:default',
'architecture_test': 'PPC', 'architecture_test': 'PPC',
}) })
@ -419,7 +476,8 @@ PCodeTest({
'build_exe': 1, 'build_exe': 1,
'qemu_command': 'qemu-ppc64', 'qemu_command': 'qemu-ppc64',
'toolchain': 'PPC/powerpc64-linux', 'toolchain': 'PPC/powerpc64-linux',
'ccflags': '-mabi=elfv1 -maltivec -mno-relocatable -L %(toolchain_dir)s/lib/gcc/powerpc-elf/%(gcc_version)s -lgcc', 'ccflags': '-mabi=elfv1 -maltivec -mno-relocatable',
'cclibs': '-lgcc',
'language_id': 'PowerPC:BE:64:default', 'language_id': 'PowerPC:BE:64:default',
'architecture_test': 'PPC64', 'architecture_test': 'PPC64',
}) })
@ -427,7 +485,8 @@ PCodeTest({
PCodeTest({ PCodeTest({
'name': 'powerpc64v2', 'name': 'powerpc64v2',
'toolchain': 'PPC/powerpc64-linux', 'toolchain': 'PPC/powerpc64-linux',
'ccflags': '-mabi=elfv2 -maltivec -mno-relocatable -L %(toolchain_dir)s/lib/gcc/powerpc-elf/%(gcc_version)s -lgcc', 'ccflags': '-mabi=elfv2 -maltivec -mno-relocatable',
'cclibs': '-lgcc',
'language_id': 'PowerPC:BE:64:default', 'language_id': 'PowerPC:BE:64:default',
}) })
@ -435,7 +494,8 @@ PCodeTest({
'name': 'ppcA2', 'name': 'ppcA2',
'build_all': 1, 'build_all': 1,
'toolchain': 'PPC/powerpc-elf', 'toolchain': 'PPC/powerpc-elf',
'ccflags': '-mcpu=a2 -L %(toolchain_dir)s/lib/gcc/powerpc-elf/%(gcc_version)s -lgcc', 'ccflags': '-mcpu=a2',
'cclibs': '-lgcc',
'language_id': 'PowerPC:BE:32:A2', 'language_id': 'PowerPC:BE:32:A2',
'architecture_test': 'PPCA2', 'architecture_test': 'PPCA2',
}) })
@ -444,7 +504,8 @@ PCodeTest({
'name': 'ppcA2Alt', 'name': 'ppcA2Alt',
'build_all': 1, 'build_all': 1,
'toolchain': 'PPC/powerpc-elf', 'toolchain': 'PPC/powerpc-elf',
'ccflags': '-mcpu=a2 -maltivec -L %(toolchain_dir)s/lib/gcc/powerpc-elf/%(gcc_version)s -lgcc', 'ccflags': '-mcpu=a2 -maltivec',
'cclibs': '-lgcc',
'language_id': 'PowerPC:BE:32:A2ALT', 'language_id': 'PowerPC:BE:32:A2ALT',
'architecture_test': 'PPCA2Alt', 'architecture_test': 'PPCA2Alt',
}) })
@ -453,7 +514,8 @@ PCodeTest({
'name': 'ppcP8Alt', 'name': 'ppcP8Alt',
'build_all': 1, 'build_all': 1,
'toolchain': 'PPC/powerpc-elf', 'toolchain': 'PPC/powerpc-elf',
'ccflags': '-mcpu=power8 -mvsx -maltivec -L %(toolchain_dir)s/lib/gcc/powerpc-elf/%(gcc_version)s -lgcc', 'ccflags': '-mcpu=power8 -mvsx -maltivec',
'cclibs': '-lgcc',
'language_id': 'PowerPC:BE:32:A2ALT', 'language_id': 'PowerPC:BE:32:A2ALT',
'architecture_test': 'PPCP8Alt', 'architecture_test': 'PPCP8Alt',
}) })
@ -462,7 +524,8 @@ PCodeTest({
'name': 'ppcP9Alt', 'name': 'ppcP9Alt',
'build_all': 1, 'build_all': 1,
'toolchain': 'PPC/powerpc-elf', 'toolchain': 'PPC/powerpc-elf',
'ccflags': '-mcpu=power9 -mvsx -maltivec -L %(toolchain_dir)s/lib/gcc/powerpc-elf/%(gcc_version)s -lgcc', 'ccflags': '-mcpu=power9 -mvsx -maltivec',
'cclibs': '-lgcc',
'language_id': 'PowerPC:BE:32:A2ALT', 'language_id': 'PowerPC:BE:32:A2ALT',
'architecture_test': 'PPCP9Alt', 'architecture_test': 'PPCP9Alt',
}) })
@ -470,8 +533,9 @@ PCodeTest({
PCodeTest({ PCodeTest({
'name': 'msp430x', 'name': 'msp430x',
'build_all': 1, 'build_all': 1,
'toolchain': 'TI/msp430-gcc-9.3.1.11_linux64', 'toolchain': 'TI/msp430-elf',
'ccflags': '-g -mcpu=msp430x -mlarge -mhwmult=none -fno-builtin -Wl,-T,msp430x.ld -L %(toolchain_dir)s/lib/gcc/msp430-elf/%(gcc_version)s/large/ -lgcc -lmul_none', 'ccflags': '-g -mcpu=msp430x -mlarge -mhwmult=none -fno-builtin -Wl,-T,msp430x.ld',
'cclibs': '-lgcc -lmul_none',
'language_id': 'TI_MSP430X:LE:32:default', 'language_id': 'TI_MSP430X:LE:32:default',
'processor': 'TI', 'processor': 'TI',
'architecture_test': 'MSP430X', 'architecture_test': 'MSP430X',
@ -485,8 +549,9 @@ PCodeTest({
PCodeTest({ PCodeTest({
'name': 'msp430', 'name': 'msp430',
'build_all': 1, 'build_all': 1,
'toolchain': 'TI/msp430-gcc-9.3.1.11_linux64', 'toolchain': 'TI/msp430-elf',
'ccflags': '-g -mcpu=msp430 -fno-builtin -mhwmult=none -lgcc -lmul_none', 'ccflags': '-g -mcpu=msp430 -fno-builtin -mhwmult=none',
'cclibs': '-lgcc -lmul_none',
'language_id': 'TI_MSP430:LE:16:default', 'language_id': 'TI_MSP430:LE:16:default',
'processor': 'TI', 'processor': 'TI',
'architecture_test': 'MSP430', 'architecture_test': 'MSP430',
@ -502,7 +567,8 @@ PCodeTest({
'build_exe': 0, 'build_exe': 0,
'qemu_command': 'qemu-sh4eb', # qemu gets "Invalid argument" error 'qemu_command': 'qemu-sh4eb', # qemu gets "Invalid argument" error
'toolchain': 'SuperH4/sh4-elf', 'toolchain': 'SuperH4/sh4-elf',
'ccflags': '-mb -mrenesas -m4 -L %(toolchain_dir)s/lib/gcc/sh4-elf/%(gcc_version)s -lgcc', 'ccflags': '-mb -mrenesas -m4',
'cclibs': '-lgcc',
'language_id': 'SuperH4:BE:32:default', 'language_id': 'SuperH4:BE:32:default',
'architecture_test': 'SuperH4_BE', 'architecture_test': 'SuperH4_BE',
}) })
@ -511,7 +577,8 @@ PCodeTest({
'name': 'SH4_LE', 'name': 'SH4_LE',
'build_all': 1, 'build_all': 1,
'toolchain': 'SuperH4/sh4le-elf', 'toolchain': 'SuperH4/sh4le-elf',
'ccflags': '-ml -mrenesas -m4 -L %(toolchain_dir)s/lib/gcc/sh4le-elf/%(gcc_version)s -lgcc', 'ccflags': '-ml -mrenesas -m4',
'cclibs': '-lgcc',
'language_id': 'SuperH4:LE:32:default', 'language_id': 'SuperH4:LE:32:default',
'architecture_test': 'SuperH4', 'architecture_test': 'SuperH4',
}) })
@ -548,7 +615,8 @@ PCodeTest({
'build_exe': 1, 'build_exe': 1,
'qemu_command': 'qemu-i386', 'qemu_command': 'qemu-i386',
'toolchain': 'x86/i386-elf-linux', 'toolchain': 'x86/i386-elf-linux',
'ccflags': '-march=pentium -m32 -L %(toolchain_dir)s/lib/gcc/i386-elf-linux/%(gcc_version)s -lgcc', 'ccflags': '-march=pentium -m32',
'cclibs': '-lgcc',
'objdump_option': '-M intel', 'objdump_option': '-M intel',
'language_id': 'x86:LE:32:default', 'language_id': 'x86:LE:32:default',
'architecture_test': 'X86m32', 'architecture_test': 'X86m32',
@ -559,7 +627,7 @@ PCodeTest({
'name': 'i386_CLANG', 'name': 'i386_CLANG',
'toolchain': 'LLVM/llvm', 'toolchain': 'LLVM/llvm',
'toolchain_type': 'llvm', 'toolchain_type': 'llvm',
'ccflags': '--target=i386', 'ccflags': '--target=i386 -DU4="unsigned __INT32_TYPE__" -DI4="signed __INT32_TYPE__',
'objdump_option': '-M intel', 'objdump_option': '-M intel',
'language_id': 'x86:LE:32:default', 'language_id': 'x86:LE:32:default',
}) })
@ -568,7 +636,7 @@ PCodeTest({
'name': 'i686_CLANG', 'name': 'i686_CLANG',
'toolchain': 'LLVM/llvm', 'toolchain': 'LLVM/llvm',
'toolchain_type': 'llvm', 'toolchain_type': 'llvm',
'ccflags': '--target=i686', 'ccflags': '--target=i686 -DU4="unsigned __INT32_TYPE__" -DI4="signed __INT32_TYPE__',
'objdump_option': '-M intel', 'objdump_option': '-M intel',
'language_id': 'x86:LE:32:default', 'language_id': 'x86:LE:32:default',
}) })
@ -640,7 +708,9 @@ PCodeTest({
'objdump_exe': 'bin/xc16-objdump', 'objdump_exe': 'bin/xc16-objdump',
'readelf_exe': 'bin/xc16-readelf', 'readelf_exe': 'bin/xc16-readelf',
'nm_exe': 'bin/xc16-nm', 'nm_exe': 'bin/xc16-nm',
'ccflags': '-mcpu=30F2011 -DINT4_IS_LONG -Xlinker --defsym -Xlinker _main=0x0 -L %(toolchain_dir)s/lib -lpic30 -lc -lm', 'ccflags': '-mcpu=30F2011 -DI4="signed long" -DU4="unsigned long" -DF8="long double" -Xlinker --defsym -Xlinker _main=0x0',
'gcc_libdir': '%(toolchain_dir)s/lib',
'cclibs': '-lpic30 -lc -lm',
'language_id': 'dsPIC30F:LE:24:default', 'language_id': 'dsPIC30F:LE:24:default',
'skip_files': ['misc.test'], 'skip_files': ['misc.test'],
'variants': {'O0': '-O0'}, 'variants': {'O0': '-O0'},
@ -652,7 +722,9 @@ PCodeTest({
'toolchain': 'PIC/xc8', 'toolchain': 'PIC/xc8',
'compile_exe': 'bin/xc8', 'compile_exe': 'bin/xc8',
'objdump_exe': 'bin/dump', 'objdump_exe': 'bin/dump',
'ccflags': '-chip=16C57 -DINT4_IS_LONG -DSTATIC_MAIN -L %(toolchain_dir)s/lib -lpic30 -lc -lm', 'ccflags': '-chip=16C57 -DI4="signed long" -DU4="unsigned long" -DSTATIC_MAIN',
'gcc_libdir': '%(toolchain_dir)s/lib',
'cclibs': '-lpic30 -lc -lm',
'language_id': 'dsPIC16F:LE:24:default', 'language_id': 'dsPIC16F:LE:24:default',
'small_build': 1, 'small_build': 1,
}) })
@ -674,7 +746,7 @@ PCodeTest({
'toolchain': 'SDCC/z80', 'toolchain': 'SDCC/z80',
'toolchain_type': 'sdcc', 'toolchain_type': 'sdcc',
'compile_exe': 'bin/sdcc', 'compile_exe': 'bin/sdcc',
'ccflags': '-mz80 -V --verbose --std-sdcc11 -DINT4_IS_LONG', 'ccflags': '-mz80 -V --verbose --std-sdcc11 -DI4="signed long" -DU4="unsigned long"',
'language_id': 'z80:LE:16:default', 'language_id': 'z80:LE:16:default',
'variants': {'OX':''}, 'variants': {'OX':''},
'has_float': 0, 'has_float': 0,
@ -714,6 +786,33 @@ PCodeTest({
'has_longlong': 0, 'has_longlong': 0,
}) })
PCodeTest({
'name': 'V850',
'build_all': 1,
'build_exe': 1,
'toolchain': 'V850/v850-elf',
'language_id': 'V850:LE:32:default',
'ccflags': '-mv850e2v3 -lgcc',
})
PCodeTest({
'name': 'RH850',
'build_all': 1,
'build_exe': 1,
'toolchain': 'V850/v850-elf',
'language_id': 'V850:LE:32:v850e3v5',
'ccflags': '-mv850e3v5 -mloop -mrh850-abi -lgcc',
})
PCodeTest({
'name': 'Xtensa',
'build_all': 1,
'build_exe': 1,
'toolchain': 'Xtensa/xtensa-elf',
'language_id': 'Xtensa:LE:32:default',
'ccflags': '-lgcc',
})
PCodeTest({ PCodeTest({
'name': 'Xtensa_LE', 'name': 'Xtensa_LE',
'build_all': 1, 'build_all': 1,

View file

@ -19,6 +19,7 @@ import re
import fnmatch import fnmatch
from build import Config, BuildUtil from build import Config, BuildUtil
from defaults import *
class PCodeTest(BuildUtil): class PCodeTest(BuildUtil):
@ -27,10 +28,9 @@ class PCodeTest(BuildUtil):
def __init__(self, conf): def __init__(self, conf):
super(PCodeTest, self).__init__() super(PCodeTest, self).__init__()
self.config = Config(PCodeTest.defaults, conf) self.config = Config(pcodeTestDefaults, conf)
# calculate the toolchain_dir # calculate the toolchain_dir
self.config.toolchain_dir = self.config.format('%(toolchain_root)s/%(toolchain)s-gcc-%(gcc_version)s') self.config.toolchain_dir = self.config.format('%(toolchain_root)s/%(toolchain)s-gcc-%(gcc_config)s')
if not self.isdir(self.config.toolchain_dir): if not self.isdir(self.config.toolchain_dir):
self.config.toolchain_dir = self.config.format('%(toolchain_root)s/%(toolchain)s') self.config.toolchain_dir = self.config.format('%(toolchain_root)s/%(toolchain)s')
@ -39,16 +39,13 @@ class PCodeTest(BuildUtil):
# can default the Processor directory name, usually the # can default the Processor directory name, usually the
# initial string of 'language_id' (otherwise unused). # initial string of 'language_id' (otherwise unused).
if self.config.language_id: if self.config.language_id:
self.config.processor = self.config.language_id.split(':')[0] self.config.processor = self.config.language_id.split(':')[0]
# expand all of the variables with printf escapes # expand all of the variables with printf escapes
self.config.expand() self.config.expand()
# save the new PCodeTest in a dictionary for auto-enumeration # save the new PCodeTest in a dictionary for auto-enumeration
PCodeTest.list[self.config.name] = self PCodeTest.list[self.config.name] = self
@classmethod @classmethod
@ -97,10 +94,11 @@ class PCodeTestBuild(BuildUtil):
return return
# save path to tpp # save path to tpp
tpp_py = os.getcwd() + '/tpp.py' tpp_py = os.path.join(os.path.dirname(os.path.abspath(__file__)),'tpp.py')
# Get a list of strings to filter input files # Get a list of strings to filter input files
available_files = sorted(glob.glob(self.config.format('%(pcodetest_src)s/*'))) available_files = sorted(glob.glob(self.config.format('%(pcodetest_src)s/*')))
if self.config.proc_test: if self.config.proc_test:
available_files.extend(sorted(glob.glob(self.config.format('%(pcodetest_src)s/%(proc_test)s/*')))) available_files.extend(sorted(glob.glob(self.config.format('%(pcodetest_src)s/%(proc_test)s/*'))))
@ -127,7 +125,6 @@ class PCodeTestBuild(BuildUtil):
# This is the base name of the binary file, or for small # This is the base name of the binary file, or for small
# build, the directory name that will hold the small # build, the directory name that will hold the small
# binaries # binaries
out_name = '%s_%s_%s_pcodetest' % (self.config.name, self.config.toolchain_type.upper(), opt_name) out_name = '%s_%s_%s_pcodetest' % (self.config.name, self.config.toolchain_type.upper(), opt_name)
if self.config.architecture_test: pcodetest_base_name = self.config.architecture_test if self.config.architecture_test: pcodetest_base_name = self.config.architecture_test
else: pcodetest_base_name = self.config.architecture else: pcodetest_base_name = self.config.architecture
@ -137,8 +134,8 @@ class PCodeTestBuild(BuildUtil):
# This does not rebuild if the output directory is newer than the # This does not rebuild if the output directory is newer than the
# input files. So it needs to know where the build # input files. So it needs to know where the build
# directory would be, before it is recreated. # directory would be, before it is recreated.
build_dir = self.build_dir(self.config.build_root, kind, out_name) build_dir = self.build_dir(self.config.build_root, kind, out_name)
need_to_build = self.config.force or not self.isdir(build_dir) need_to_build = self.config.force or not self.isdir(build_dir)
if not need_to_build: if not need_to_build:
mtime = self.getmtime(build_dir) mtime = self.getmtime(build_dir)
@ -157,11 +154,9 @@ class PCodeTestBuild(BuildUtil):
for f in available_files: self.copy(f, '.', verbose=False) for f in available_files: self.copy(f, '.', verbose=False)
# if requested, add an info file # if requested, add an info file
if self.config.add_info: self.mkinfo('INFO.c') if self.config.add_info: self.mkinfo('INFO.c')
# make tests, if needed # make tests, if needed
for f_test in glob.glob('*.test'): for f_test in glob.glob('*.test'):
f_h = re.sub(r'[.]test', '.h', f_test) f_h = re.sub(r'[.]test', '.h', f_test)
if self.isfile(f_h) and self.getmtime(f_test) <= self.getmtime(f_h): continue if self.isfile(f_h) and self.getmtime(f_test) <= self.getmtime(f_h): continue
@ -184,14 +179,12 @@ class PCodeTestBuild(BuildUtil):
self.log_info('**** SMALL BUILD ****') self.log_info('**** SMALL BUILD ****')
# Remove the previous directory, if it was there # Remove the previous directory, if it was there
build_dir = '%s/build-PCodeTest-%s/%s' % (self.config.build_root, out_name, out_name) build_dir = '%s/build-PCodeTest-%s/%s' % (self.config.build_root, out_name, out_name)
try: self.rmtree(build_dir) try: self.rmtree(build_dir)
except: pass except: pass
# Each small file ends with _BODY.c and it has a # Each small file ends with _BODY.c and it has a
# companion without _BODY. # companion without _BODY.
for body_file in smallFiles: for body_file in smallFiles:
small_name = body_file.replace('_BODY.c', '') small_name = body_file.replace('_BODY.c', '')
companion_file = small_name + '.c' companion_file = small_name + '.c'
@ -240,20 +233,20 @@ class PCodeBuildSDCC(PCodeTestBuild):
f += ['-DNAME=NAME:%s' % output_file] f += ['-DNAME=NAME:%s' % output_file]
f += self.config.ccflags.split() f += [self.config.format(g) for g in self.config.ccflags.split()]
f += self.config.add_ccflags.split() f += [self.config.format(g) for g in self.config.add_ccflags.split()]
f += [self.config.format(g) for g in self.config.cclibs.split()]
f += [self.config.format(g) for g in self.config.add_cclibs.split()]
return f return f
def compile(self, input_files, opt_cflag, output_base): def compile(self, input_files, opt_cflag, output_base):
# Name the output file, and delete it if it exists # Name the output file, and delete it if it exists
output_file = '%s.out' % (output_base) output_file = '%s.out' % (output_base)
self.remove(output_file) self.remove(output_file)
# Construct the compile command line and execute it # Construct the compile command line and execute it
cmp = self.which('compile_exe') cmp = self.which('compile_exe')
cmd = [cmp] + input_files + self.cflags(output_file) cmd = [cmp] + input_files + self.cflags(output_file)
if opt_cflag: cmd += [opt_cflag] if opt_cflag: cmd += [opt_cflag]
@ -265,7 +258,6 @@ class PCodeBuildSDCC(PCodeTestBuild):
if err: self.log_warn(err) if err: self.log_warn(err)
# return now if the error preempted the binary # return now if the error preempted the binary
if not self.is_readable_file(output_file): if not self.is_readable_file(output_file):
self.log_err('output not created %s' % output_file) self.log_err('output not created %s' % output_file)
return return
@ -289,8 +281,10 @@ class PCodeBuildCCS(PCodeTestBuild):
f += ['-DNAME=NAME:%s' % output_file] f += ['-DNAME=NAME:%s' % output_file]
f += self.config.ccflags.split() f += [self.config.format(g) for g in self.config.ccflags.split()]
f += self.config.add_ccflags.split() f += [self.config.format(g) for g in self.config.add_ccflags.split()]
f += [self.config.format(g) for g in self.config.cclibs.split()]
f += [self.config.format(g) for g in self.config.add_cclibs.split()]
return f return f
@ -302,11 +296,9 @@ class PCodeBuildCCS(PCodeTestBuild):
self.remove(output_file) self.remove(output_file)
# Construct the compile command line and execute it # Construct the compile command line and execute it
cmp = self.which('compile_exe') cmp = self.which('compile_exe')
cmd = [cmp] + input_files + self.cflags(output_file) + [opt_cflag] cmd = [cmp] + input_files + self.cflags(output_file) + [opt_cflag]
cmd += ['-z', '-h', '-e', 'printf5'] cmd += ['-z', '-off', '-llibc.a', '--make_global=noteTestMain', '--retain=*_main', '-cr', '-m', '%s.map'%(output_base), '-h', '--unused_section_elimination=off']
cmd += [self.config.format('%(toolchain_dir)s/tools/compiler/ti-cgt-msp430_16.9.0.LTS/lib/libc.a')]
cmd += ['-o', output_file] cmd += ['-o', output_file]
out, err = self.run(cmd) out, err = self.run(cmd)
if out: self.log_info(out) if out: self.log_info(out)
@ -315,7 +307,6 @@ class PCodeBuildCCS(PCodeTestBuild):
if err: self.log_warn(err) if err: self.log_warn(err)
# return now if the error preempted the binary # return now if the error preempted the binary
if not self.is_readable_file(output_file): if not self.is_readable_file(output_file):
self.log_err('output not created %s' % output_file) self.log_err('output not created %s' % output_file)
return return
@ -345,7 +336,7 @@ class PCodeBuildGCC(PCodeTestBuild):
out, err = self.run([self.which('objdump_exe')] out, err = self.run([self.which('objdump_exe')]
+ self.config.objdump_option.split() + self.config.objdump_option.split()
+ ['-d', bin], stdout=('%s.d' % base)) + ['-S','-d', bin], stdout=('%s.d' % base))
if err: self.log_warn(err) if err: self.log_warn(err)
out, err = self.run([self.which('objdump_exe')] out, err = self.run([self.which('objdump_exe')]
@ -374,7 +365,7 @@ class PCodeBuildGCC(PCodeTestBuild):
if err: self.log_warn(err) if err: self.log_warn(err)
out, err = self.run(['grep', ' U ', '%s.nm' % base]) out, err = self.run(['grep', ' U ', '%s.nm' % base])
if out: self.log_warn('** UNRESOLVED:\n' + out + '**END') if out: self.log_warn('** UNRESOLVED:\n' + str(out) + '**END')
if err: self.log_warn(err) if err: self.log_warn(err)
# Set options for compiler depending on needs. # Set options for compiler depending on needs.
@ -389,9 +380,26 @@ class PCodeBuildGCC(PCodeTestBuild):
if self.config.has_decimal32: f += ['-DHAS_DECIMAL32=1'] if self.config.has_decimal32: f += ['-DHAS_DECIMAL32=1']
if self.config.has_decimal64: f += ['-DHAS_DECIMAL64=1'] if self.config.has_decimal64: f += ['-DHAS_DECIMAL64=1']
if self.config.gcc_version == 'latest':
self.config.gcc_actual_version = os.readlink(self.config.toolchain_dir).split('gcc-')[1]
else:
self.config.gcc_actual_version = self.config.gcc_version
if not self.config.gcc_libdir:
if self.config.gcc_version == 'latest':
# latest gcc version needs to point to the right libgcc location
toolchain_dir = self.config.format('%(toolchain_root)s/%(toolchain)s-gcc-%(gcc_config)s')
toolchain_suffix = self.config.toolchain.split('/')[-1]
self.config.gcc_libdir = os.path.join(self.config.toolchain_dir, 'lib', 'gcc', toolchain_suffix, self.config.gcc_actual_version)
else:
toolchain_suffix = self.config.toolchain.split('/')[-1]
self.config.gcc_libdir = os.path.join(self.config.toolchain_dir, 'lib', 'gcc', toolchain_suffix, self.config.gcc_version)
f += ['-DNAME=NAME:%s' % output_file] f += ['-DNAME=NAME:%s' % output_file]
# turn off -g because dwarf, not needed # turn off -g because dwarf, not needed
f += ['-dA', '-w'] #f += ['-dA', '-w']
f += ['-Wno-discarded-qualifiers',]
# for xc26: f += ['--no-data-init'] # for xc26: f += ['--no-data-init']
# or maybe f += ['-Xlinker', '--no-data-init'] # or maybe f += ['-Xlinker', '--no-data-init']
# This helps to alleviate undefined main, etc # This helps to alleviate undefined main, etc
@ -400,8 +408,11 @@ class PCodeBuildGCC(PCodeTestBuild):
# can pass this if weak symbols aren't defined # can pass this if weak symbols aren't defined
# f += ['-Xlinker', '--unresolved-symbols=ignore-all'] # f += ['-Xlinker', '--unresolved-symbols=ignore-all']
f +=[self.config.format(g) for g in self.config.ccflags.split()] f += [self.config.format(g) for g in self.config.ccflags.split()]
f += [self.config.format(g) for g in self.config.add_ccflags.split()] f += [self.config.format(g) for g in self.config.add_ccflags.split()]
f += ['-L ' + self.config.format(self.config.gcc_libdir)]
f += [self.config.format(g) for g in self.config.cclibs.split()]
f += [self.config.format(g) for g in self.config.add_cclibs.split()]
self.log_info('Compiler flags: %s' % f) self.log_info('Compiler flags: %s' % f)
return f return f
@ -409,16 +420,13 @@ class PCodeBuildGCC(PCodeTestBuild):
def compile(self, input_files, opt_cflag, output_base): def compile(self, input_files, opt_cflag, output_base):
# Name the output file, and delete it if it exists # Name the output file, and delete it if it exists
output_file = '%s.out' % (output_base) output_file = '%s.out' % (output_base)
self.remove(output_file) self.remove(output_file)
# set the library path # set the library path
self.set_library_path(self.config.ld_library_path) self.set_library_path(self.config.ld_library_path)
# Construct the compile/link command line and execute it # Construct the compile/link command line and execute it
cmp = self.which('compile_exe') cmp = self.which('compile_exe')
cmd = [cmp] + input_files + self.cflags(output_file) + [opt_cflag, '-B', self.dirname(cmp), '-o', output_file] cmd = [cmp] + input_files + self.cflags(output_file) + [opt_cflag, '-B', self.dirname(cmp), '-o', output_file]
out, err = self.run(cmd) out, err = self.run(cmd)
@ -428,13 +436,11 @@ class PCodeBuildGCC(PCodeTestBuild):
if err: self.log_warn(err) if err: self.log_warn(err)
# but return now if the error preempted the binary # but return now if the error preempted the binary
if not self.is_readable_file(output_file): if not self.is_readable_file(output_file):
self.log_err('output not created %s' % output_file) self.log_err('output not created %s' % output_file)
return return
# strip # strip
if self.config.strip_symbols: if self.config.strip_symbols:
str = self.which('strip_exe') str = self.which('strip_exe')
cmd = [str, '-s', output_file] cmd = [str, '-s', output_file]
@ -443,11 +449,9 @@ class PCodeBuildGCC(PCodeTestBuild):
# Get associated information (identify file, output-file.d, # Get associated information (identify file, output-file.d,
# .li, .nm, and .readelf, identify file, unresolves symbols) # .li, .nm, and .readelf, identify file, unresolves symbols)
self.associated_info(output_file, output_base) self.associated_info(output_file, output_base)
# build a BUILD_EXE version # build a BUILD_EXE version
if self.config.build_exe: if self.config.build_exe:
cmp = self.which('compile_exe') cmp = self.which('compile_exe')
cmd = [cmp] + input_files + self.cflags(output_file)\ cmd = [cmp] + input_files + self.cflags(output_file)\

View file

@ -213,7 +213,7 @@ parser = argparse.ArgumentParser(description='Precompile test file',
formatter_class=argparse.ArgumentDefaultsHelpFormatter) formatter_class=argparse.ArgumentDefaultsHelpFormatter)
parser.add_argument('test_file', nargs='*', help='Test file to preprocess, must end with .test') parser.add_argument('test_file', nargs='*', help='Test file to preprocess, must end with .test')
parser.add_argument('--entry', default='', help='Create file ENTRY contianing a main function that calls all MAIN functions') parser.add_argument('--entry', default='', help='Create file ENTRY containing a main function that calls all MAIN functions')
sys.argv.pop(0) sys.argv.pop(0)
args = parser.parse_args(sys.argv) args = parser.parse_args(sys.argv)