aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicholas <nbnoll@eml.cc>2021-10-17 11:21:41 -0700
committerNicholas <nbnoll@eml.cc>2021-10-17 11:21:41 -0700
commit752cb994bdac9aa1cdab8781bab7f58db72b1809 (patch)
treed17158f3b1e44e5258a155a1fc30307905c2c10a
parent06cdf8398eec011b3e8978a0d039b921133243d6 (diff)
fix: added libgcc as explicit dependency for ARMphone
-rw-r--r--Makefile12
-rw-r--r--sys/cmd/rc/rules.mk2
-rw-r--r--sys/cmd/rules.mk24
-rw-r--r--sys/libmath/rules.mk4
-rw-r--r--sys/libn/flate.c2
-rw-r--r--sys/libn/gz.c2
-rw-r--r--sys/libn/rules.mk3
-rw-r--r--sys/libn/test.c5
-rw-r--r--sys/rules.mk14
-rwxr-xr-xvendor/sync5
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=$(<D)/parse.h --output=$(<D)/parse.c $(<)
# Local rules
-$(BINS_$(d)): $(OBJS_$(d)) $(OBJ_DIR)/sys/libn/libn.a $(d)/parse.h
+$(BINS_$(d)): $(OBJS_$(d)) $(OBJ_DIR)/sys/libn/libn.a $(LIB_DIR)/libc.a
$(COMPLINK)
include share/pop.mk
diff --git a/sys/cmd/rules.mk b/sys/cmd/rules.mk
index 2302c49..ce55e2c 100644
--- a/sys/cmd/rules.mk
+++ b/sys/cmd/rules.mk
@@ -5,11 +5,17 @@ include share/push.mk
DIR := $(d)/rc
include $(DIR)/rules.mk
+DIR := $(d)/walk
+include $(DIR)/rules.mk
+
+DIR := $(d)/filter
+include $(DIR)/rules.mk
+
# DIR := $(d)/cc
# include $(DIR)/rules.mk
-DIR := $(d)/dwm
-include $(DIR)/rules.mk
+# DIR := $(d)/dwm
+# include $(DIR)/rules.mk
# DIR := $(d)/tinywl
# include $(DIR)/rules.mk
@@ -20,19 +26,13 @@ include $(DIR)/rules.mk
# DIR := $(d)/test
# include $(DIR)/rules.mk
-DIR := $(d)/filter
-include $(DIR)/rules.mk
-
-DIR := $(d)/menu
-include $(DIR)/rules.mk
+# DIR := $(d)/menu
+# include $(DIR)/rules.mk
-DIR := $(d)/term
-include $(DIR)/rules.mk
+# DIR := $(d)/term
+# include $(DIR)/rules.mk
# DIR := $(d)/term2
# include $(DIR)/rules.mk
-DIR := $(d)/walk
-include $(DIR)/rules.mk
-
include share/pop.mk
diff --git a/sys/libmath/rules.mk b/sys/libmath/rules.mk
index 42af0da..c896918 100644
--- a/sys/libmath/rules.mk
+++ b/sys/libmath/rules.mk
@@ -18,8 +18,8 @@ include share/paths.mk
$(LIBS_$(d)): $(OBJS_$(d))
$(ARCHIVE)
-$(UNTS_$(d)): TCFLAGS := -D_GNU_SOURCE
-$(UNTS_$(d)): TCLIBS := -lpthread -lm $(LIB_DIR)/libblas.a $(OBJ_DIR)/sys/libn/libn.a $(LIBS_$(d))
+$(UNTS_$(d)): TCFLAGS =
+$(UNTS_$(d)): TCLIBS = -lpthread -lm $(LIB_DIR)/libblas.a $(OBJ_DIR)/sys/libn/libn.a $(LIBS_$(d))
$(UNTS_$(d)): $(TOBJS_$(d)) $(LIBS_$(d)) $(OBJ_DIR)/sys/libn/libn.a
$(LINK)
diff --git a/sys/libn/flate.c b/sys/libn/flate.c
index c886693..ff68d9c 100644
--- a/sys/libn/flate.c
+++ b/sys/libn/flate.c
@@ -1,7 +1,7 @@
#include <u.h>
#include <libn.h>
-#include <zlib.h>
+#include <vendor/zlib.h>
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 <u.h>
#include <libn.h>
-#include <zlib.h>
+#include <vendor/zlib.h>
// -----------------------------------------------------------------------
// 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 <time.h>
+#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