Commit Graph

822 Commits

Author SHA1 Message Date
Mike Frysinger af075aed1d libgloss: merge m32r into top-level Makefile
Avoid a recursive make to speed things up a bit.
A m32r-elf build shows installed objects & libs produce same code.
2024-01-19 20:26:52 -05:00
Mike Frysinger 4172a3c618 libgloss: merge rl78 into top-level Makefile
Avoid a recursive make to speed things up a bit.
A rl78-elf build shows installed objects & libs produce same code.
2024-01-19 20:26:52 -05:00
Mike Frysinger 1ed68b884c libgloss: merge rx into top-level Makefile
Avoid a recursive make to speed things up a bit.
A rx-elf build shows installed objects & libs produce same code.
2024-01-19 20:26:52 -05:00
Mike Frysinger 3342c0ef81 libgloss: merge xstormy16 into top-level Makefile
Avoid a recursive make to speed things up a bit.
A xstormy16-elf build shows installed objects & libs produce same code.
2024-01-19 20:26:52 -05:00
Mike Frysinger 695404d16f libgloss: merge nds32 into top-level Makefile
Avoid a recursive make to speed things up a bit.
A nds32le-elf build shows installed objects & libs produce same code.
2024-01-19 20:26:52 -05:00
Mike Frysinger f4c8e1623b libgloss: merge mcore into top-level Makefile
Avoid a recursive make to speed things up a bit.
A mcore-elf build shows installed objects & libs produce same code.
2024-01-19 20:26:52 -05:00
Mike Frysinger 41de4b00f7 libgloss: merge mn10200 into top-level Makefile
Avoid a recursive make to speed things up a bit.
Untested, but follows the same pattern as mn10300, but simpler.
2024-01-19 20:26:52 -05:00
Mike Frysinger 25f6d8772e libgloss: merge mn10300 into top-level Makefile
Avoid a recursive make to speed things up a bit.
A mn10300-elf build shows installed objects & libs produce same code.
2024-01-19 20:26:52 -05:00
Mike Frysinger 56211d0e14 libgloss: merge i386 into top-level Makefile
Avoid a recursive make to speed things up a bit.
A i386-elf build shows installed objects & libs produce same code other
than a rename from cygmon-gmon.o & cygmon-salib.o to i386_libcygmon_a-*.o
due to the use of custom CPPFLAGS in here.
2024-01-19 20:26:52 -05:00
Mike Frysinger 20dcee2c27 libgloss: merge frv into top-level Makefile
Avoid a recursive make to speed things up a bit.
A frv-elf build shows installed objects & libs produce same code.
2024-01-19 20:26:52 -05:00
Mike Frysinger 787b83bb9b libgloss: merge msp430 into top-level Makefile
Avoid a recursive make to speed things up a bit.
A msp430-elf build shows installed objects & libs produce same code.
2024-01-19 20:21:05 -05:00
Mike Frysinger f904792808 libgloss: msp430: delete custom .S.o rule
This was added to specify -Wa,-gdwarf2 when compiling the assembly
files.  Considering the size of these .S files, it seems unnecessary
overkill and complicates the build system.  All but one of these
compile down to 6 or fewer lines, and those hardly need extra debug
for anyone who is poking msp430 assembly.  The 1 file that is larger
than that (crt_move_highdata.S) is still <15 insns.

This will also simplify merging it into the top-level Makefile.
2024-01-19 20:21:05 -05:00
Mike Frysinger f5c40e04e5 libgloss: msp430: split up crt0.S source
The build system compiles crt0.S many times to produce independent
object files by defining different -DLxxx symbols for each.  This
complicates the build, and has led to some bugs in the source and
build (see the previous cleanup commits in here).  The crt_bss.S
file has also been duplicated with crt0.S leading to confusion as
to which one is the "real" one.  The only reason to keep them in
one file is to make management of the section numbers when calling
START_CRT_FUNC a little easier, but that seems trivial to check
with a quick grep across all the files.

Considering how complicated the build is now, and the bugs we've
had as a result, split the crt0.S file up into multiple source
files so we don't have to compile it multiple times.  This will
also simplify merging it into the top-level Makefile.
2024-01-19 20:21:05 -05:00
Mike Frysinger 2b0fd70308 libgloss: msp430: delete stub crt_init.o
This object is created by compiling crt0.S with -DLinit, but there
has never been an "#if Linit" check in crt0.S, so this has always
produced a stub object file.  Drop compiling it entirely.
2024-01-19 20:21:05 -05:00
Mike Frysinger 0ed55d03b7 libgloss: msp430: delete outdated/wrong code
The #if 0 & comment imply this code doesn't exist and is never used,
except there's another #if Lrun_fini_array section below which *does*
define this function, which makes this code comment confusing.  This
seems to be a hold over of the cleanup of the minrt code in the old
commit 884b05b54e ("MSP430: Remove
.init/.fini sections").
2024-01-19 20:21:05 -05:00
Mike Frysinger 58da258561 libgloss: add per-file & per-dir flag support
This logic is copied from what's used in newlib today.  This allows
subdirs to easily define per-directory flags & per-file flags without
having to setup unique automake rules for each one.
2024-01-19 20:20:46 -05:00
Mike Frysinger 0714c6305a libgloss: add some objcopy/objdump build rules
A bunch of ports have manual rules to generate disassembly, srec, and
binary files from test programs.  Add top-level pattern rules so every
test program gets this for free, and we don't have to duplicate it in
every subdir.
2024-01-19 20:09:28 -05:00
Mike Frysinger 1adfc9ac37 libgloss: check for objcopy & objdump properly
A bunch of ports hack together these values rather than setting them
up in the configure script for everyone.
2024-01-19 19:51:35 -05:00
Venkata Ramanaiah Nalamothu c419bbb341 RISC-V: fix setting up std streams in init_semihosting()
Currently init_semihosting() assumes the return value from _open()
call as the file descriptor handle and that is incorrect.

The semihost _open() call returns the fdtable index returned by the
__add_fdentry() for the file opened.
2024-01-10 10:46:56 +01:00
Hau Hsu 573458e7fc RISC-V: Initialize the jvt CSR
Set symbol '__jvt_base$' as weak. So if the symbol is not set in the
linker script, the address would be 0. We initialize jvt CSR only if
the address is not 0.

Also use csr number directly instead of using symbolic name to prevent the
backward incompatible issue.

psabi reference:
2d770815dc/riscv-elf.adoc (table-jump-relaxation)
2024-01-08 13:12:06 +01:00
Mike Frysinger 6bbeed74ca libgloss: merge i960 into top-level Makefile
Avoid a recursive make to speed things up a bit.
I can't test this as current versions of binutils doesn't support i960.
2024-01-03 03:49:10 -05:00
Mike Frysinger 6879bfa7c2 libgloss: i960: delete dead/broken code
The i960 port has a lot of references to sim files that have never been
included in the tree afaict, and thus has never worked.  Delete all the
code to simplify.
2024-01-03 03:48:41 -05:00
Mike Frysinger 6a3bc17465 libgloss: merge v850 into top-level Makefile
Avoid a recursive make to speed things up a bit.
A v850e-elf build shows installed objects & libs produce same code.
2024-01-03 03:47:59 -05:00
Mike Frysinger 50d6410160 libgloss: merge moxie into top-level Makefile
Avoid a recursive make to speed things up a bit.
A moxie-elf build shows installed objects & libs produce same code.
2024-01-03 03:44:26 -05:00
Mike Frysinger cd75406286 libgloss: moxie: delete unused/invalid assembly file
This is a .c file, not assembly, and it's a duplicate (same content)
as the existing sim-lseek.c.  Delete it since it's unused and doesn't
actually compile.
2024-01-03 03:41:55 -05:00
Mike Frysinger a2ddc21f80 libgloss: fix up incorrect "it's" 2024-01-03 00:14:42 -05:00
Jeff Law 3d10b04f1e Fix various c99/gcc-14 issues in generic libgloss code
Similar to what's been done in the ports, but this time in generic code.

Add missing #includes to pick up prototypes.  Add prototypes for various
internal functions where needed.  Fix signatures of various functions to match
what's provided by the headers (read, sbrk, write, unlink).

Nearly done with this effort ;-)

Pushed to the trunk,
2023-12-29 21:31:27 -07:00
Jeff Law 7ef32a98cd Fix another missing header file for mcore libgloss
I guess I must have missed this when working through the trivial port specific
changes.

This adds an include of stdlib.h to get a prototype for exit().

Pushed to the trunk.
2023-12-29 21:23:26 -07:00
Mike Frysinger a84860f488 libgloss: sparc: add missing m4 include
Commit 8d75828378 ("libgloss: merge
sparc configure script up a level") missed including the sparc
acinclude.m4 file which meant none of the sparc-specific vars were
propagating to the sub-makefile.
2023-12-29 21:07:08 -05:00
Mike Frysinger 98230b7db1 libgloss: xtensa: fix crt0.o rule
Don't hardcode a custom rule for this -- reuse libobjs_a_SOURCES
which was designed for this exact scenario.
2023-12-29 20:59:38 -05:00
Jeff Law 1df8f9f09b Fix epiphany libgloss for c99/gcc-14
So in this case we mostly need to include an internal header
(epiphany-syscalls.h).  In a few cases an explicit prototype is added.  We've
also got a return with no value in a function with a non-void return type.
Finally the asm_syscall interface expects a pointer as its first argument.  In
a few cases we've actually got an int (file descriptor) which we just cast to a
void *.

It's slightly more than Jeff J's pre-approval, but I think still reasonable.
2023-12-22 21:29:56 -07:00
Jeff Law 5e79655f38 Fix most of m32r libgloss for c99/gcc-14
Make implicit its explicit, add missing prototypes and header includes.  This
does not fix m32r-stub.c which needs more than the trivial work that Jeff J has
pre-approved.
2023-12-22 21:21:52 -07:00
Jeff Law 73ba287338 Fix mcore libgloss port for c99/gcc-14
Missing headers and prototypes, much like other ports.
2023-12-22 21:17:36 -07:00
Jeff Law a1a21442bc Fix rl78 libgloss port for c99/gcc-14
Needed a prototype for SYS_write and the prototype for write was incorrect
(returns an int, not a char *).
2023-12-22 21:00:35 -07:00
Jeff Law f7d5bd9bbf Fix c6x libgloss port for c99/gcc-14
Just one missing header in this case...
2023-12-22 20:57:47 -07:00
Jeff Law 886eadb78e Fix ft32 libgloss for c99/gcc-14
Just one missing header for this libgloss port.
2023-12-22 20:48:21 -07:00
Jeff Law 9f3e8ba3b2 Fix frv libgloss bits for c99/gcc-14\
Same as we've seen elsewhere.  Add missing prototype and header include.
2023-12-22 20:40:21 -07:00
Jeff Law 7382f54405 Fix v850 libgloss for c99/gcc-14
So the prior patch for sysnecv850 was in newlib.  This time we're fixing v850
bits in libgloss.

Like other patches submitted recently, this converts implicit ints to explicit
ints, adds a missing prototype and header includes.
2023-12-22 20:19:58 -07:00
Jeff Law bdcfea3a24 Fix iq2000 libgloss for c99/gcc-14
Similar to the others in this space.  Make implicit ints explicit ints. Add
prototype for _write in sbrk.c.
2023-12-21 12:43:27 -07:00
Jeff Law 7a45daad91 Re: libgloss c99 fixes for mn10300-elf
Very similar to other patches in this space.  Avoid implicit int types and add
missing #includes so that this code works with gcc-14.
2023-12-21 00:01:54 -07:00
Jeff Johnston 5fa3b84da0 Regenarate libgloss/Makefile.in 2023-12-20 17:13:18 -05:00
Mike Frysinger 30c469f2e8 libgloss: doc: generate single page & split html manuals
By default, only split node html manuals are generated.  Change the
default to single page, and add an extra rule to also generate the
split page manual.
2023-12-19 17:04:41 -05:00
Mike Frysinger 751a3427e0 libgloss: drop $(INCLUDES) when using $(AS)
Since $(AS) is the assembler, passing it a list of preprocessor include
flags doesn't make much sense.  The files aren't preprocessed which means
`#include` lines aren't respected, and while it would affect `.include`
usage, we never use that, and it's extremely unlikely to change.  Plus,
it's extremely unlikely we'd have .s files in common places to include vs
contained entirely within a specific arch dir, and at that point, it can
be included directly (with no flags), or the arch can add the unique set
of include paths that it needs for itself.
2023-12-19 14:00:03 -05:00
Jeff Johnston f81bf08f7c Add generated files for Revert patch 2023-12-19 13:58:12 -05:00
Mike Frysinger b67114d7d8 Revert "Fix libgloss/newlib build to conditionally use top include dir"
This reverts commit 17ac400c11.

The build failures were due to incorrectly using $(INCLUDES) when
running $(AS).  Let's roll this back and drop $(INCLUDES) from the
$(AS) invocations.
2023-12-19 13:37:02 -05:00
Jeff Law c2c9f05a05 libgloss fix for bfin port
gcc-14 will complain loudly both for calling a function without an in-scope
prototype or when the in scope prototype differs from the known signature.

"main" happens to be one of the functions the compiler knows about.  So not
only do we need to prototype it, we need to make sure the prototype matches
what GCC thinks it should be.

This fixes the bfin libgloss port to do the right thing for bfin-elf.
2023-12-18 21:29:51 -07:00
Jeff Law 57e311e0de Re: Fix moxie libgloss issues with c99
Two libgloss issues specific to moxie-elf that show up build with GCC trunk.

First, putnum.c uses "print" without a prototype.  So I added one based on the
function's definition in print.c.  Second sim-inbyte.c uses read, which comes
from unistd.h, so this adds a suitable #include.
2023-12-16 21:11:10 -07:00
Jeff Law 17a6aff334 Fix fr30 libgloss build
gcc-14 will default to c99 and as a result a fair amount of old code in newlib
(particularly libgloss) is failing to build.  I don't offhand know how many
patches will be necessary to fix the various failures. I'll just pick them off
one by one from my tree.

This particular patch works around the return-mismatch problem syscalls.c for
fr30.

That file is a bit odd in that most functions are declared as returning an
integer, but the implementations look like:

> int
> _read (file, ptr, len)
>      int    file;
>      char * ptr;
>      int    len;
> {
>   asm ("ldi:8 %0, r0" :: "i" (SYS_read) : "r0");
>   asm ("int   #10");
>
>   return;
> }

Note the lack of a value on the "return" statement.  The assumption is that the
interrupt handler implementing syscalls will put the return value into the
proper register, so falling off the end of the C function or returning with no
value works in the expected way.  It's not good code, but it probably works.

Working from that assumption I decided to just use a pragma to disable the
upgraded diagnostic from GCC -- essentially preserving existing behavior.

This is the only fr30 specific issue that needs to be resolved and the only
issue (so far) I've seen of this specific nature.
2023-12-14 10:30:13 -07:00
Hans-Peter Nilsson 7cce4cdd6e libgloss/cris: Make C declarations present and match them
This is the libgloss part.
Recently, there was a change in gcc such that implicit function
declarations and type mismatches are now errors, no longer just
warnings.  Fix by adding and correcting declarations warned about;
including the right header or adding a declaration (for "main" in
lcrt0.c) and adjust to those types as necessary.
2023-12-06 18:45:57 +01:00
Kito Cheng bcd1883560 RISC-V: Fix -Wint-conversion warning
Upstream GCC has change this warning into error by default, so...we need
to explicitly convert the type from pointer from/to integer, generally
it's unsafe, but we know what we are doing here.

However it's not safe for ilp32 on RV64, but we didn't support that yet, so I
think this fix is good enough now :)
2023-12-04 10:26:41 +01:00
Kuan-Wei Chiu 5f15d7c581 RISC-V: Fix timeval conversion in _gettimeofday()
Replace multiplication with division for microseconds calculation from
nanoseconds in _gettimeofday function.

Signed-off-by: Kuan-Wei Chiu <visitorckw@gmail.com>
2023-11-29 10:14:55 +01:00
Alexey Lapshin 55485616ba Bring back libsim.a for riscv 2023-09-18 22:49:15 -04:00
Alexey Lapshin 42fc2fa37c libgloss: add Xtensa port
Supported esp32 and esp32s2 boards:
https://github.com/espressif/esp-toolchain-docs/blob/main/gcc/build-and-run-native-app.md
2023-08-24 10:52:36 -04:00
Torbjörn SVENSSON b9e867d088 Add stub for getentropy
Example test case that fails with undefined reference to getentropy:

Testing g++.robertl/eb77.C,  -std=c++20
doing compile
Executing on host: /build/gcc-13-2709-g9ac9fde961f/bin/arm-none-eabi-g++  /build/src/gcc/gcc/testsuite/g++.old-deja/g++.robertl/eb77.C  -mthumb -march=armv6s-m -mcpu=cortex-m0 -mfloat-abi=soft -fdiagnostics-plain-output   -fmessage-length=0  -std=c++20 -pedantic-errors -Wno-long-long        -Wl,--start-group -lc -lm -Wl,--end-group --specs=nosys.specs -Wl,--allow-multiple-definition -Wl,-u,_isatty,-u,_fstat   -Wl,-wrap,exit -Wl,-wrap,_exit -Wl,-wrap,main -Wl,-wrap,abort -Wl,g++_tg.o -lm -o ./eb77.exe    (timeout = 800)
spawn -ignore SIGHUP /build/gcc-13-2709-g9ac9fde961f/bin/arm-none-eabi-g++ /build/src/gcc/gcc/testsuite/g++.old-deja/g++.robertl/eb77.C -mthumb -march=armv6s-m -mcpu=cortex-m0 -mfloat-abi=soft -fdiagnostics-plain-output -fmessage-length=0 -std=c++20 -pedantic-errors -Wno-long-long -Wl,--start-group -lc -lm -Wl,--end-group --specs=nosys.specs -Wl,--allow-multiple-definition -Wl,-u,_isatty,-u,_fstat -Wl,-wrap,exit -Wl,-wrap,_exit -Wl,-wrap,main -Wl,-wrap,abort -Wl,g++_tg.o -lm -o ./eb77.exe
pid is 28414 -28414
/build/gcc-13-2709-g9ac9fde961f/bin/../lib/gcc/arm-none-eabi/13.0.0/../../../../arm-none-eabi/bin/ld: /build/gcc-13-2709-g9ac9fde961f/bin/../lib/gcc/arm-none-eabi/13.0.0/../../../../arm-none-eabi/lib/thumb/v6-m/nofp/libstdc++.a(random.o): in function `std::(anonymous namespace)::__libc_getentropy(void*)':
(.text._ZNSt12_GLOBAL__N_117__libc_getentropyEPv+0x8): undefined reference to `getentropy'
/build/gcc-13-2709-g9ac9fde961f/bin/../lib/gcc/arm-none-eabi/13.0.0/../../../../arm-none-eabi/bin/ld: /build/gcc-13-2709-g9ac9fde961f/bin/../lib/gcc/arm-none-eabi/13.0.0/../../../../arm-none-eabi/lib/thumb/v6-m/nofp/libstdc++.a(random.o): in function `std::random_device::_M_init(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':
(.text._ZNSt13random_device7_M_initERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE+0x58): undefined reference to `getentropy'
/build/gcc-13-2709-g9ac9fde961f/bin/../lib/gcc/arm-none-eabi/13.0.0/../../../../arm-none-eabi/bin/ld: /build/gcc-13-2709-g9ac9fde961f/bin/../lib/gcc/arm-none-eabi/13.0.0/../../../../arm-none-eabi/lib/thumb/v6-m/nofp/libc.a(libc_a-arc4random.o): in function `_rs_stir':
(.text._rs_stir+0x8): undefined reference to `getentropy'
collect2: error: ld returned 1 exit status
pid is -1
close result is 28414 exp6 0 1
output is /build/gcc-13-2709-g9ac9fde961f/bin/../lib/gcc/arm-none-eabi/13.0.0/../../../../arm-none-eabi/bin/ld: /build/gcc-13-2709-g9ac9fde961f/bin/../lib/gcc/arm-none-eabi/13.0.0/../../../../arm-none-eabi/lib/thumb/v6-m/nofp/libstdc++.a(random.o): in function `std::(anonymous namespace)::__libc_getentropy(void*)':
(.text._ZNSt12_GLOBAL__N_117__libc_getentropyEPv+0x8): undefined reference to `getentropy'
/build/gcc-13-2709-g9ac9fde961f/bin/../lib/gcc/arm-none-eabi/13.0.0/../../../../arm-none-eabi/bin/ld: /build/gcc-13-2709-g9ac9fde961f/bin/../lib/gcc/arm-none-eabi/13.0.0/../../../../arm-none-eabi/lib/thumb/v6-m/nofp/libstdc++.a(random.o): in function `std::random_device::_M_init(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':
(.text._ZNSt13random_device7_M_initERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE+0x58): undefined reference to `getentropy'
/build/gcc-13-2709-g9ac9fde961f/bin/../lib/gcc/arm-none-eabi/13.0.0/../../../../arm-none-eabi/bin/ld: /build/gcc-13-2709-g9ac9fde961f/bin/../lib/gcc/arm-none-eabi/13.0.0/../../../../arm-none-eabi/lib/thumb/v6-m/nofp/libc.a(libc_a-arc4random.o): in function `_rs_stir':
(.text._rs_stir+0x8): undefined reference to `getentropy'
collect2: error: ld returned 1 exit status
 status 1
compiler exited with status 1
FAIL: g++.old-deja/g++.robertl/eb77.C  -std=c++20 (test for excess errors)
Excess errors:
(.text._ZNSt12_GLOBAL__N_117__libc_getentropyEPv+0x8): undefined reference to `getentropy'
(.text._ZNSt13random_device7_M_initERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE+0x58): undefined reference to `getentropy'
(.text._rs_stir+0x8): undefined reference to `getentropy'
UNRESOLVED: g++.old-deja/g++.robertl/eb77.C  -std=c++20 compilation failed to produce executable

Contributed by STMicroelectronics

Signed-off-by: Torbjörn SVENSSON <torbjorn.svensson@foss.st.com>
2023-08-09 11:38:03 +02:00
Sebastian Huber 59de816715 libgloss/epiphany: Fix move instruction in crt0.S
This patch relates to bug report:

https://sourceware.org/bugzilla/show_bug.cgi?id=30212
2023-03-08 14:27:52 -05:00
Srinath Parvathaneni 1d3d2ba54b arm: Restrict processor mode change when in hypervisor mode
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-03 13:27:31 +00:00
Srinath Parvathaneni b782dcb2b3 arm: Fix the SP used in setting stack limit for standalone application.
Move the instruction that saves SP before the mode check so that
applications that start in USER mode correctly set the stack limit.
2023-03-03 13:20:29 +00:00
Jeff Johnston 17ac400c11 Fix libgloss/newlib build to conditionally use top include dir
- conditionally use -idirafter option for arm
2023-02-22 14:53:05 -05:00
Mike Frysinger 73e4ded2fe libgloss: csky: fix pointer-to-integer warning
parameters is an array of integers, so assigning NULL (a pointer)
doesn't make sense.  Use 0 instead which produces the same code.
2023-01-13 17:24:17 -05:00
Mike Frysinger 4391d2aed3 libgloss: merge csky into top-level Makefile
Avoid a recursive make to speed things up a bit.
A csky-elf build shows installed objects & libs produce same code.
2023-01-13 17:24:17 -05:00
Xianmiao Qu 7f4c04755e libgloss: csky: use atexit to call fini-array functions.
__libc_fini_array should be called upon exit to call the
global termination functions in fini-array, use atexit to
register it at __start.
2023-01-13 14:08:23 +01:00
Mike Frysinger 3ef006f056 libgloss: merge nios2 into top-level Makefile
Avoid a recursive make to speed things up a bit.
A nios2-elf build shows installed objects & libs produce same code.
2023-01-12 05:26:57 -05:00
Mike Frysinger 0e1c0a02cf libgloss: merge d30v into top-level Makefile
Avoid a recursive make to speed things up a bit.
2023-01-11 08:42:19 -05:00
Mike Frysinger 5401db924f libgloss: merge arc into top-level Makefile
Avoid a recursive make to speed things up a bit.
2023-01-11 08:42:16 -05:00
Mike Frysinger 275b39e219 libgloss: merge arm into top-level Makefile
Avoid a recursive make to speed things up a bit.
2023-01-11 01:00:21 -05:00
Mike Frysinger 26f9cfd7a8 libgloss: arm: break newlib dependency
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.
2023-01-11 01:00:15 -05:00
Mike Frysinger 13a7b16ea3 libgloss: merge aarch64 into top-level Makefile
Avoid a recursive make to speed things up a bit.
2023-01-09 21:49:50 -05:00
Mike Frysinger d6468d6b9f libgloss: rs6000: fix incorrect install dir for xil files
The install steps were missing the multilib qualifier causing them
to always install in the same location and stomp each other.
2022-12-19 20:19:31 -05:00
Mike Frysinger 04411f45d0 libgloss: merge arm configure script up a level
Move the minor arm-specific logic to a dedicated variable so we can
merge its configure logic up a level.
2022-12-19 19:08:12 -05:00
Mike Frysinger 8893cd1006 libgloss: merge aarch64 configure script up a level
Move the minor aarch64-specific logic to a dedicated variable so we can
merge its configure logic up a level.
2022-12-19 19:08:12 -05:00
Mike Frysinger 2dfc4a9e97 libgloss: drop unused multi-build logic
Now that aarch64 & arm have migrated off this, we can punt it.
2022-12-19 19:07:38 -05:00
Mike Frysinger 6668403d2d libgloss: arm: inline multi-build logic
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-12-19 19:07:09 -05:00
Mike Frysinger 171d6fc1dc libgloss: aarch64: delete unused multi-build logic
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-12-19 18:50:20 -05:00
Mike Frysinger 42ddb40b58 libgloss: bfin: switch to CPPASCOMPILE for .S->.o
We're compiling .S files, so use CPPAS instead of CC to compile since
the point of CPPAS is to preprocess+assemble .S files.
2022-12-14 04:14:50 -05:00
Simon Cook 8c87ffd372 libgloss: riscv: Install machine/syscall.h
A recent change to the Makefile.in for riscv resulted in the
machine/syscall.h header not being installed. This updates the file
to install this file again.

Signed-off-by: Simon Cook <simon.cook@embecosm.com>
2022-10-20 16:53:06 +02:00
Palmer Dabbelt f59ff93046 libgloss: riscv: Convert to non-recursive automake
PR 29515 points out our documentation builds are broken, let's just move
over to the new non-recursive builds.

Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
2022-08-26 16:47:48 +02:00
Sebastian Huber 2faeaf50fd Use global atexit data for all configurations
For the exit processing only members of _GLOBAL_REENT were used by default.  If
the _REENT_GLOBAL_ATEXIT option was enabled, then the data structures were
provided through dedicated global objects.  Make this option the default.
Remove the option.  Rename struct _reent members _atexit and _atexit0 to
_reserved_6 and _reserved_7, respectively.  Provide them only if
_REENT_BACKWARD_BINARY_COMPAT is defined.
2022-05-18 07:45:09 +02:00
Dimitar Dimitrov 21f0edbf9f libgloss: pru: Fix _open syscal arguments
The _open() C function is declared as having variable arguments in
newlib, so second and third arguments are passed on stack. Add code to
move them into registers, since that's where the PRU simulator expects
them.

Issue was exposed by the GCC test gcc.c-torture/execute/fprintf-2.c,
which relies on tmpnam implementation to pass correct flags to _open.

Signed-off-by: Dimitar Dimitrov <dimitar@dinux.eu>
2022-04-27 11:43:08 +02:00
Jeff Law 157f03053d Revert accidental change to v850/sim.ld 2022-03-20 10:19:45 -04:00
Jeff Law 0c8679e080 Avoid using common symbols in v850 libgloss
I've had this lying around for probably a year or two at this point.
It just changes all the instance of "errno" from a common symbol to an
extern.  I can't offhand recall where the actual definition is, but it
certainly exists in the generic code.
2022-03-19 20:01:33 -04:00
Mike Frysinger 845515267b libgloss: add new Build System Internals node to the menu
Seems that some versions of texinfo require the @menu to have all
entries at the top level, so add the new build one to it.
2022-03-04 01:04:25 -05:00
Mike Frysinger 74885d4fbd libgloss: merge lm32 into top-level Makefile
Avoid a recursive make to speed things up a bit.

This drops the header install logic because the lm32/ subdir doesn't
actually have any header files to install.
2022-03-01 20:29:07 -05:00
Mike Frysinger 89f643e87b libgloss: use m4_foreach_w to simplify the logic a bit
It's functionally the same, but the configure.ac code is simpler and
less boiler plate duplicated.
2022-03-01 20:29:07 -05:00
Mike Frysinger ed459780f4 libgloss: add a little build system generation documentation
This is a bit of an abbreviated form of what's in the Newlib subdir,
but with emphasis on Libgloss-specific parts, and anything unique to
it.  I haven't put too much effort in.
2022-02-28 19:05:32 -05:00
Mike Frysinger 69d93f3121 libgloss: iq2000: fix prototype 2022-02-25 23:08:45 -05:00
Mike Frysinger 7f674bb4da libgloss: switch to AM_PROG_AR
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-25 23:07:20 -05:00
Mike Frysinger e56bdf902b libgloss: document & localize custom multi-do rule
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-24 19:12:45 -05:00
Mike Frysinger 15d7e0d417 libgloss: finish migration to AM_PROG_AS
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-24 19:10:39 -05:00
Mike Frysinger 7edb25725d libgloss: switch to standard AC_PROG_CC
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-24 19:06:21 -05:00
Mike Frysinger 8d75828378 libgloss: merge sparc configure script up a level
Move the minor sparc-specific logic to a dedicated variable so we can
merge its configure logic up a level.
2022-02-23 19:44:10 -05:00
Mike Frysinger 4ed502ba02 libgloss: enable maintainer mode support
Use AM_MAINTAINER_MODE so devs have to opt-in to automatic rebuilds
of autotools.  This matches what newlib (and most every other GNU
toolchain package) does with automake.
2022-02-22 17:09:16 -05:00
Matt Joyce 44b60f0c4b Make __sdidinit unused
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-22 12:38:46 +01:00
Mike Frysinger 2d53aadcc5 libgloss: have README point to the manual
The README has such little info in it, so point people to the much
more extensive porting manual.
2022-02-17 20:41:53 -05:00
Mike Frysinger 7a1c557b8e libgloss: merge mips configure script up a level
Move the minor mips-specific logic to a dedicated file & namespace
them so we can merge its configure logic up a level.
2022-02-17 20:36:41 -05:00
Mike Frysinger f9dc151186 libgloss: merge wince configure script up a level
Move the minor wince-specific logic to a dedicated file & namespace
them so we can merge its configure logic up a level.  The makefile
is a bit tricky, but maybe it still works.
2022-02-17 20:35:32 -05:00
Mike Frysinger e0c0ad8268 libgloss: build with -nostdinc
We don't want libgloss building against C library headers that happened
to be installed with the toolchain, so add -nostdinc to the build.  We
still need access to the compiler internal headers, so probe those and
include them via -isystem.  This uses a similar probing style as glibc,
which has used it for over a decade, so it should be safe & stable.

This should prevent any latent bugs due to testing with a toolchain that
is fully configured & installed already.
2022-02-16 20:29:08 -05:00
Mike Frysinger 5ca1f8c7ff libgloss: sparc: merge libsys/ up a level
The libsys/configure script isn't doing anything useful, so merge
the logic up to the parent dir.
2022-02-16 20:24:27 -05:00
Mike Frysinger aff735e4c6 libgloss: aarch64: merge cpu-init/ up a level
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-16 20:23:26 -05:00
Mike Frysinger 538a37be5b libgloss: merge mn10300 configure script up a level
Move the minor mn10300-specific logic to a dedicated file & namespace
them so we can merge its configure logic up a level.  part_specific_obj
wasn't used anywhere (looks like copy & paste left over from mips), so
drop it entirely.
2022-02-16 20:20:14 -05:00
Mike Frysinger 0c45c7ce67 libgloss: merge mn10200 configure script up a level
The mn10200-specific logic (setting up part_specific_obj) isn't used
by the build anywhere -- looks like copy & paste left overs from mips.
So punt that & merge the target_makefile_frag_path up to the top-level.
2022-02-16 20:16:05 -05:00