aboutsummaryrefslogtreecommitdiff
path: root/libgloss
AgeCommit message (Collapse)AuthorFilesLines
2022-01-26libgloss: merge stub arch configure scripts up a levelMike Frysinger124-136205/+243
For about half the ports, we don't need a subdir configure script. They're using the config/default.m[ht] rules, and they aren't doing any unique configure tests, so they exist just to pass top-level settings down to create the arch Makefile. We can just as easily do that from the top-level Mkaefile directly and skip configure. Most of the remaining configure scripts could be migrated up to the top-level too, but that would require care in each subdir. So let's be lazy and put that off to another day.
2022-01-26libgloss: iq2000: drop unused configure varsMike Frysinger2-18/+0
This will make it easier to merge up as it won't have unique settings.
2022-01-25libgloss: define default target_makefile_frag in top-levelMike Frysinger2-1/+11
A bunch of subdirs want this, so make it available in the common dir to ease future merges. It isn't used directly in libgloss so it should be harmless as-is.
2022-01-23libgloss: bfin: fix subdir install for sim filesMike Frysinger1-0/+1
When building in parallel, make sure the subdir for the sim files exist before trying to install into them.
2022-01-17libgloss: clean up redundant shared lib warningsMike Frysinger79-313/+3
Use standard AC_MSG_WARN macro in the top-level configure, and delete the message from all the subdirs. There's no need to issue this more than once per libgloss build.
2022-01-14require autoconf-2.69 exactlyMike Frysinger162-1065/+327
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 Frysinger106-1543/+260
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.
2022-01-07libnosys: update autoheader usageMike Frysinger4-59/+49
The use of acconfig.h templates is deprecated, so migrate away from it by moving the description text to configure.ac.
2022-01-07libgloss: wince: add ACLOCAL_AMFLAGS settingsMike Frysinger2-0/+2
This allows autoreconf to "just work" and find the right macros.
2021-12-29libgloss: wince: update to automake-1.15Mike Frysinger4-267/+685
Drop the cygnus options and migrate to current versions of autotools.
2021-11-06libgloss: regenerate aclocal.m4 & configure w/newer versionsMike Frysinger160-53935/+61640
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-11-06libgloss/newlib: update configure.ac in Makefile.in filesMike Frysinger1-4/+4
The maintainer rules refer to configure.in directly, so update that after renaming all the configure.ac files.
2021-10-27libgloss/riscv: Fix hard coded reference to configure.in after renameLewis Revill1-1/+1
The file configure.in was renamed to configure.ac in libgloss/riscv but the hard coded name in the Makefile for that directory was not updated. This patch simply renamed this to configure.ac.
2021-09-15libgloss: add missing aclocal.m4 filesMike Frysinger5-5/+1954
These subdirs were missing aclocal.m4 files pulling in macros from ../acinclude.m4 which caused some macros to not be expanded. For example, autoconf complains: configure.ac:25: error: possibly undefined macro: LIB_AC_PROG_CC If this token and others are legitimate, please use m4_pattern_allow. See the Autoconf documentation. These were generated with aclocal-1.9 as that seems to be what was used in these dirs previously, and with whatever version of autoconf the specific subdir was using. This should minimize diffs.
2021-09-15libgloss: epiphany: rename symbol prefix cache varMike Frysinger2-14/+14
Autoconf emits a warning for this: configure.ac:75: warning: AC_CACHE_VAL(libc_symbol_prefix, ...): suspicious cache-id, must contain _cv_ to be cached Rename the variable to match the naming in libnosys/ subdir.
2021-09-15libgloss: fix AC_LANG_SOURCE warnings w/newer autoconfMike Frysinger2-8/+8
When running autoconf-2.69 in here, we get: configure.ac:57: warning: AC_LANG_CONFTEST: no AC_LANG_SOURCE call detected in body ../../lib/autoconf/lang.m4:193: AC_LANG_CONFTEST is expanded from... ../../lib/autoconf/general.m4:2503: _AC_PREPROC_IFELSE is expanded from... ../../lib/autoconf/general.m4:2518: AC_PREPROC_IFELSE is expanded from... configure.ac:57: the top level configure.ac:61: warning: AC_LANG_CONFTEST: no AC_LANG_SOURCE call detected in body ../../lib/autoconf/lang.m4:193: AC_LANG_CONFTEST is expanded from... ../../lib/autoconf/general.m4:2503: _AC_PREPROC_IFELSE is expanded from... ../../lib/autoconf/general.m4:2518: AC_PREPROC_IFELSE is expanded from... configure.ac:61: the top level Add AC_LANG_PROGRAM wrappings to fix these.
2021-09-13libgloss/newlib: rename configure.in to configure.acMike Frysinger54-0/+0
The .in name has been deprecated for a long time in favor of .ac.
2021-08-04RISC-V: Reliably initialize t0 in _times()Christoph Muellner1-4/+9
The current implementation does not reliably initialize t0 once. Additionally the initialization requires two calls to _gettimeofday(). Let's sacrifice a byte to keep the initialization status and reduce the maximum number of calls to _gettimeofday(). This has caused issues in an application that invokes clock(). The problematic situation is as follows: 1) The program calls clock() which calls _times(). 2) _gettimeofday(&t0, 0) puts 0 in t0.tv_usec (because less than 1 us has elapsed since the beginning of time). 3) _gettimeofday(&t, 0) puts 1 in t.tv_usec (since now more than 1 us has elapsed since the beginning of time). 4) That call to clock() returns 1 (the value from step 3 minus the value in step 2). 5) The program does a second call to clock(). 6) The code above still sees 0 in t0 so it tries to update t0 again and _gettimeofday(&t0, 0) puts 1 in t0.tv_usec. 7) The _gettimeofday(&t, 0) puts 1 in t.tv_usec (since less than 1us has elapsed since step 3). 8) clock() returns 0 (step 7 minus step 6) and indicates that time is moving backwards. Signed-off-by: Christoph Muellner <cmuellner@gcc.gnu.org>
2021-07-06Fix builds on iq2000 and visiumJeff Law4-0/+4
visium and iq2000 have libgloss configure bits that reference target_makefile_frag, but it's never set. This leads to failures during the configure process and an empty libgloss/<target>/Makefile. Naturally bad things happen with an empty Makefile. This patch initializes target_makefile_frag for both targets in their configure.in files and updates the generated configure files. This fixes the build failures. I've been using it in my tester for about a week and both targets have flipped from consistently failing to consistently passing. * libgloss/visium/configure.in (target_makefile_frag): Define. * libgloss/visium/configure: Regenerated. * libgloss/iq2000/configure.in (target_makefile_frag): Define. * libgloss/iq2000/configure: Regenerated.
2021-07-05libgloss/or1k: Correct the IMMU SXE and UXE flagsStafford Horne1-10/+10
These have been defined incorrectly, as per specification and CPU implementations SXE is bit 6 and UXE is bit 7. This was noticed when tracking down our test suite mmu test failures. Test Suite: https://github.com/openrisc/or1k-tests/blob/master/native/or1k/or1k-mmu.c#L68-L72 Spec: https://raw.githubusercontent.com/openrisc/doc/master/openrisc-arch-1.3-rev1.pdf See section 8.4.8 Instruction Translation Lookaside Buffer Way y Translate Registers where these are defined. Signed-off-by: Stafford Horne <shorne@gmail.com>
2021-06-09libgloss: pru: Remove sim ld scriptDimitar Dimitrov4-289/+3
Binutils LD default linker script was recently fixed to allow memory sizes to be set via command line. Use this feature to remove the special sim linker script in libgloss. It is acceptable to require newer Binutils version here because simulator target is only used for regression testing the toolchain. Real HW targets are not affected. Signed-off-by: Dimitar Dimitrov <dimitar@dinux.eu>
2021-06-09libgloss: pru: Place sim syscalls into their own sectionsDimitar Dimitrov1-2/+2
This should help reduce final ELF size if using --gc-sections linker option. Signed-off-by: Dimitar Dimitrov <dimitar@dinux.eu>
2021-04-13RISC-V: Using SYS_clock_gettime64 for rv32 libgloss.Kito Cheng2-0/+22
- RISC-V 32 bits linux/glibc didn't provide gettimeofday anymore after upstream, because RV32 didn't have backward compatible issue, so RV32 only support 64 bits time related system call. - So using clock_gettime64 call instead for rv32 libgloss.
2021-02-05RISC-V: Use __bss_start for the starting point of .bss.Yeting Kuo1-1/+1
It's more flexible for the positions of .bss and .data.
2020-12-16RISC-V: Add semihosting supportCraig Blackmore21-1/+692
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.
2020-09-25Add C-SKY port for libglossJojo R27-0/+6805
This patch contain all libgloss for C-SKY Contributor list: - Lifang Xia <lifang_xia@c-sky.com> - Jojo R <jiejie_rong@c-sky.com> - Xianmiao Qu <xianmiao_qu@c-sky.com> - Yunhai Shang <yunhai_shang@c-sky.com>
2020-09-04MSP430: Fix calculation of string length in sbrk.cJozef Lawrynowicz1-1/+1
2020-09-03MSP430: Fix message in sbrk.c printing binary characterJozef Lawrynowicz1-2/+2
The call to write() in sbrk.c was using the wrong value for the length argument, causing the NUL terminating character of the string to be printed.
2020-09-03Fix warnings when building for msp430-elfJozef Lawrynowicz1-0/+3
The MSP430 target supports both 16-bit and 20-bit size_t and intptr_t. Some implicit casts in Newlib expect these types to be "long", (a 32-bit type on MSP430) which causes warnings during compilation such as: "cast from pointer to integer of different size"
2020-08-07MSP430: Increase the amount of main memory available in sim ld scriptsJozef Lawrynowicz2-2/+2
The main memory region of the GDB simulator ends at address 0xFFBF, but the simulator linker scripts do not make full use of this available memory. >From 61f3d212741acee583e21ff2c2808775584ecad6 Mon Sep 17 00:00:00 2001 From: Jozef Lawrynowicz <jozef.l@mittosystems.com> Date: Mon, 3 Aug 2020 19:38:23 +0100 Subject: [PATCH 2/2] MSP430: Increase the amount of main memory available in sim ld scripts The main memory region of the GDB simulator ends at address 0xFFBF, but the simulator linker scripts do not make full use of this available memory.
2020-08-07MSP430: Word align __*_array_start symbols in sim linker scriptsJozef Lawrynowicz2-0/+7
__{preinit,init,fini}_array_start symbols must be word aligned in linker scripts. If the section preceding the __*_array_start symbol has an odd size, then a NULL byte will be present between the start symbol and the .*_array section itself, when the section gets automatically word-aligned. This results in a branch to an invalid address when the CRT startup code tries to run through the functions listed in the array sections. >From de115144d05ecbaa82c9c737cc261715ca4b7d67 Mon Sep 17 00:00:00 2001 From: Jozef Lawrynowicz <jozef.l@mittosystems.com> Date: Mon, 3 Aug 2020 19:09:46 +0100 Subject: [PATCH 1/2] MSP430: Word align __*_array_start symbols in sim linker scripts __{preinit,init,fini}_array_start symbols must be word aligned in linker scripts. If the section preceding the __*_array_start symbol has an odd size, then a NULL byte will be present between the start symbol and the .*_array section itself, when the section gets automatically word-aligned. This results in a branch to an invalid address when the CRT startup code tries to run through the functions listed in the array sections.
2020-07-02pru: Fix memory corruption on syscall returnDimitar Dimitrov1-0/+1
In the initial code I missed one level of pointer indirection. Instead of storing errno in impure_data, _impure_ptr was corrupted. Only simulator is impacted. Real targets have no OS and no syscalls. This resolves a bunch of stdio cases from the GCC testsuite: FAIL->PASS: gcc.c-torture/execute/printf-2.c -O0 execution test Signed-off-by: Dimitar Dimitrov <dimitar@dinux.eu>
2020-03-02arm: Finish moving newlib to unified syntax for Thumb1Richard Earnshaw1-0/+11
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.
2020-02-11Only pass the minimum number of syscall argumentsGeorg Sauthoff18-29/+48
Previously, __internal_syscall() compiled into asm-code that unconditionally sets the syscall argument registers a0 to a5. For example, the instruction sequence for a exit syscall looked like this: li a0, 1 # in ther caller of exit() # ... # in newlib: li a1, 0 # unused arguments li a2, 0 li a3, 0 li a4, 0 li a5, 0 li a7, 93 # exit syscall number (i.e. the binary contains then 5 superfluous instructions for this one argument syscall) This commit changes the RISC-V syscall code such that only the required syscall argument registers are set. GCC detects that argc is known at compile time and thus evaluates all the if-statements where argc is used at compile time (tested with -O2 and -Os).
2020-02-06libgloss: Fix lseek semihosting bug on nios2 and m68kSandra Loosemore2-2/+2
When off_t is 32 bits, the value needs to be sign-extended to 64 bits before shifting right to extract the high-order word. Previously negative offsets were incorrectly encoded. Signed-off-by: Sandra Loosemore <sandra@codesourcery.com>
2020-01-31RISC-V: Use newlib nano specific libm.Jim Wilson1-1/+1
The libm gamma functions use the _gamma_signgam field of the reentrant structure, which changes offset with the --enable-newlib-reent-small configure option, which means we need to use a newlib nano specific version of libm in addition to libc in the nano.specs file. Reported by Keith Packard. There is a riscv-gnu-toolchain patch that goes along with this to create the new libm_nano.a file. Signed-off-by: Jim Wilson <jimw@sifive.com>
2020-01-29Use remove-advertising-clause script to edit BSD licensesKeith Packard7-19/+7
This edits licenses held by Berkeley and NetBSD, both of which have removed the advertising requirement from their licenses. Signed-off-by: Keith Packard <keithp@keithp.com>
2019-12-16MSP430: Support new msp430-elfbare targetJozef Lawrynowicz2-2/+2
Update the target triplet glob used when configuring for msp430 to support a new msp430-elfbare target being added to gcc.
2019-12-14Implement the unlink system call for the moxie simulator.Anthony Green1-2/+2
Corresponding support for this was just added to the gdb moxie simulator. Unlink support is required by the GCC testsuite.
2019-11-02Fix libgloss being built for disabled multilibsJozef Lawrynowicz2-0/+2
Target libraries are considered to be built for GCC's "host", not GCC's "target". The "host" variable must be set by configure scripts using "config-ml.in" to determine multilib support, otherwise disabled multilibs (specified as a configure argument with --disable-<multilib>) will still be built for the subdirectories those configure scripts reside in.
2019-10-31Initial PRU port for libgloss and newlibDimitar Dimitrov21-0/+5338
Signed-off-by: Dimitar Dimitrov <dimitar@dinux.eu>
2019-10-25MSP430: Add missing build rule for unlink() to libgloss MakefileJozef Lawrynowicz1-0/+1
2019-09-04Adjust nios2 and m68k semihosting for sys/stat.h changes.Sandra Loosemore4-12/+12
Commit 72ff9acad2ab54e80a19ddaec0106065c817e3f6 caused st_atime, st_ctime, and st_mtime to be defined as macros. This collided with use of these identifiers as field names in struct gdb_stat (which represents the GDB RSP encoding of struct stat) in libgloss semihosting support for nios2 and m68k. This patch renames the affected fields of struct gdb_stat. Signed-off-by: Sandra Loosemore <sandra@codesourcery.com>
2019-08-20Fix regression in visium caused by sys/stat.h changeJeff Law2-6/+6
2019-08-19Revert previous change to sys/stat.h and fix cris libglossJeff Johnston1-6/+12
- revert previous fix which altered sys/stat.h - fix libgloss/cris/gensyscalls to undef st_atime, st_mtime, and st_ctime macros which cannot be used with new_stat structure
2019-08-05Align libgloss/arm and libc/sys/arm sources: miscellaneous fixesAlexander Fedotov2-61/+47
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 Fedotov1-6/+6
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-30Align _end symbol to at least 4 in all MIPS scriptsFaraz Shahbazker16-0/+16
Left-over part of commit 84b2a020daa17d8ee5c9ec979c3d56f95e69573b The _end marker must be aligned to 4-bytes to ensure that the last element written does not reach beyond the address of _end. This is also necessary as the termination condition is an equality test instead of an ordered test so (_end - _fbss) must be a multiple of 4-bytes. The alignment is already correct for mti*.ld files, fix it for all remaining MIPS scripts that don't already align to at least 4.
2019-07-24MSP430: Remove .init/.fini sectionsJozef Lawrynowicz5-157/+62
The .init/.fini sections are not required for msp430-elf, and add unnecessary code bloat to the CRT library. These sections are specified as "unused" by the MSP430 EABI. .init existed to call __crt0_run_{init,preinit}_array which run through the functions in .{init,preinit}_array. __crt0_run_{init,preinit}_array are already dynamically included like the other crt0 functions, so these can be placed before the call to main, which ensures they are still called if needed. With these functions moved, .init has no purpose and can be removed. .fini existed to call __crt0_run_fini_array. However, the "__msp430_fini" symbol which marks the start of .fini has never been used, so no termination routines have ever been run for msp430. On returning from main(), _exit() is called which just loops forever. So there is no current expectation that __crt0_run_fini_array will get called by the CRT code. Further work is to ensure functions registered with atexit can be optionally called during program termination, and then __crt0_run_fini_array can be registered with atexit during program initialization. The mechanisms for supporting the "-minrt" option have also been removed. "-minrt" enabled a "minimum runtime environment" by removing calls to functions which run global static initializers and constructors. Since this behaviour is now dynamic, and these functions are only included when needed, the minrt versions of the CRT object files are no longer required.