Age | Commit message (Collapse) | Author | Files | Lines |
|
|
|
|
|
This patch adds missing function declarations in several m68k-specific
libgloss source files. This helps avoid implicit declaration compiler
warnings / errors and ensures better portability.
Tested by building newlib for m68k-elf with GCC.
|
|
This _isr_vec_count=1 is prevalent in MIPS Open FGPA examples.
Looks like forcing _isr_vec_007 in to the link was a mistake
and we always intended to only include the top-level _isr_vec
symbol.
Signed-off-by: Jovan Dmitrović <jovan.dmitrovic@htecgroup.com>
|
|
The compiler driver positions the linker script at the end of the linker
command-line, after crtend.o. As a result, any INPUT objects and archive
GROUPs introduced by the linker script end up after crtend.o. This messes up
the end-of-frame marker provided by crtend.o
This has always been a problem, but a recent binutils update to clean-up
redundant NULL markers in .eh_frame exposes it as a execution failure in
exception-handling tests. This patch re-orders .eh_frame in all linker
scripts so that the one from crtend.o is placed last.
An alternative approach would be to fix the compiler driver to put
the linker script before the ENDFILE spec.
Signed-off-by: Jovan Dmitrović <jovan.dmitrovic@htecgroup.com>
|
|
Signed-off-by: Jovan Dmitrović <jovan.dmitrovic@htecgroup.com>
|
|
Add .eh_frame_hdr and .gnu_extab to linker scripts for compactEH
Fix orphaned .gcc_except_table sections in uhi32.ld.
Fix orphaned .gcc_except_table sections in mti32.ld.
Signed-off-by: Jovan Dmitrović <jovan.dmitrovic@htecgroup.com>
|
|
srec2hex.pl is a PERL script file which converts S-record file
to a MIPS HEX file, which can be useful for some simulation
environments.
Signed-off-by: Jovan Dmitrović <jovan.dmitrovic@htecgroup.com>
|
|
Make using MIPS HAL component easier by including `mipshal.mk`
into source Makefile.
Signed-off-by: Jovan Dmitrović <jovan.dmitrovic@htecgroup.com>
|
|
Implement abstract interface for MIPS, including unified hosting
interface (UHI).
Signed-off-by: Jovan Dmitrović <jovan.dmitrovic@htecgroup.com>
|
|
The __inln prototype was defined as:
extern char * __inln ();
In old versions of C, this meant "this function takes an unspecified
number of parameters". This seems to have changed, as GCC 14 now
considers that the function took zero parameters.
As the code called it with one parameter, GCC would then issue an error
saying that the incorrect number of parameters was passed.
Address this issue by changing the prototype of the __inln function.
Signed-off-by: Paul Cercueil <paul@crapouillou.net>
|
|
@direntry automatically generates START/END-INFO-DIR-ENTRY. Specifying
them again in the source causes install-info to choke on the resulting
info file:
install-info: START-INFO-DIR-ENTRY without matching END-INFO-DIR-ENTRY
|
|
With recent GCC changes that have elevated some warnings to error by
default the rs6000 sim code errors out with:
libgloss/rs6000/sim-inbyte.c:22:7: error: implicit declaration of function 'read' [-Wimplicit-function-declaration]
libgloss/rs6000/sim-sbrk.c:26:7: error: implicit declaration of function 'brk'; did you mean 'sbrk'? [-Wimplicit-function-declaration]
libgloss/rs6000/sim-abort.c:19:3: error: implicit declaration of function 'write' [-Wimplicit-function-declaration]
libgloss/rs6000/sim-abort.c:20:3: error: implicit declaration of function 'exit' [-Wimplicit-function-declaration]
libgloss/rs6000/sim-print.c:29:3: error: implicit declaration of function 'write' [-Wimplicit-function-declaration]
libgloss/rs6000/mvme-print.c:34:11: error: implicit declaration of function '__pcrlf' [-Wimplicit-function-declaration]
libgloss/rs6000/mvme-print.c:44:19: error: implicit declaration of function '__outln' [-Wimplicit-function-declaration]
libgloss/rs6000/mvme-print.c:53:15: error: implicit declaration of function '__outstr' [-Wimplicit-function-declaration]
libgloss/rs6000/mbx-print.c:29:3: error: implicit declaration of function 'write' [-Wimplicit-function-declaration]
Add extern declarations to avoid the errors.
|
|
Update the macro check so that rv64e builds successfully.
Signed-off-by: Eric Salem <ericsalem@gmail.com>
|
|
The large code model assume the data may far away from the code, so we
must put the address of the target data wihin the `.text` section,
normally we will just put within the function or nearby the function to
prevent it out-of-range.
Report from riscv-gnu-toolchain:
https://github.com/riscv-collab/riscv-gnu-toolchain/issues/1699
Verified with riscv-gnu-toolchain with rv64gc.
|
|
When building newlib for multicore environments we specify __OR1K_MULTICORE__
which switches the build to allocate one struct _or1k_reent per CPU
dynamiocally.
This was using a strange definition of (*_or1k_reent)[], and causing
the following compiler error:
./gnu-toolchain/newlib/libgloss/or1k/impure.c: In function ‘_or1k_reent_init’:
./gnu-toolchain/newlib/libgloss/or1k/impure.c:121:21: error: assignment to ‘struct ..
121 | _or1k_reent = (struct _or1k_reent*) _sbrk_r(0, memsize);
|
Fix this compiler error by changing the or1k_reent definition to a pointer
to structs.
Signed-off-by: Stafford Horne <shorne@gmail.com>
|
|
Commit 8a8fb570d7c5310a03a34b3dd6f9f8bb35ee9f40 introduced a declaration
for "print", which conflicts with the incompatible declaration in
pru/putnumc.c.
Fix by removing the duplicate in pru/putnum.c, and rely on the
declaration in "glue.h".
Signed-off-by: Dimitar Dimitrov <dimitar@dinux.eu>
|
|
This is to improve compatibility with LLVM clang: .align 0 is a special case for GCC that is not handled by clang.
Change-Id: I855939a32294c74813ecce7275a362265dbc3b1a
|
|
* Use mrc p15 co-processor instruction syntax.
* Align register_names so that we can use ADR rather than ADRL.
Change-Id: I005cd5a1fc55ec8eba90929c6c70d6a202b0746d
|
|
* glue.h (print): Provide prototype.
* kill.c: Prototype _exit with noreturn attribute.
* mips/cfe_mem.c (memtop): Change to a pointer type.
(__libcfe_meminit): Add casts to avoid compilation
warnings/errors.
* mips/cma101.c: Prototype __cpu_timer_poll and __cpu_flush.
(convertbcd): Update K&R-style function declaration.
(time): Likewise.
* mips/nullmon.c (get_mem_info): Likewise.
* mips/syscalls.c: Declare struct s_mem and prototype get_mem_info.
(sbrk): Update K&R-style function declaration. Add casts to avoid
compilation warnings/errors.
* mips/test.c: Prototype outbyte and print. Fix return type of main.
* print.c (print): Make ptr argument const char*.
* putnum.c: Remove print prototype, which is now in glue.h.
* write.c: Remove outbyte prototype, which is now in glue.h.
Co-authored-by: Mike Frysinger <vapier@gentoo.org>
|
|
clock() system call is used in some GDB tests thus it is
necessary to implement it for testing purposes. A value
for clock() is taken from a default timer (timer 0). If it is
not presented than the error value (-1) is returned.
Signed-off-by: Yuriy Kolerov <ykolerov@synopsys.com>
|
|
Stub function for _getentropy is presented in libnosys and it is
not presented in libgloss libraries for ARC. When libstdc++ is
built it detects that _getentropy is presented in the default
libgloss library (libnosys). However, then GCC fails to link
applications with another libgloss libraries like nSIM, HostLink,
boards, etc. because of missing _getentropy stub in corresponding
libraries.
Here is an example:
$ cat getentropy.cpp
#include <unistd.h>
int main () {
unsigned i;
::getentropy(&i, sizeof(i));
return 0;
}
$ arc64-elf-g++ -mcpu=hs6x -specs=nsim.specs getentropy.cpp
...
... undefined reference to `_getentropy'
collect2: error: ld returned 1 exit status
Thus, it is necessary to add _getentropy stub to all ARC
libgloss libraries to prevent errors while building even
simple C++ programs.
Signed-off-by: Yuriy Kolerov <ykolerov@synopsys.com>
|
|
In my build the below are treated as error now and causing failures. I
have described the fixes of each warning below.
In newlib/libc/sys/or1k/mlock.c:
CC libc/sys/or1k/libc_a-mlock.o
newlib/libc/sys/or1k/mlock.c: In function ‘__malloc_lock’:
newlib/libc/sys/or1k/mlock.c:56:19: warning: implicit declaration of function ‘or1k_critical_begin’ [-Wimplicit-function-declaration]
56 | restore = or1k_critical_begin();
| ^~~~~~~~~~~~~~~~~~~
newlib/libc/sys/or1k/mlock.c: In function ‘__malloc_unlock’:
newlib/libc/sys/or1k/mlock.c:93:17: warning: implicit declaration of function ‘or1k_critical_end’ [-Wimplicit-function-declaration]
93 | or1k_critical_end(restore);
| ^~~~~~~~~~~~~~~~~
This patch adds prototypes for functions or1k_critical_begin and
or1k_critical_end to suppress the warning, inline with what we do for
or1k_sync_cas.
In libgloss/or1k/or1k_uart.c:
libgloss/or1k/or1k_uart.c: In function ‘or1k_uart_set_read_cb’:
libgloss/or1k/or1k_uart.c:163:25: warning: passing argument 2 of ‘or1k_interrupt_handler_add’ from incompatible pointer type [-Wincompatible-pointer-types]
163 | _or1k_uart_interrupt_handler, 0);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
| |
| void (*)(uint32_t) {aka void (*)(long unsigned int)}
In file included from libgloss/or1k/or1k_uart.c:19:
libgloss/or1k/include/or1k-support.h:97:45: note: expected ‘or1k_interrupt_handler_fptr’ {aka ‘void (*)(void *)’} but argument is of type ‘void (*)(uint32_t)’ {aka ‘void (*)(long unsigned int)’}
97 | or1k_interrupt_handler_fptr handler,
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~
The public API is ‘void (*)(void *)' for our interrupt handlers. The
function _or1k_uart_interrupt_hander is the internal default
implementation of the uart IRQ handler and it doesn't use the data
argument.
This patch updates the _or1k_uart_interrupt_handler argument type from
uint32_t to void* allowing the function prototype to match the required
prototype.
If we did have a 64-bit implementation it would be an ABI issue. But,
there never has been one, or1k is only 32-bit.
In libgloss/or1k/interrupts.c:
libgloss/or1k/interrupts.c: In function ‘or1k_interrupt_handler_add’:
libgloss/or1k/interrupts.c:41:52: warning: assignment to ‘void *’ from ‘long unsigned int’ makes pointer from integer without a cast [-Wint-conversion]
41 | _or1k_interrupt_handler_data_ptr_table[id] = (uint32_t) data_ptr;
| ^
The table _or1k_interrupt_handler_data_ptr_table is an array of void*
and data_ptr is void*. There is no need for the cast so remove it.
In libgloss/or1k/sbrk.c:
libgloss/or1k/sbrk.c:23:29: warning: initialization of ‘uint32_t’ {aka ‘long unsigned int’} from ‘uint32_t *’ {aka ‘long unsigned int *’} makes integer from pointer without a cast [-Wint-conversion]
23 | uint32_t _or1k_heap_start = &end;
|
This patch adds a cast, which is safe in or1k as the architecture in
32-bit only. But this code would not be 64-compatible.
Signed-off-by: Stafford Horne <shorne@gmail.com>
|
|
GCC commit r15-5326-gf242f79b8afe defaults to -std=gnu23, and in C23
void foo() means void foo(void), so old-style prototypes now get a
compilation error:
/x/libgloss/cris/lcrt0.c:107:1: error: conflicting types for 'start1';\
have 'void(int, char **, char **)'
107 | start1 (int argc, char **argv, char **env)
| ^~~~~~
/x/libgloss/cris/lcrt0.c:105:13: note: previous declaration of 'start1\
' with type 'void(void)'
105 | static void start1 () __asm__ ("__start1") __attribute ((__use\
d__));
Fix by providing a full prototype.
|
|
Remove sys/xtensa that is actually duplicate newlib's code.
Move used code to machine/xtensa or to libgloss
|
|
Synopsys ARCv3 ISA includes 32-bit ARC HS5x targets and
64-bit ARC HS6x targets. Both CPU families are placed
in "arc64" subdirectories as it done for GCC port.
Target name arc64 is used for historical reasons and
Synopsys ARCv3 baremetal toolchains contain multilib
configurations both for 32-bit and 64-bit families.
arc32 target name is reserved for 32-bit ARC HS5x
targets in case of non-multilib 32-bit builds.
Note that libgloss libraries for ARCv3 are compatible with
libgloss for ARCv1/2. Thus, Makefile.inc for libgloss uses
sources from libgloss/arc directory except crtX.S files.
Co-authored-by: Shahab Vahedi <list@vahedi.org>
Co-authored-by: Claudiu Zissulescu <claziss@gmail.com>
Co-authored-by: Bruno Mauricio <brunoasmauricio@gmail.com>
Co-authored-by: Luis Silva <luis.m.silva99@hotmail.com>
Signed-off-by: Yuriy Kolerov <ykolerov@synopsys.com>
|
|
There are 3 families of Synopsys DeisgnWare ARC processors:
ARCompact/ARCv1 (32-bit), ARCv2 (32-bit) and ARCv3 (32-bit
and 64-bit targets). Upstream Newlib supports only ARCv1/2.
This commit prepares ARCv1/2 libgloss port to be reused by
ARCv3 port (except crt* files). Note that __ARC64__ macro
stands for all ARCv3 targets.
Signed-off-by: Yuriy Kolerov <ykolerov@synopsys.com>
|
|
nSIM simulator supports exit codes. However, it's necessary
to pass an exit code to _exit_halt, otherwise it's undefined.
Signed-off-by: Yuriy Kolerov <ykolerov@synopsys.com>
|
|
It makes it usable with standard symbol names defined in default
linker scripts of the MetaWare toolchain.
Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
|
|
There's no semantic change, it's only to make the same code
compilable with MetaWare toolchian, which actually assumes
@x as a full name, not omitting @.
Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
|
|
Signed-off-by: Yuriy Kolerov <ykolerov@synopsys.com>
|
|
.align is supported by both GCC & MetaWare compiler for ARC,
yet implements the same semantics as .balign which only works
with GCC.
Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
|
|
Signed-off-by: Yuriy Kolerov <ykolerov@synopsys.com>
|
|
The linker needs to know whether a symbol is STT_FUNCTION when
deciding which farcall stub to emit (if needed), this patch adds this
to the FUNC_START macro which is used in crt0.
|
|
Add build rules to support packages for development boards and
nSIM hostlink.
Makefile.in is generated this way:
$ autoconf --version
autoconf (GNU Autoconf) 2.69
$ automake --version
automake (GNU automake) 1.15.1
$ cd libgloss
$ autoreconf -i
Signed-off-by: Yuriy Kolerov <kolerov93@gmail.com>
|
|
These specs files are introduced for EMSK board:
* emsk1_em4.specs - EMSKv1 with EM4 core, everything in
ICCM/DCCM memory
* emsk1_em6.specs - EMSKv1 with EM6 core, everything in
ICCM/DCCM memory
* emsk1_em6_ram.specs - EMSKv1 with EM6 core, startup code
in ICCM and everything else in RAM
* emsk2.1_em5d.specs - EMSKv2.1 with EM5D core, everything
in ICCM/DCCM memory
* emsk2.1_em7d.specs - EMSKv2.1 with EM7D core, everything
in ICCM/DCCM memory
* emsk2.1_em7d_ram.specs - EMSKv2.1 with EM7D core, startup
code in ICCM and everything else in RAM
* emsk2.2_em7d.specs - EMSKv2.2+ with EM7D core, everything
in ICCM/DCCM memory
* emsk2.2_em7d_ram.specs - EMSKv2.2+ with EM7D core, startup
code in ICCM and everything else in RAM
* emsk2.2_em9d.specs - EMSKv2.2+ with EM9D core, everything
in ICCM/DCCM memory
* emsk2.2_em9d_ram.specs - EMSKv2.2+ with EM9D core, startup
code in ICCM and everything else in RAM
* emsk2.2_em11d.specs - EMSKv2.2+ with EM11D core, everything
in ICCM/DCCM memory
* emsk2.2_em11d_ram.specs - EMSKv2.2+ with EM11D core, startup
code in ICCM and everything else in RAM
An example of building an application:
$ arc-elf32-gcc -mcpu=em -specs=emsk2.2_em11d_ram.specs main.c -o main
Signed-off-by: Vladimir Isaev <vvisaev@gmail.com>
Signed-off-by: Yuriy Kolerov <kolerov93@gmail.com>
|
|
These specs files are introduced for EM SDP board:
* emsdp1.1.specs - EM SDP 1.1, everything in ICCM/DCCM memory
* emsdp1.1_ram.specs - EM SDP 1.1, startup code in ICCM
memory and everything else in RAM
* emsdp1.2.specs - EM SDP 1.2, everything in ICCM/DCCM memory
* emsdp1.2_ram.specs - EM SDP 1.2, startup code in ICCM
memory and everything else in RAM
An example of building an application:
$ arc-elf32-gcc -mcpu=em -specs=emsdp1.1_ram.specs main.c -o main
Signed-off-by: Vladimir Isaev <vvisaev@gmail.com>
Signed-off-by: Yuriy Kolerov <kolerov93@gmail.com>
|
|
An example of building an application:
$ arc-elf32-gcc -mcpu=hs -specs=hsdk.specs main.c -o main
Signed-off-by: Vladimir Isaev <vvisaev@gmail.com>
Signed-off-by: Yuriy Kolerov <kolerov93@gmail.com>
|
|
An example of building an application:
$ arc-elf32-gcc -mcpu=em -specs=iotdk.specs main.c -o main
Signed-off-by: Vladimir Isaev <vvisaev@gmail.com>
Signed-off-by: Yuriy Kolerov <kolerov93@gmail.com>
|
|
Signed-off-by: Yuriy Kolerov <kolerov93@gmail.com>
|
|
This library implements libgloss input/output and setup
routines for UART 8250 devices of ARC development boards:
* EM Starter Kit
* HS Development Kit
* EM Software Development Platform
* IoT Development Kit
_uart_8250_setup function with proper parameteres must be called
to setup UART 8250 device for a particular board (refer to
a board's documentation).
Signed-off-by: Vladimir Isaev <vvisaev@gmail.com>
Signed-off-by: Yuriy Kolerov <kolerov93@gmail.com>
|
|
Signed-off-by: Yuriy Kolerov <kolerov93@gmail.com>
|
|
Use atexit funtion to setup fini routines to be called on exit
instead of filling in __atexit structures manually.
Signed-off-by: Claudiu Zissulescu <claziss@gmail.com>
|
|
There is a special interface built in ARC simulators (such as
nSIM) called MetaWare hostlink IO which can be used to implement
system calls. This commit adds support for this interface to the
ARC port of libgloss.
Here is an example of using this interface:
$ arc-elf32-gcc -mcpu=hs -specs=hl.specs main.c -o main
$ nsimdrv -tcf $NSIM_HOME/etc/tcf/templates/hs48_full.tcf main
Hello, World!
Signed-off-by: Vladimir Isaev <vvisaev@gmail.com>
|
|
This change is needed to meet semi-hosting requirements
for nSIM GNU I/O interface.
Signed-off-by: Luis Silva <luis.m.silva99@hotmail.com>
|
|
Assembler for ARCv2 always extends the name provided by
.file directive to an absolute form.
On ARCv3 targets .file directive forces assembler to put
a provided string to DW_AT_name field as is without
extending to an absolute path. Then GDB cannot find
source files because of it.
The best way to fix this issue is just delete lines
with .file directive in .S files and let the compiler
to decide what DW_AT_name must contain. Particularly,
the compiler fills this filed by an absolute path to
a .S file because only absolute paths are used in
toolchain's build process.
Signed-off-by: Yuriy Kolerov <kolerov93@gmail.com>
|
|
According to GCC documentation for ARC, a function marked with
the long_call attribute is always called using register-indirect
jump-and-link instructions, thereby enabling the called function
to be placed anywhere within the 32-bit address space.
exit_halt function is provided by crt0.S and it's used
in nsim-syscalls.c. Thus, we want to ensure that a linkage
issue will not arise.
Signed-off-by: Claudiu Zissulescu <claziss@gmail.com>
|
|
- The PRU newlib port is supposed to implement case #2 as described in
newlib/libc/include/reent.h . Thus drop the defining of
MISSING_SYSCALL_NAMES.
- libgloss/configure: Regenerate.
- libgloss/libnosys/acinclude.m4: Do not define
MISSING_SYSCALL_NAMES for pru.
Signed-off-by: Dimitar Dimitrov <dimitar@dinux.eu>
|
|
This patch resolves the following build error which occurs with gcc 14.1.0:
../../.././libgloss/microblaze/linux-outbyte.c: In function 'outbyte':
../../.././libgloss/microblaze/linux-outbyte.c:3:9: error: implicit declaration of function '_write' [-Wimplicit-function-declaration]
3 | _write(1, &c, 1);
Signed-off-by: Neal Frager <neal.frager@amd.com>
|
|
Use _READ_WRITE_RETURN_TYPE for read/write in libgloss/{read,write}.c to
avoid mismatching types.
Signed-off-by: Marc Poulhiès <dkm@kataplop.net>
|