Skip to content

Commit

Permalink
glibc: add changes to make riscv64-linux-gnu works
Browse files Browse the repository at this point in the history
  • Loading branch information
RossComputerGuy committed Feb 8, 2024
1 parent 919a3ba commit 1768948
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 2 deletions.
1 change: 1 addition & 0 deletions lib/libc/glibc/csu/elf-init-2.33.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
<https://www.gnu.org/licenses/>. */

#include <stddef.h>
#include <elf-initfini.h>


/* These magic symbols are provided by the linker. */
Expand Down
1 change: 1 addition & 0 deletions lib/libc/glibc/sysdeps/generic/elf-initfini.h
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#define NO_INITFINI 1
6 changes: 6 additions & 0 deletions lib/libc/glibc/sysdeps/generic/sysdep.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,12 @@
# define cfi_personality(enc, exp) .cfi_personality enc, exp
# define cfi_lsda(enc, exp) .cfi_lsda enc, exp

# ifndef __clang__
# define cfi_label(label) .cfi_label label
# else
# define cfi_label(label)
# endif

#else /* ! ASSEMBLER */

# define CFI_STRINGIFY(Name) CFI_STRINGIFY2 (Name)
Expand Down
2 changes: 1 addition & 1 deletion lib/libc/glibc/sysdeps/riscv/start-2.33.S
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
ENTRY (ENTRY_POINT)
/* Terminate call stack by noting ra is undefined. Use a dummy
.cfi_label to force starting the FDE. */
.cfi_label .Ldummy
cfi_label (.Ldummy)
cfi_undefined (ra)
call load_gp
mv a5, a0 /* rtld_fini. */
Expand Down
2 changes: 1 addition & 1 deletion lib/libc/glibc/sysdeps/riscv/start.S
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
ENTRY (ENTRY_POINT)
/* Terminate call stack by noting ra is undefined. Use a dummy
.cfi_label to force starting the FDE. */
.cfi_label .Ldummy
cfi_label (.Ldummy)
cfi_undefined (ra)
call load_gp
mv a5, a0 /* rtld_fini. */
Expand Down
24 changes: 24 additions & 0 deletions lib/libc/include/riscv64-linux-gnu/gnu/stubs-lp64d.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/* This file is automatically generated.
It defines a symbol `__stub_FUNCTION' for each function
in the C library which is a stub, meaning it will fail
every time called, usually setting errno to ENOSYS. */

#ifdef _LIBC
# error Applications may not define the macro _LIBC
#endif

#define __stub___compat_bdflush
#define __stub___compat_create_module
#define __stub___compat_get_kernel_syms
#define __stub___compat_query_module
#define __stub___compat_uselib
#define __stub_chflags
#define __stub_fchflags
#define __stub_fedisableexcept
#define __stub_feenableexcept
#define __stub_fegetexcept
#define __stub_gtty
#define __stub_revoke
#define __stub_setlogin
#define __stub_sigreturn
#define __stub_stty

0 comments on commit 1768948

Please sign in to comment.