The previous multi-build implementation was copying the config.status from the parent
multilib directory when building the different semihosting variants. It did so because
the configuration doesn't change. However when you use a relative path to configure it
turns out that the paths inside the config.status are also relative.
To fix this, the srcdir is adjusted from the initial configuration instead of copying it.
Tested on aarch64-none-elf and arm-none-eabi.
Signed-off-by: Tamar Christina <tamar.christina@arm.com>
- For prevent confuse about what BSD license variant we used, 2- or
3-clause license, we change the license to FreeBSD license to make
it unambiguously refers to the 2-clause license.
Nowadays, the code fetching command line options via semi-hosting are
unconditionally pulled in, so that the semi-hosting code is still
there even I compile with option --specs=nosys.specs.
gdb ./aarch64-none-elf/libgloss/aarch64/crt0.o
(gdb) disassemble _start
0x0000000000000050 <+80>: ldr x1, 0x128 <_cpu_init_hook+48>
0x0000000000000054 <+84>: mov w0, #0x15
0x0000000000000058 <+88>: hlt #0xf000
This patch fixes this problem by wrapping the code by ARM_RDI_MONITOR.
When semi-hosting is not used, set command line options to NULL.
On AArch64 we currently always link in crt0 regardless of if another
one is being provided by something else, like rdimon.a. This was never
an issue before as nosys was not supported on AArch64.
This updates the specs to supply a different crt0 when a semihosting
call is required.
Signed-off-by: Tamar Christina <tamar.christina@arm.com>
This fixed the compile for nosys and validation specs
but nosys won't run because of existing limitations to
aarch64's syscalls.c, it requires semihosting to get
commandline arguments and heap info without having a
fallback method as ARM does.
Signed-off-by: Tamar Christina <tamar.christina@arm.com>
This patch fixes the issue where nosys.specs is used to link.
e.g. The use of crt0 without any support for semihosting requested.
The AArch64 crt0 was missing an #ifdef for the initialise_monitor_handles
which was causing the link to fail. Sorry for missing this before.
Semihosting v2 changes are documented here:
https://developer.arm.com/docs/100863/latest/
The biggest change is the addition of an extensions mechanism
to add more extensions in the future.
Signed-off-by: Tamar Christina <tamar.christina@arm.com>
Semihosting v2 changes are documented here:
https://developer.arm.com/docs/100863/latest/
The biggest change is the addition of an extensions mechanism
to add more extensions in the future.
Signed-off-by: Tamar Christina <tamar.christina@arm.com>
This uses the new recursive build target in multi-build.in
The new spec files are:
For AArch32/ARM (m for mixed mode):
- rdimon-v2m.specs
- aprofile-validation-v2m.specs
- aprofile-ve-v2m.specs
These spec files will be using the new libraries generated
by multi-build.in.
Signed-off-by: Tamar Christina <tamar.christina@arm.com>
This uses the new recursive build target in multi-build.in
For AArch64 no new spec files are needed but the makefiles
are modified to keep them in sync with the ARM ones.
Signed-off-by: Tamar Christina <tamar.christina@arm.com>
e.g. from the same source file produce multiple libs by varying the
options passed to the compiler.
Signed-off-by: Tamar Christina <tamar.christina@arm.com>
When simulating arm code, the target program startup code (crt0) uses
semihosting invocations to get the command line from the simulator. The
simulator returns the command line and its size into the area passed in
parameter. (ARM 32-bit specifications :
http://infocenter.arm.com/help/topic/com.arm.doc.dui0058d/DUI0058.pdf
chapter "5.4.19 SYS_GET_CMDLINE").
The memory area pointed by the semihosting register argument is located
in .text section (usually not writtable (RX)).
If we run this code on a simulator that respects this rights properties
(qemu user-mode for instance), the command line will not be written to
the .text program memory, in particular the length of the string. The
program runs with an empty command line. This problem hasn't been seen
earlier probably because qemu user-mode is not so much used, but this can
happen with another simulator that refuse to write in a read-only segment.
With this modification, the command line can be correctly passed to the
target program.
Changes:
- libgloss/arm/crt0.S : Arguments passed to the AngelSWI_Reason_GetCmdLine
semihosting invocation are placed into .data section instead of .text
- libgloss/aarch64/crt0.S : Idem for aarch64 AngelSVC_Reason_GetCmdLine
semihosting.
ARM EABI toolchains can optionally use the "hf" suffix to identify
hardware floating point support. Use the "*-*-eabi*" pattern to match
these toolchains.
Original patch by Bryan Hundven for the Crosstool-NG project. Improved
by Alexey Neyman.
Signed-off-by: Carlos Santos <casantos@datacom.ind.br>
CC: Bryan Hundven <bryanhundven@gmail.com
CC: Alexey Neyman <stilor@att.net>
The changes in af272aca59 only works when
using gcc/g++ with -E or -save-temps, otherwise newlib's newlib.h gets
used even if -specs=nano.specs is specified. This is because the driver
only use cpp_options spec for the external cpp tool, not for the
integrated one.
This patch uses instead cpp_unique_options which is used in all cases:
it is used directly when the integrated preprocessor is used, and
indirectly by expansion of cpp_options otherwise.
Hi,
The changes in c028685518 to use
newlib-nano's include directory work for cc1 but not cc1plus. cc1plus
comes with its own cpp spec which does not have a name attached to it.
This patch uses the renaming trick on cpp_options instead of cpp, as
cpp_options is used both by cc1 and cc1plus.
Environ is defined in libgloss and libc:
- libgloss/or1k/syscalls.c
- libc/stdlib/environ.c
When linking we sometimes get errors:
or1k-elf-g++ test.o -mnewlib -mboard=or1ksim -lm -o test
/opt/shorne/software/or1k/lib/gcc/or1k-elf/5.3.0/../../../../or1k-elf/lib/libor1k.a(syscalls.o):(.data+0x0):
multiple definition of `environ'
/opt/shorne/software/or1k/lib/gcc/or1k-elf/5.3.0/../../../../or1k-elf/lib/libc.a(lib_a-environ.o):(.data+0x0):
first defined here
collect2: error: ld returned 1 exit status
This doesnt happen after the fix. Basic things build fine too.
There was an issue revealed in gdb testing where C++ virtual tables
were not getting properly initialized. This seems to be due to the
c++ global constructors moving from ctors to init_array.
This fix makes sure we call the proper method for initializing the
constructors in all places.
or1k uses reentrant calls by default, but there was no open_r defined
which caused failure in C++/C code such as:
int main() { std::cout << "test\n"; return 0; }
or
int main() {open(".", 0);}
After a binutils change "a while ago" (2015-12) to default to
--enable-initfini-array, i.e. to merge .ctors and .dtors into
.init_array and .fini_array, this is needed for cdtors to run at all.
Based on what goes on in arm/ and aarch64/. Tested for cris-elf by
running the gcc testsuite.
By the way, the configure test doesn't detect this change, so the
HAVE_INITFINI_ARRAY ifdeffery is somewhat redundant. Still, the
change is tested to be safe with older binutils too.
libgloss/
* cris/crt0.S, cris/lcrt0.c: Include newlib.h.
[HAVE_INITFINI_ARRAY] (_init): Define to __libc_init_array.
[HAVE_INITFINI_ARRAY] (_fini): Ditto __libc_fini_array.
HTML build fails with makeinfo 5.2 with the following error:
libgloss/doc/porting.texi:73: @menu seen before first @node
libgloss/doc/porting.texi:73: perhaps your @top node should be wrapped in
@ifnottex rather than @ifinfo?
Following the advice indeed solve the issue while still allowing pdf, dvi and
info builds to work.