MSP430: Add new methods of finding external MCU data file

Programming / Compilers / GCC - jozefl [138bc75d-0d04-0410-961f-82ee72b054a4] - 4 November 2019 11:01 EST

MCU data file can now be specified with an environment variable or installed into a toolchain subdirectory.

2019-11-04 Jozef Lawrynowicz

gcc/
- 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/
- 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.

2f8e6eda4cf MSP430: Add new methods of finding external MCU data file
gcc/ChangeLog | 20 ++++
gcc/config/msp430/driver-msp430.c | 13 ++
gcc/config/msp430/msp430-devices.c | 133 ++++++++++++++++++++-
gcc/config/msp430/msp430-devices.h | 2 +
gcc/config/msp430/msp430.c | 23 ++++
gcc/config/msp430/msp430.h | 12 +-
gcc/doc/invoke.texi | 29 ++++-
gcc/testsuite/ChangeLog | 17 +++
.../gcc.target/msp430/devices/csv-using-env-var.c | 10 ++
.../msp430/devices/csv-using-installed.c | 9 ++
.../gcc.target/msp430/devices/csv-using-option.c | 9 ++
.../gcc.target/msp430/devices/devices-main.c | 4 +
.../gcc.target/msp430/devices/msp430-devices.h | 3 +
gcc/testsuite/gcc.target/msp430/msp430.exp | 94 ++++++++++++++-
14 files changed, 369 insertions(+), 9 deletions(-)

Upstream: gcc.gnu.org


  • Share