Closed atrosinenko closed 4 years ago
Please also updated the driver tests and submit as a separate PR.
As I understood, OPT_fexception
handling needs further rewriting as well: in clang/lib/Driver/ToolChains/Clang.cpp, there exists some non-trivial code to compute whether exceptions are enabled or not. For MSP430 backend, we have probably to use at least
Args.hasFlag(options::OPT_fexceptions, options::OPT_fno_exceptions, false);
or better explicitly expressing the default state...
On the other hand, in GCC spec
, this is described as %{fexceptions:crtend.o}%{!fexceptions:crtend_no_eh.o}
, so my implementation is even correctly aligned with GCC one provided it has no special magic w.r.t. -fsomething
/-fno-something
handling built in.
Meanwhile, in clang/lib/Driver/ToolChains/Fuchsia.cpp, there exists nicer multilib description for roughly the same case.
Right. But given that this is C++ stuff, please just fill an issue, we will take care of it with lower priority :)
For the record, switching to *_no_eh.o
versions by default (when no -fexceptions
is explicitly given) should slightly decrease code size, so this PR seems to be not only "making it automatically discover newlib" :)
Now, I will update clang driver test, so what is the policy on supported sysroot versions? Are we planning choosing (or even autodetecting) TI's sysroot version to be used - now or in the near future?
We need to test whatever is implemented
This patch updates MSP430 toolchain description for current mspgcc package provided by TI. It does not try to be backward-compatible yet.
This patch expects the check for
options::OPT_fexceptions
to always return correct value based on-fexceptions
,-fno-exceptions
and the default value, that is probably not the case...Actual object and archive file sequence is based on "deciphered" output of
msp430-elf-gcc -dumpspecs
andgcc/gcc/config/msp430/msp430.h
source file. Still, it lacks some parts such as stack-smashing protector that seems to be supported on MSP430 according to presence oflibssp.a
. Of course, it omits all the sanitizer runtimes.Provided
uart-test.c
contains the UART example from MSP430-Emulator documentation, both commandsproduce executables that can be run on emulator by
dump 0xfffe
set pc 0x<value of reset vector>
run
Here, the
--sysroot
option points to TI's binary distribution: