mirror of
https://git.proxmox.com/git/wasi-libc
synced 2025-08-15 02:13:06 +00:00
fix shared library build with llvm-19 (#526)
This commit is contained in:
parent
8279f9591a
commit
3f812abfb2
18
Makefile
18
Makefile
@ -617,9 +617,21 @@ PIC_OBJS = \
|
|||||||
# link that using `--whole-archive` rather than pass the object files directly
|
# link that using `--whole-archive` rather than pass the object files directly
|
||||||
# to CC. This is a workaround for a Windows command line size limitation. See
|
# to CC. This is a workaround for a Windows command line size limitation. See
|
||||||
# the `%.a` rule below for details.
|
# the `%.a` rule below for details.
|
||||||
$(SYSROOT_LIB)/%.so: $(OBJDIR)/%.so.a $(BUILTINS_LIB)
|
|
||||||
$(CC) --target=$(TARGET_TRIPLE) -nodefaultlibs -shared --sysroot=$(SYSROOT) \
|
# Note: libc.so is special because it shouldn't link to libc.so.
|
||||||
-o $@ -Wl,--whole-archive $< -Wl,--no-whole-archive $(BUILTINS_LIB)
|
# Note: --allow-undefined-file=linker-provided-symbols.txt is
|
||||||
|
# a workaround for https://github.com/llvm/llvm-project/issues/103592
|
||||||
|
$(SYSROOT_LIB)/libc.so: $(OBJDIR)/libc.so.a $(BUILTINS_LIB)
|
||||||
|
$(CC) $(EXTRA_CFLAGS) --target=${TARGET_TRIPLE} -nodefaultlibs \
|
||||||
|
-shared --sysroot=$(SYSROOT) \
|
||||||
|
-o $@ -Wl,--whole-archive $< -Wl,--no-whole-archive $(BUILTINS_LIB) \
|
||||||
|
-Wl,--allow-undefined-file=linker-provided-symbols.txt
|
||||||
|
|
||||||
|
$(SYSROOT_LIB)/%.so: $(OBJDIR)/%.so.a $(SYSROOT_LIB)/libc.so
|
||||||
|
$(CC) $(EXTRA_CFLAGS) --target=${TARGET_TRIPLE} \
|
||||||
|
-shared --sysroot=$(SYSROOT) \
|
||||||
|
-o $@ -Wl,--whole-archive $< -Wl,--no-whole-archive \
|
||||||
|
-Wl,--allow-undefined-file=linker-provided-symbols.txt
|
||||||
|
|
||||||
$(OBJDIR)/libc.so.a: $(LIBC_SO_OBJS) $(MUSL_PRINTSCAN_LONG_DOUBLE_SO_OBJS)
|
$(OBJDIR)/libc.so.a: $(LIBC_SO_OBJS) $(MUSL_PRINTSCAN_LONG_DOUBLE_SO_OBJS)
|
||||||
|
|
||||||
|
@ -3,6 +3,13 @@
|
|||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
|
||||||
|
#ifndef __wasilibc_unmodified_upstream
|
||||||
|
/* undef the macro to use the standard stderr instead of __stderr_FILE
|
||||||
|
* (the libc internal symbol) as this lives in a separate library,
|
||||||
|
* libwasi-emulated-signal.so. */
|
||||||
|
#undef stderr
|
||||||
|
#endif
|
||||||
|
|
||||||
void psignal(int sig, const char *msg)
|
void psignal(int sig, const char *msg)
|
||||||
{
|
{
|
||||||
FILE *f = stderr;
|
FILE *f = stderr;
|
||||||
|
3
linker-provided-symbols.txt
Normal file
3
linker-provided-symbols.txt
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
__heap_base
|
||||||
|
__heap_end
|
||||||
|
__c_longjmp
|
Loading…
Reference in New Issue
Block a user