PR47785: Add support for handling Xassembler/Wa options with LTO.
authorPrathamesh Kulkarni <prathamesh.kulkarni@linaro.org>
Mon, 24 Feb 2020 06:25:45 +0000 (11:55 +0530)
committerPrathamesh Kulkarni <prathamesh.kulkarni@linaro.org>
Mon, 24 Feb 2020 06:25:45 +0000 (11:55 +0530)
commitf1a681a174cdfb82e62c246d6f4add9a25fc2e43
tree8c6d66f99473e10c0265b47eec8831eacc05392b
parent9069e9484cec2ff981c87c75b226ad738847ca07
PR47785: Add support for handling Xassembler/Wa options with LTO.

2020-02-24  Prathamesh Kulkarni  <prathamesh.kulkarni@linaro.org>
    Kugan Vivekandarajah  <kugan.vivekanandarajah@linaro.org>

PR driver/47785
* gcc.c (putenv_COLLECT_AS_OPTIONS): New function.
(driver::main): Call putenv_COLLECT_AS_OPTIONS.
* opts-common.c (parse_options_from_collect_gcc_options): New function.
(prepend_xassembler_to_collect_as_options): Likewise.
* opts.h (parse_options_from_collect_gcc_options): Declare prototype.
(prepend_xassembler_to_collect_as_options): Likewise.
* lto-opts.c (lto_write_options): Stream assembler options
in COLLECT_AS_OPTIONS.
* lto-wrapper.c (xassembler_options_error): New static variable.
(get_options_from_collect_gcc_options): Move parsing options code to
parse_options_from_collect_gcc_options and call it.
(merge_and_complain): Validate -Xassembler options.
(append_compiler_options): Handle OPT_Xassembler.
(run_gcc): Append command line -Xassembler options to
collect_gcc_options.
* doc/invoke.texi: Add documentation about using Xassembler
options with LTO.

testsuite/
* gcc.target/arm/pr78353-1.c: New test.
* gcc.target/arm/pr78353-2.c: Likewise.
gcc/ChangeLog
gcc/doc/invoke.texi
gcc/gcc.c
gcc/lto-opts.c
gcc/lto-wrapper.c
gcc/opts-common.c
gcc/opts.h
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/arm/pr78353-1.c [new file with mode: 0644]
gcc/testsuite/gcc.target/arm/pr78353-2.c [new file with mode: 0644]