On 11/1/19 4:53 AM, Jozef Lawrynowicz wrote:
> Each different MSP430 MCU has two properties that affect code generation, 
> which
> are the the CPU ISA and the hardware multiply support. These can be manually
> specified with the -mcpu= and -mhwmult= options, respectively.
> The existing -mmcu= option takes an MCU name as an argument and uses the CPU
> ISA and hardware multiply known to be supported for that MCU, so the user does
> not have to provide the -mcpu and -mhwmult options.
> 
> Currently, the MCU data can be provided in an external "devices.csv" file, and
> this file is already searched for on the paths specified with -I and -L.
> 
> This patch extends the searching behaviour so the path to the directory
> containing devices.csv can either be specified with the 
> "MSP430_GCC_INCLUDE_DIR"
> environment variable, or installed into the msp430-elf/include/devices
> subdirectory of the toolchain.
> The msp430.exp toolchain driver has been extended to ensure these new methods
> can be tested properly.
> 
> Successfully regtested on trunk.
> 
> Ok to apply?
> 
> 
> 0001-MSP430-Read-MCU-data-from-external-file-specified-wi.patch
> 
> From f781013148c2fd242af8526dbcfa2079fe30db07 Mon Sep 17 00:00:00 2001
> From: Jozef Lawrynowicz <joze...@mittosystems.com>
> Date: Wed, 30 Oct 2019 21:10:38 +0000
> Subject: [PATCH] MSP430: Read MCU data from external file specified with
>  environment variable or installed into toolchain subdirectory
> 
> gcc/ChangeLog:
> 
> 2019-10-31  Jozef Lawrynowicz  <joze...@mittosystems.com>
> 
>       * config/msp430/driver-msp430.c 
> (msp430_get_linker_devices_include_path):
>       New spec function.
>       * config/msp430/msp430-devices.c (msp430_dirname): New function.
>       (extract_devices_dir_from_exec_prefix): New function.
>       (extract_devices_dir_from_collect_gcc): New function.
>       (msp430_check_env_var_for_devices): New function.
>       (msp430_check_path_for_devices): Use xstrdup instead of ASTRDUP.
>       (parse_devices_csv): Call msp430_check_env_var_for_devices if
>       devices.csv was not found using other methods.
>       * config/msp430/msp430-devices.h (msp430_check_env_var_for_devices):
>       New prototype.
>       (msp430_dirname): Likewise.
>       * config/msp430/msp430.c (msp430_register_pre_includes): New function.
>       * config/msp430/msp430.h (EXTRA_SPEC_FUNCTIONS): Add
>       msp430_get_linker_devices_include_path.
>       (TARGET_EXTRA_PRE_INCLUDES): Define.
>       * doc/invoke.texi: Document new ways of searching for support files.
> 
> gcc/testsuite/ChangeLog:
> 
> 2019-10-31  Jozef Lawrynowicz  <joze...@mittosystems.com>
> 
>       * gcc.target/msp430/devices/csv-using-env-var.c: New test.
>       * gcc.target/msp430/devices/csv-using-installed.c: New test.
>       * gcc.target/msp430/devices/csv-using-option.c: New test.
>       * gcc.target/msp430/devices/devices-main.c: New test source file.
>       * gcc.target/msp430/devices/msp430-devices.h: New test.
>       * gcc.target/msp430/msp430.exp (msp430_device_permutations_runtest):
>       Add special cases for csv-using* tests.
>       Define TESTING_HARD_DATA when running tests that use hard-coded device
>       data.
>       (get_installed_device_data_path): New.
>       (msp430_hide_installed_devices_data): New.
>       (msp430_restore_installed_devices_data): New.
>       (msp430_test_installed_device_data): New.
>       (msp430_install_device_data): New.
OK
jeff

Reply via email to