aboutsummaryrefslogtreecommitdiff
path: root/libgloss/aarch64
AgeCommit message (Collapse)AuthorFilesLines
2023-01-09libgloss: merge aarch64 into top-level MakefileMike Frysinger4-273/+54
Avoid a recursive make to speed things up a bit.
2022-12-19libgloss: merge aarch64 configure script up a levelMike Frysinger6-5420/+14
Move the minor aarch64-specific logic to a dedicated variable so we can merge its configure logic up a level.
2022-12-19libgloss: aarch64: delete unused multi-build logicMike Frysinger1-43/+16
This logic looks like it was copied from the arm port, but it isn't actually used here. Since no other port uses this custom libgloss multi-build.in logic, and it's making things difficult to unify, and aarch64 isn't even using it, drop it all. The set of installed objects and their content should be the same. Once we move this to unified automake, if we want to readd support for subdir multi-builds, it'll be a lot easier as we can just add another set of objects with custom flags. None of this should be confused with the common multilib logic. This *multi-build* which is processed in parallel.
2022-02-25libgloss: switch to AM_PROG_ARMike Frysinger3-3/+288
Now that we require Automake 1.15, we can use this macro rather than set the tool up ourselves. The current code doesn't properly search for a prefixed ar tool as-is.
2022-02-24libgloss: document & localize custom multi-do ruleMike Frysinger1-4/+4
The multi-build.in file in libgloss duplicates common multilib logic in the root source tree. Document it a bit, and rename the rule so it doesn't clash with the common multi-do rule. This will let us use them in the same makefile so we can merge aarch64/ & arm/ up (as the only targets that use this local multi-build.in atm).
2022-02-24libgloss: finish migration to AM_PROG_ASMike Frysinger3-14/+748
When merging iq2000 up a level, it included a partial conversion to AM_PROG_AS in the common directory. Finish it for all directories to kill off the custom LIB_AM_PROG_AS which we no longer need since we require Automake 1.15 now.
2022-02-24libgloss: switch to standard AC_PROG_CCMike Frysinger3-711/+689
Now that we use AC_NO_EXECUTABLES, and we require a recent version of autoconf, we don't need to define our own copies of these macros. So switch to the standard AC_PROG_CC.
2022-02-22Make __sdidinit unusedMatt Joyce1-1/+1
Remove dependency on __sdidinit member of struct _reent to check object initialization. Like __sdidinit, the __cleanup member of struct _reent is initialized in the __sinit() function. Checking initialization against __cleanup serves the same purpose and will reduce overhead in the __sfp() function in a follow up patch.
2022-02-16libgloss: aarch64: merge cpu-init/ up a levelMike Frysinger6-4501/+14
The cpu-init/configure script isn't doing anything useful, so merge the logic up to the parent dir. This is how the arm/ tree integrates its cpu-init/ subdir too.
2022-02-01libgloss: move to ../config/multi.m4 for multilib logicMike Frysinger6-28/+134
The current libgloss multilib logic is almost exactly the same as the config/multi.m4, and the differences should be minor, so switch over to that to delete custom logic on ourside. The insertions here look larger and that's because none of the scripts were declaring --enable-multilib explicitly even though they checked the flag and changed behavior.
2022-01-28Finish this commit by prefixing HAVE_INITFINI_ARRAY and HAVE_INIT_FINI ↵Jeff Law1-2/+2
references in libgloss in the same way. Author: Mike Frysinger <vapier@gentoo.org> Date: Mon Jan 17 22:20:20 2022 -0500 newlib: internalize HAVE_INITFINI_ARRAY This define is only used by newlib internally, so stop exporting it as HAVE_INITFINI_ARRAY since this can conflict with defines packages use themselves. We don't really need to add _ to HAVE_INIT_FINI too since it isn't exported in newlib.h, but might as well be consistent here. We can't (easily) add this to newlib_cflags like HAVE_INIT_FINI is because this is based on a compile-time test in the top configure, not on plain shell code in configure.host. We'd have to replicate the test in every subdir in order to have it passed down.
2022-01-28libgloss: aarch64/sparc: fix missing dir with parallel installMike Frysinger1-1/+5
Depending on the processing order of rules when installing in parallel, install-board might run first and the target dirs don't yet exist.
2022-01-14require autoconf-2.69 exactlyMike Frysinger6-40/+12
The newlib & libgloss dirs are already generated using autoconf-2.69. To avoid merging new code and/or accidental regeneration using diff versions, leverage config/override.m4 to pin to 2.69 exactly. This matches what gcc/binutils/gdb are already doing. The README file already says to use autoconf-2.69. To accomplish this, it's just as simple as adding -I flags to the top-level config/ dir when running aclocal. This is because the override.m4 file overrides AC_INIT to first require the specific autoconf version before calling the real AC_INIT.
2022-01-10libgloss: hardcode AC_CONFIG_AUX_DIR pathMike Frysinger4-50/+10
In order to transition to automake, we have to use hardcoded paths in the AC_CONFIG_AUX_DIR macro call (since automake evaluates the path itself, and doesn't expand vars), so simplify all the calls here.
2021-11-06libgloss: regenerate aclocal.m4 & configure w/newer versionsMike Frysinger6-336/+344
Regenerate the files using automake-1.15 & autoconf-2.69 to match the binutils/gdb/gcc projects. Ran: libgloss $ find -name configure.ac -printf '%h\n' | while read d; do (cd $d; export WANT_AUTOCONF=2.69 WANT_AUTOMAKE=1.15; aclocal-1.15 -I.. && autoconf-2.69); done
2021-09-13libgloss/newlib: rename configure.in to configure.acMike Frysinger2-0/+0
The .in name has been deprecated for a long time in favor of .ac.
2020-09-30libgloss: aarch64: Add support for Armv8-R AArch64Alex Coplan via Newlib4-4/+38
This patch adds support for Armv8-R AArch64. Armv8-R AArch64 has no EL3, so we don't set vbar_el3, and adjust the code to set up the MPU for Armv8-R. So build a different flavour of the startup code to support that. We also add a specs file that uses this alternative startup code which can be used with Armv8-R AArch64 models.
2018-10-31Initialize SVE system registers.Tamar Christina1-0/+27
This patch initializes the SVE system registers if available and initializes the vector length to the maximum supported. This is done according to the SVE specification [1]. [1] https://developer.arm.com/docs/ddi0584/latest/arm-architecture-reference-manual-supplement-the-scalable-vector-extension-sve-for-armv8-a
2018-10-08[Aarch64] Syscalls: fix prototypesChristophe Lyon1-18/+19
This patch is similar the arm one committed recently. 2018-10-08 Christophe Lyon <christophe.lyon@linaro.org> * libgloss/aarch64/syscalls.c (_sbrk): Fix prototype. (_getpid, _write, _swiwrite, _lseek, _swilseek, _read, _wriread): Likewise.
2018-10-05 [Aarch64] Fix warning in _sbrkChristophe Lyon1-1/+1
2018-10-01 Christophe Lyon <christophe.lyon@linaro.org> * libgloss/aarch64/syscalls.c (_sbrk): Cast "__heap_limit" to "char *".
2018-08-01Patch from Richard Earnshaw <Richard.Earnshaw@arm.com>newlib-snapshot-20180802Jeff Johnston1-4/+8
* aarch64/cpu-init/rdimon-aem-el3.S (cpu_init_hook): Simplify entry/exit sequences. Add CFI unwind rules.
2018-01-17ansification: remove _EXFUN, _EXFUN_NOTHROWYaakov Selkowitz1-1/+1
Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
2018-01-17ansification: remove _PARAMSYaakov Selkowitz4-36/+36
Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
2017-10-24Fixed semihosting for AArch64 when heapinfo parameters are not provided by ↵Alexander Fedotov2-26/+59
debugger
2017-08-24move ILP32 sanity check on heap base code under ARM_RDI_MONITORAlexander Fedotov-B556131-4/+5
2017-08-17Fix crt0 init fini codeSzabolcs Nagy1-4/+0
__USES_INITFINI__ ifdef was incorrectly copied from arm (it's an arm backend thing in gcc, not meaningful on aarch64)
2017-08-15fix typo in AArch64 crt0Alexander Fedotov-B556131-1/+1
2017-08-14use stack from linker script when nosysAlexander Fedotov-B556131-1/+18
2017-08-09Don't fetch command line options without semi-hostingYao Qi1-0/+6
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.
2017-08-09Fix crt0 overwriting.Tamar Christina4-1/+10
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>
2017-07-21Previous patch to support nosys.specs accidentally broke validation specs ↵Tamar Christina1-1/+1
because ARM_RDI_MONITOR was never passed to the build rule for crt0. 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>
2017-07-14Fix link when nosys.specs is used to linkTamar Christina1-0/+2
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.
2017-07-05Add support for Semihosting v2 support for AArch64 in libgloss.Tamar Christina4-47/+186
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>
2017-07-05Adds the needed build system changes in order to compile and create the new ↵Tamar Christina4-16/+49
libraries for Semihosting v2. 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>
2017-05-19ARM/AArch64: Fix GetCmdLine semihosting directivesnewlib-snapshot-20170519Laurent ALFONSI1-4/+6
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.
2014-02-03 * aarch64/Makefile.in (RDIMON_SCRIPTS): Rule to build in-tree copiesRichard Earnshaw1-2/+5
of scripts. (all): Build the in-tree copies of the scripts. (clean): Also delete the in-tree copies of the scripts.
2014-01-28 * aarch64/cpu-init/rdimon-aem-el3.S (flat_map): Use bic-immediateCorinna Vinschen1-2/+1
form to clear WXN bit.
2014-01-242014-01-24 Kyrylo Tkachov <kyrylo.tkachov@arm.com>Jeff Johnston1-1/+4
* aarch64/cpu-init/rdimon-aem-el3.S (flat_map): Clear WXN bit in SCTLR_EL3. Add dsb.
2013-11-21[AArch64] Set errno in ftruncate() and truncate().Marcus Shawcroft2-0/+4
2013-11-18[AArch64] Provide ftruncate() and truncate() stubs.Marcus Shawcroft3-2/+72
2013-08-12 * aarch64/crt0.S: Remove 'start'.Corinna Vinschen1-1/+0
* arm/crt0.S: Ditto. * arm/redboot-crt0.S: Ditto.
2013-07-12[AArch64] Ensure vector table is page aligned.Marcus Shawcroft1-2/+1
2013-07-12 Marcus Shawcroft <marcus.shawcroft@arm.com> * aarch64/cpu-init/rdimon-aem-el3.S (vectors): Page align.
2013-07-04 * aarch64/syscalls.c (stack_ptr): Defined with asm ("wsp") if __ILP32__Corinna Vinschen1-0/+4
is defined.
2013-06-28 * aarch64/syscalls.c (POINTER_TO_PARAM_BLOCK_T): New macro.Corinna Vinschen1-10/+14
(initialise_monitor_handles): Replace cast with macro POINTER_TO_PARAM_BLOCK_T. (_swiread): Likewise. (_swiwrite): Likewise. (_swiopen): Likewise. (_unlink): Likewise. (_system): Likewise. (_rename): Likewise.
2013-06-25 * aarch64/crt0.S (GEN_DWORD): New macro definition.Corinna Vinschen1-17/+75
(PTR_REG): Ditto. (PTR_SIZE): Ditto. (PTR_LOG_SIZE): Ditto. (start): Use GEN_DWORD to replace the .dword of HeapBase, __bss_start__, __bss_end__, FUNCTION(_fini), env and CommandLine; when __ILP32__ is defined, set the stack base to the top end of the 32-bit address space if the returned value from the Angel API call is larger than or equal to 4 GiB. Also carry out sanity check on the heap base; abort if the base is larger than or equal to 4 GiB. Use other new macros in the instructions that processes the argv arrays. (StackBase): New lable; replace __stack_base__. (__stack_base__): Set with StackBase or StackBase + 4.
2013-04-19[AArch64] Honour CFLAGS.Marcus Shawcroft2-7/+8
2013-04-19 Yufeng Zhang <yufeng.zhang@arm.com> * aarch64/Makefile.in (rdimon-crt0.o, rdimon-trap.o) (rdimon-_exit.o, rdimon-_kill.o, rdimon-syscalls.o) (rdimon-libcfunc.o): Add $(CFLAGS) to the compiler command line. * aarch64/cpu-init/Makefile.in (${CPU_INIT_OBJS}): Add $(CFLAGS) to the compiler command line.
2013-01-22Correcting my previous commit.Marcus Shawcroft2-0/+31
In my previous commit I forget to cvs add two new files, this commit corrects my mistake.
2013-01-182013-01-18 Marcus Shawcroft <marcus.shawcroft@arm.com>Marcus Shawcroft1-1/+1
* aarch64/Machine.in (RDIMON_SCRIPTS): Add aem-ve.specs and aem-validation.specs. * aarch64/elf-aem-validation.specs: New file. * aarch64/elf-aem-ve.specs: New file.
2012-11-23 * aarch64/configure.in: Replace the direct generation ofCorinna Vinschen6-26/+4476
cpu-init/Makefile.in with AC_CONFIG_SUBDIRS(cpu-init). * aarch64/configure: Re-generate. * aarch64/cpu-init/Makefile.in (objtype): Remove. (Makefile, config.status): Update the rules. * aarch64/cpu-init/aclocal.m4: New file (generated). * aarch64/cpu-init/configure.in: New file. * aarch64/cpu-init/configure: New file (generated).
2012-09-262012-09-26 Ian Bolton <ian.bolton@arm.com>Jeff Johnston13-0/+6046
Jim MacArthur <jim.macarthur@arm.com> Marcus Shawcroft <marcus.shawcroft@arm.com> Nigel Stephens <nigel.stephens@arm.com> Ramana Radhakrishnan <ramana.radhakrishnan@arm.com> Richard Earnshaw <rearnsha@arm.com> Sofiane Naci <sofiane.naci@arm.com> Tejas Belagod <tejas.belagod@arm.com> Yufeng Zhang <yufeng.zhang@arm.com> * aarch64/Makefile.in: New file. * aarch64/_exit.c: New file. * aarch64/_kill.c: New file. * aarch64/aclocal.m4: Generated. * aarch64/configure: Generated. * aarch64/configure.in: New file. * aarch64/cpu-init/Makefile.in: New file. * aarch64/cpu-init/rdimon-aem-el3.S: New file. * aarch64/crt0.S: New file. * aarch64/elf-rdimon.specs: New file. * aarch64/libcfunc.c: New file. * aarch64/svc.h: New file. * aarch64/syscalls.c: New file. * configure.in: Add AArch64. * configure: Re-generated.