From 752cb994bdac9aa1cdab8781bab7f58db72b1809 Mon Sep 17 00:00:00 2001 From: Nicholas Date: Sun, 17 Oct 2021 11:21:41 -0700 Subject: fix: added libgcc as explicit dependency for ARM --- Makefile | 12 +++++------- sys/cmd/rc/rules.mk | 2 +- sys/cmd/rules.mk | 24 ++++++++++++------------ sys/libmath/rules.mk | 4 ++-- sys/libn/flate.c | 2 +- sys/libn/gz.c | 2 +- sys/libn/rules.mk | 3 +-- sys/libn/test.c | 5 ++++- sys/rules.mk | 14 +++++++------- vendor/sync | 5 ++++- 10 files changed, 38 insertions(+), 35 deletions(-) diff --git a/Makefile b/Makefile index 668ccda..276b5d3 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,6 @@ # Compiler, Linker, and Assembler CC := gcc AR := ar -AS := nasm PKG := PKG_CONFIG_PATH=lib/pkgconfig pkg-config WL_PROTO:=$(shell $(PKG) --variable=pkgdatadir wayland-protocols) @@ -17,15 +16,14 @@ OBJ_DIR := .build TST_DIR := .test # C runtime library -CINIT := $(LIB_DIR)/crt/crt1.o $(LIB_DIR)/crt/x86_64/crti.o `gcc --print-file-name=crtbeginS.o` -CFINI := `gcc --print-file-name=crtendS.o` $(LIB_DIR)/crt/x86_64/crtn.o +CINIT := $(LIB_DIR)/crt/crt1.o $(LIB_DIR)/crt/crti.o `gcc --print-file-name=crtbeginS.o` +CFINI := `gcc --print-file-name=crtendS.o` $(LIB_DIR)/crt/crtn.o # Flags, Libraries and Includes -CFLAGS := -g -march=native -fno-strict-aliasing -fwrapv -fms-extensions -Wno-microsoft-anon-tag -STATIC := -nodefaultlibs -nostartfiles -nostdinc -static -AFLAGS := -f elf64 +CFLAGS := -g -fno-strict-aliasing -fwrapv -fms-extensions -Wno-microsoft-anon-tag +STATIC := -nodefaultlibs -nostartfiles -nostdinc -nostdlib -static INCS := -I $(INC_DIR) -isystem $(INC_DIR)/vendor/libc -ELIBS := -L$(LIB_DIR) -lc +ELIBS := -L$(LIB_DIR) -lc -lgcc # Named generic rules (must be evaluated lazily) COMPILE = @echo "CC "$(@:$(OBJ_DIR)/%=%);\ diff --git a/sys/cmd/rc/rules.mk b/sys/cmd/rc/rules.mk index 44c9b7a..d0139b4 100644 --- a/sys/cmd/rc/rules.mk +++ b/sys/cmd/rc/rules.mk @@ -23,7 +23,7 @@ $(d)/parse.h $(d)/parse.c: $(d)/syntax.y yacc --header=$( #include -#include +#include typedef struct buffer { diff --git a/sys/libn/gz.c b/sys/libn/gz.c index 040d25a..6bed76e 100644 --- a/sys/libn/gz.c +++ b/sys/libn/gz.c @@ -1,7 +1,7 @@ #include #include -#include +#include // ----------------------------------------------------------------------- // interface implementations diff --git a/sys/libn/rules.mk b/sys/libn/rules.mk index 452587e..15c9ea2 100644 --- a/sys/libn/rules.mk +++ b/sys/libn/rules.mk @@ -6,8 +6,6 @@ include share/push.mk SRCS_$(d) := \ $(d)/arg.c \ $(d)/bufio.c \ - $(d)/coro_unix_x64.s \ - $(d)/coro.c \ $(d)/error.c \ $(d)/flate.c \ $(d)/fs.c \ @@ -19,6 +17,7 @@ SRCS_$(d) := \ $(d)/random.c \ $(d)/sort.c \ $(d)/string.c + # $(d)/coro.c \ TSTS_$(d) := \ $(d)/test.c diff --git a/sys/libn/test.c b/sys/libn/test.c index 66c3c7f..797bcf8 100644 --- a/sys/libn/test.c +++ b/sys/libn/test.c @@ -4,6 +4,7 @@ #include +#if 0 uintptr printtest(Coro *c, uintptr d) { @@ -154,6 +155,7 @@ test·sort() return 0; } +#endif error main() @@ -163,8 +165,9 @@ main() if (err = test·coro(), err) { errorf("test fail: coroutine"); } -#endif if (err = test·sort(), err) { errorf("test fail: coroutine"); } +#endif + return 0; } diff --git a/sys/rules.mk b/sys/rules.mk index 5d31ec8..c7c1779 100644 --- a/sys/rules.mk +++ b/sys/rules.mk @@ -5,17 +5,17 @@ include share/push.mk DIR := $(d)/cmd include $(DIR)/rules.mk -# DIR := $(d)/libc -# include $(DIR)/rules.mk - DIR := $(d)/libn include $(DIR)/rules.mk -DIR := $(d)/libmath -include $(DIR)/rules.mk +# DIR := $(d)/libc +# include $(DIR)/rules.mk -DIR := $(d)/libbio -include $(DIR)/rules.mk +# DIR := $(d)/libmath +# include $(DIR)/rules.mk + +# DIR := $(d)/libbio +# include $(DIR)/rules.mk # DIR := $(d)/libdraw # include $(DIR)/rules.mk diff --git a/vendor/sync b/vendor/sync index 3a600e4..0b6af95 100755 --- a/vendor/sync +++ b/vendor/sync @@ -92,12 +92,15 @@ build_musl() make -j2 make install + + mkdir - p $ROOT/lib/crt + mv $ROOT/lib/rcrt1.o \ $ROOT/lib/crt1.o \ $ROOT/lib/Scrt1.o \ $ROOT/lib/musl-gcc.specs \ $ROOT/lib/crt - mv $ROOT/lib/crti.o $ROOT/lib/crtn.o $ROOT/lib/crt/x86_64 + mv $ROOT/lib/crti.o $ROOT/lib/crtn.o $ROOT/lib/crt rm $ROOT/bin/musl-gcc -- cgit v1.2.1