Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2023-03-03arm: Restrict processor mode change when in hypervisor modeSrinath Parvathaneni
If a CPU implements EL2 as its highest exception level then programs using newlib may start in hypervisor mode. In that state it is not trivial to switch into the various EL1 modes to configure the individual exception stacks, so do not try.
2023-03-03arm: Fix the SP used in setting stack limit for standalone application.Srinath Parvathaneni
Move the instruction that saves SP before the mode check so that applications that start in USER mode correctly set the stack limit.
2023-01-11libgloss: merge arm into top-level MakefileMike Frysinger
Avoid a recursive make to speed things up a bit.
2023-01-11libgloss: arm: break newlib dependencyMike Frysinger
The libgloss port has been reaching back into newlib internals for a single header whose contents have been frozen for almost a decade. To break this backwards libgloss->newlib dependency, move the acle header to the srcroot include/ so everyone can use the same copy.
2022-12-20libgloss: merge arm configure script up a levelMike Frysinger
Move the minor arm-specific logic to a dedicated variable so we can merge its configure logic up a level.
2022-12-20libgloss: arm: inline multi-build logicMike Frysinger
Since no other port uses this custom libgloss multi-build.in logic, and it's making things difficult to unify, drop it all. The set of installed objects and their content should be the same. There is a difference in the builds: currently we compile all the objects in this subdir twice, but only a subset of them use a diff set of flags, and are actually installed (the librdimon.a and its objects). So this change speeds things up by removing the duplicate compilation. There is a short term cost in having to duplicate the compile rules for the files that are different, but this is minor when compared to being able to delete the unused multi-build logic (which we'll do in a sep commit), and we'll be able to clean this up when we move the code to unified automake. None of this should be confused with the common multilib logic. This is *multi-build* which is processed in parallel.
2022-02-26libgloss: switch to AM_PROG_ARMike Frysinger
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-25libgloss: document & localize custom multi-do ruleMike Frysinger
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-25libgloss: finish migration to AM_PROG_ASMike Frysinger
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-25libgloss: switch to standard AC_PROG_CCMike Frysinger
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 Joyce
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-05libgloss: restore multilib settings in subdir makefilesMike Frysinger
Commit 754f8def0dfeeb43afa5a96ad1971fd0ef02c419 ("libgloss: merge stub arch configure scripts up a level") had an unintended side-effect: the MULTI* variables in the Makefiles no longer get rewritten at configure time in the subdirs. Only the top-level Makefile still is. This is because the configure integration of multilib (both the way libgloss did it manually and the way AM_ENABLE_MULTILIB does it) only rewrites "Makefile". We could try propagating the MULTI* variables from libgloss/Makefile down via FLAGS_TO_PASS, but this runs into a limitation: the multilib logic uses this variable to switch from libgloss/ to each multilib libgloss/, and libgloss uses this variable to enter subdirectories. The latter we want, but the former ends up overridding the Makefile environment. We could side-step that with some GNU Make directives, but it feels like we're getting a bit too deep down the rabbit hole. Instead, let's call config-ml.in ourselves for each subdir Makefile that the top-level configure generates. This restores the previous behavior and should be less risky in general. This logic should be unnecessary when/if we switch libgloss over to a non-recursive Automake build (since all build+install settings are in the single libgloss/Makefile), but it'll be a while before we can land that rework, so let's fix this up now.
2022-02-02libgloss: move to ../config/multi.m4 for multilib logicMike Frysinger
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-29libgloss: fix more missing dir with parallel installMike Frysinger
Depending on the processing order of rules when installing in parallel, these install rules might be processed before some other rule happens to create the respective dirs. Make sure each one creates the needed dirs before installing into them.
2022-01-29Finish this commit by prefixing HAVE_INITFINI_ARRAY and HAVE_INIT_FINI ↵Jeff Law
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-14require autoconf-2.69 exactlyMike Frysinger
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-11libgloss: hardcode AC_CONFIG_AUX_DIR pathMike Frysinger
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 Frysinger
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 Frysinger
The .in name has been deprecated for a long time in favor of .ac.
2020-03-02arm: Finish moving newlib to unified syntax for Thumb1Richard Earnshaw
Most code in newlib already uses unified syntax, but just a couple of laggards remain. This patch removes these and means the the entire code base has now been converted.
2019-08-05Align libgloss/arm and libc/sys/arm sources: miscellaneous fixesAlexander Fedotov
1. Trim trailing spaces 2. Align comments, function declarations and definitions
2019-08-05Align libgloss/arm and libc/sys/arm sources: HeapInfo and __heap_limitAlexander Fedotov
Applied changes from commit 8d98f95: * arm/crt0.S: Initialise __heap_limit when ARM_RDI_MONITOR is defined. * arm/syscalls.c: define __heap_limit global symbol. * arm/syscalls.c (_sbrk): Honour __heap_limit. Applied changes from commit 8d98f95: Fixed semihosting for ARM when heapinfo not provided by debugger
2019-07-23Stack Pointer and Stack Limit initialization refactored.Alexander Fedotov
SP initialization changes: 1. set default value in semihosting case as well 2. moved existing SP & SL init code for processor modes in separate routine and made it as "hook" 3. init SP for processor modes in Thumb mode as well Add new macro FN_RETURN, FN_EH_START and FN_EH_END.
2019-06-25Arm: Use lrdimon-v2m_nano when semihosting v2 and nano selected respectivelyAlexander Fedotov
2019-04-12Align comments and spaces in libgloss/arm/crt0.S and ↵Alexander Fedotov
newlib/libc/sys/arm/crt0.S to ease further code alignment.
2019-04-11Include code in trap.S for APCS only.Christophe Lyon
The code in trap.S is to support the old APCS chunked stack variant, which dates back to the Acorn days, so put it under #ifndef __ARM_EABI__. * libgloss/arm/trap.S: Use __ARM_EABI rather than PREFER_THUMB. * newlib/libc/sys/arm/trap.S: Use __ARM_EABI rather than __thumb2__.
2019-02-11AArch32: Fix the build for M class semihostingTamar Christina
The M class cores don't support Semihosting v2 mixed mode, but we were accidentally using the new immediates for it. My last patch changed the immediates which broke the build because doing a full multi-lib build including M architectures now results in an assembler error instead of silently doing the wrong thing. This fixes the issue by changing the defines around such that According to the specs any M class build uses the normal semihosting instructions. Regtested on arm-none-eabi and no issues, using a build with m class multilibs too.
2019-02-08AArch32: Add support for HLT to Mixed Mode modelsTamar Christina
The Semihosting v2 protocol requires us to output the Armv8-a HLT instruction when in mixed mode (SEMIHOST_V2_MIXED_MODE), however it also requires this to be done for Armv7-a and earlier architectures. The HLT instruction is defined in the undefined encoding space for older architectures but simulators such as QEMU already trap on it [1] for all architectures and is a requirement for semihosting v2 [2]. Unfortunately the GAS restricts the use of HLT to Armv8-a which requires us to use the instruction encodings we want directly in crt0. This patch does this, I have not updated newlib/libc/* as that is quite out of date already. A proper sync is needed in order to get things back in sync. A different patch for this would be best. [1] https://github.com/qemu/qemu/commit/19a6e31c9d2701ef648b70ddcfc3bf64cec8c37e [2] https://developer.arm.com/docs/100863/latest/the-semihosting-interface
2018-11-19Enable return code with semi-hosting SYS_EXIT_EXTENDEDMatthew Malcomson
The _exit function currently passes -1 as a "sig" to the _kill function as an invalid signal number so that _kill can distinguish between an abort and a standard exit. For boards using the SYS_EXIT_EXTENDED semi-hosting operation to return a status code, this means that the "status" paramter to _exit is ignored and the return code is always -1. https://developer.arm.com/docs/100863/latest/semihosting-operations/sys_exit_extended-0x20 This patch puts shared code between _kill and _exit into a new function _kill_shared that takes the semi-hosting "reason" to use (if semi-hosting is available) as an argument. For semi-hosting _kill_shared provides that "reason". Without the "sig" argument being used to distinguish between a normal and abnormal exit, the _exit function can provide the return code to be used if the SYS_EXIT_EXTENDED operation is available. Hence the exit code can be returned.
2018-10-08[ARM] Make _kill() a noreturn function.Christophe Lyon
AngelSWI_Reason_ReportException does not return accoring to the ARM documentation, so it is valid to mark _kill() as noreturn. This way, the compiler does not warn about _exit() returning a value despite being noreturn. 2018-10-01 Christophe Lyon <christophe.lyon@linaro.org> * libgloss/arm/_exit.c (_exit): Declare _kill() as noreturn. * libgloss/arm/_exit.c (_kill): Likewise. Remove the return statements. * newlib/libc/sys/arm/syscalls.c (_kill): Likewise..
2018-07-11Fix AArch32 semihosting SYS_EXIT call on semihosting v1.Tamar Christina
The current SYS_EXIT has a bug that when making the call it always uses the v2 calling convention. This is undefined behavior according to the semihosting specification: https://developer.arm.com/docs/100863/latest/semihosting-operations/sys_exit-0x18 This patch fixes it by making sure v1 passes the argument directly in the register instead of in a block. And for v2 it does the same if the v2 extension isn't supported. The sequence generated now is 12424: ebfffecd bl 11f60 <_has_ext_exit_extended> 12428: e3500000 cmp r0, #0 1242c: 11a0500d movne r5, sp 12430: 059d5000 ldreq r5, [sp] 12434: e1a00004 mov r0, r4 12438: e1a01005 mov r1, r5 1243c: ef00f000 svc 0x0000f000 Signed-off-by: Tamar Christina <tamar.christina@arm.com>
2018-02-16add forward declaration to main() to prevent warningsJaap de Wolff
2018-02-16adapt prototypes arm/syscalls.c to usual prototypes, and do not rely on ↵Jaap de Wolff
implicit conversions
2018-01-17ansification: remove _EXFUN, _EXFUN_NOTHROWYaakov Selkowitz
Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
2018-01-17ansification: remove _PARAMSYaakov Selkowitz
Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
2017-07-05Add support for Semihosting v2 support for ARM in libgloss.Tamar Christina
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-05Add the needed build system changes in order to compile and create the new ↵Tamar Christina
libraries for Semihosting v2 for ARM. 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>
2017-05-19ARM/AArch64: Fix GetCmdLine semihosting directivesnewlib-snapshot-20170519Laurent ALFONSI
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.
2017-04-18libgloss/arm: fix discovery of "eabihf" toolchainsCarlos Santos
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>
2017-02-15Fix elf-nano.specs to work without -save-tempsThomas Preud'homme
The changes in af272aca591fe1dc0f1be64ae5bda147ea98a047 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.
2017-02-13Fix cpp invocation for C++ in nano specThomas Preudhomme
Hi, The changes in c028685518a261f6d0dab0d7ed15f9570ab9b3d0 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.
2016-04-21Fixed semihosting for ARM when heapinfo not provided by debugger.David Hoover
2016-03-26Initializing TTBR0 to inner/outer WBJiong Wang
While running tests on internal systems, we identified an issue in the startup code for newlib on AArch32 systems with Multiprocessor Extensions to the architecture. The issue is we were configuring page table flags to be Inner cacheable/Outer non-cacheable, while for at least architectures with Multiprocessor Extension, we'd configure it to Inner/Outer write-back, no write-allocate, and cacheable. The attached patch fixes this, and no regression on arm-none-eabi bare-metal tests. Adopted suggestion given by Richard offline to avoid using jump. libgloss/ * arm/cpu-init/rdimon-aem.S: Set TTBR0 to inner/outer cacheable WB, and no allocate on WB for arch with multiprocessor extension.
2016-01-28Make macro checks ARMv8-M baseline proofThomas Preud'homme
libgloss: * arm/Makefile.in: Add newlib/libc/machine/arm to the include path if newlib is present. * arm/arm.h: Include acle-compat.h. (THUMB_V7_V6M): Rename to ... (PREFER_THUMB): This. Use ACLE macros __ARM_ARCH_ISA_ARM instead of __ARM_ARCH_6M__ to decide whether to define it. (THUMB1_ONLY): Define for Thumb-1 only targets. (THUMB_V7M_V6M): Rename to ... (THUMB_VXM): This. Defined based on __ARM_ARCH_ISA_ARM, excluding ARMv7. * arm/crt0.S: Use THUMB1_ONLY rather than __ARM_ARCH_6M__, !__ARM_ARCH_ISA_ARM rather than THUMB_V7M_V6M for fp enabling, and PREFER_THUMB rather than THUMB_V7_V6M. Rename other occurences of THUMB_V7M_V6M to THUMB_VXM. * arm/linux-crt0.c: Likewise. * arm/redboot-crt0.S: Likewise. * arm/swi.h: Likewise. * arm/trap.S: Likewise. newlib: * libc/machine/arm/memcpy-stub.c: Use ACLE macros __ARM_ARCH_ISA_THUMB and __ARM_ARCH_ISA_ARM to check for Thumb-2 only targets rather than __ARM_ARCH and __ARM_ARCH_PROFILE. * libc/machine/arm/memcpy.S: Likewise. * libc/machine/arm/setjmp.S: Likewise for Thumb-1 only target and include acle-compat.h. * libc/machine/arm/strcmp.S: Likewise for Thumb-1 and Thumb-2 only target and include acle-compat.h. * libc/sys/arm/arm.h: Include acle-compat.h. (THUMB_V7_V6M): Rename to ... (PREFER_THUMB): This. Use ACLE macro __ARM_ARCH_ISA_ARM instead of __ARM_ARCH_6M__ to decide whether to define it. (THUMB1_ONLY): Define for Thumb-1 only targets. (THUMB_V7M_V6M): Rename to ... (THUMB_VXM): This. Defined based on __ARM_ARCH_ISA_ARM, excluding ARMv7. * libc/sys/arm/crt0.S: Use PREFER_THUMB rather than THUMB_V7_V6M and rename THUMB_V7M_V6M into THUMB_VXM. * libc/sys/arm/swi.h: Likewise.
2015-07-14Change to nano.specs to add nano's include dircygwin-2_1_0-releaseAndre Simoes Dias Vieira
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2015-04-23libgloss: arm: fix copy & paste in syscall.hMike Frysinger
This header was clearly copied from the common syscall.h and customized, but the header comment is no longer accurate -- this isn't the general file anymore.
2015-02-17 * arm/crt0.S: Initialise __heap_limit when ARM_RDI_MONITOR is defined.Corinna Vinschen
* arm/syscalls.c: define __heap_limit global symbol. * arm/syscalls.c (_sbrk): Honour __heap_limit.
2014-08-15Add missing file from last patchCorinna Vinschen
2014-08-14 * arm/elf-nano.specs: New file.Corinna Vinschen
* arm/elf-rdimon.specs: Support nano.specs. * arm/Makefile.in: Support nano.specs. * libnosys/nosys.specs: Support nano.specs.
2014-07-16 * arm/elf-aprofile-validation.specs (*link): Make text segmentCorinna Vinschen
64k-aligned. * arm/elf-aprofile-ve.specs (*link): Likewise.