-
-
Notifications
You must be signed in to change notification settings - Fork 654
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Strongly link glob() into system() and popen()
- Loading branch information
Showing
24 changed files
with
216 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
#-*-mode:makefile-gmake;indent-tabs-mode:t;tab-width:8;coding:utf-8-*-┐ | ||
#── vi: set noet ft=make ts=8 sw=8 fenc=utf-8 :vi ────────────────────┘ | ||
|
||
PKGS += LIBC_SYSTEM | ||
|
||
LIBC_SYSTEM_ARTIFACTS += LIBC_SYSTEM_A | ||
LIBC_SYSTEM = $(LIBC_SYSTEM_A_DEPS) $(LIBC_SYSTEM_A) | ||
LIBC_SYSTEM_A = o/$(MODE)/libc/system/system.a | ||
LIBC_SYSTEM_A_FILES := $(wildcard libc/system/*) | ||
LIBC_SYSTEM_A_HDRS = $(filter %.h,$(LIBC_SYSTEM_A_FILES)) | ||
LIBC_SYSTEM_A_INCS = $(filter %.inc,$(LIBC_SYSTEM_A_FILES)) | ||
LIBC_SYSTEM_A_SRCS_S = $(filter %.S,$(LIBC_SYSTEM_A_FILES)) | ||
LIBC_SYSTEM_A_SRCS_C = $(filter %.c,$(LIBC_SYSTEM_A_FILES)) | ||
|
||
LIBC_SYSTEM_A_SRCS = \ | ||
$(LIBC_SYSTEM_A_SRCS_S) \ | ||
$(LIBC_SYSTEM_A_SRCS_C) | ||
|
||
LIBC_SYSTEM_A_OBJS = \ | ||
$(LIBC_SYSTEM_A_SRCS_S:%.S=o/$(MODE)/%.o) \ | ||
$(LIBC_SYSTEM_A_SRCS_C:%.c=o/$(MODE)/%.o) | ||
|
||
LIBC_SYSTEM_A_CHECKS = \ | ||
$(LIBC_SYSTEM_A).pkg \ | ||
$(LIBC_SYSTEM_A_HDRS:%=o/$(MODE)/%.ok) | ||
|
||
LIBC_SYSTEM_A_DIRECTDEPS = \ | ||
LIBC_CALLS \ | ||
LIBC_FMT \ | ||
LIBC_INTRIN \ | ||
LIBC_NEXGEN32E \ | ||
LIBC_PROC \ | ||
LIBC_RUNTIME \ | ||
LIBC_STDIO \ | ||
LIBC_STR \ | ||
LIBC_SYSV \ | ||
THIRD_PARTY_MUSL \ | ||
|
||
LIBC_SYSTEM_A_DEPS := \ | ||
$(call uniq,$(foreach x,$(LIBC_SYSTEM_A_DIRECTDEPS),$($(x)))) | ||
|
||
$(LIBC_SYSTEM_A):libc/system/ \ | ||
$(LIBC_SYSTEM_A).pkg \ | ||
$(LIBC_SYSTEM_A_OBJS) | ||
|
||
$(LIBC_SYSTEM_A).pkg: \ | ||
$(LIBC_SYSTEM_A_OBJS) \ | ||
$(foreach x,$(LIBC_SYSTEM_A_DIRECTDEPS),$($(x)_A).pkg) | ||
|
||
# offer assurances about the stack safety of cosmo libc | ||
$(LIBC_SYSTEM_A_OBJS): private COPTS += -Wframe-larger-than=4096 -Walloca-larger-than=4096 | ||
|
||
$(LIBC_SYSTEM_A_OBJS): private \ | ||
CFLAGS += \ | ||
-fno-sanitize=all \ | ||
-Wframe-larger-than=4096 \ | ||
-Walloca-larger-than=4096 | ||
|
||
o/$(MODE)/libc/system/fputc.o: private \ | ||
CFLAGS += \ | ||
-O3 | ||
|
||
o//libc/system/appendw.o: private \ | ||
CFLAGS += \ | ||
-Os | ||
|
||
o/$(MODE)/libc/system/dirstream.o \ | ||
o/$(MODE)/libc/system/mt19937.o: private \ | ||
CFLAGS += \ | ||
-ffunction-sections | ||
|
||
LIBC_SYSTEM_LIBS = $(foreach x,$(LIBC_SYSTEM_ARTIFACTS),$($(x))) | ||
LIBC_SYSTEM_SRCS = $(foreach x,$(LIBC_SYSTEM_ARTIFACTS),$($(x)_SRCS)) | ||
LIBC_SYSTEM_HDRS = $(foreach x,$(LIBC_SYSTEM_ARTIFACTS),$($(x)_HDRS)) | ||
LIBC_SYSTEM_INCS = $(foreach x,$(LIBC_SYSTEM_ARTIFACTS),$($(x)_INCS)) | ||
LIBC_SYSTEM_CHECKS = $(foreach x,$(LIBC_SYSTEM_ARTIFACTS),$($(x)_CHECKS)) | ||
LIBC_SYSTEM_OBJS = $(foreach x,$(LIBC_SYSTEM_ARTIFACTS),$($(x)_OBJS)) | ||
$(LIBC_SYSTEM_OBJS): $(BUILD_FILES) libc/system/BUILD.mk | ||
|
||
.PHONY: o/$(MODE)/libc/system | ||
o/$(MODE)/libc/system: $(LIBC_SYSTEM_CHECKS) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
#-*-mode:makefile-gmake;indent-tabs-mode:t;tab-width:8;coding:utf-8-*-┐ | ||
#── vi: set noet ft=make ts=8 sw=8 fenc=utf-8 :vi ────────────────────┘ | ||
|
||
PKGS += TEST_LIBC_SYSTEM | ||
|
||
TEST_LIBC_SYSTEM_FILES := $(wildcard test/libc/system/*) | ||
TEST_LIBC_SYSTEM_SRCS = $(filter %.c,$(TEST_LIBC_SYSTEM_FILES)) | ||
TEST_LIBC_SYSTEM_INCS = $(filter %.inc,$(TEST_LIBC_SYSTEM_FILES)) | ||
TEST_LIBC_SYSTEM_SRCS_TEST = $(filter %_test.c,$(TEST_LIBC_SYSTEM_SRCS)) | ||
|
||
TEST_LIBC_SYSTEM_OBJS = \ | ||
$(TEST_LIBC_SYSTEM_SRCS:%.c=o/$(MODE)/%.o) | ||
|
||
TEST_LIBC_SYSTEM_COMS = \ | ||
$(TEST_LIBC_SYSTEM_SRCS:%.c=o/$(MODE)/%) | ||
|
||
TEST_LIBC_SYSTEM_BINS = \ | ||
$(TEST_LIBC_SYSTEM_COMS) \ | ||
$(TEST_LIBC_SYSTEM_COMS:%=%.dbg) | ||
|
||
TEST_LIBC_SYSTEM_TESTS = \ | ||
$(TEST_LIBC_SYSTEM_SRCS_TEST:%.c=o/$(MODE)/%.ok) | ||
|
||
TEST_LIBC_SYSTEM_CHECKS = \ | ||
$(TEST_LIBC_SYSTEM_SRCS_TEST:%.c=o/$(MODE)/%.runs) | ||
|
||
TEST_LIBC_SYSTEM_DIRECTDEPS = \ | ||
LIBC_CALLS \ | ||
LIBC_INTRIN \ | ||
LIBC_LOG \ | ||
LIBC_MEM \ | ||
LIBC_NEXGEN32E \ | ||
LIBC_RUNTIME \ | ||
LIBC_STDIO \ | ||
LIBC_STDIO \ | ||
LIBC_SYSTEM \ | ||
LIBC_SYSV \ | ||
LIBC_TESTLIB \ | ||
LIBC_THREAD \ | ||
LIBC_X \ | ||
THIRD_PARTY_MUSL \ | ||
THIRD_PARTY_TR \ | ||
|
||
TEST_LIBC_SYSTEM_DEPS := \ | ||
$(call uniq,$(foreach x,$(TEST_LIBC_SYSTEM_DIRECTDEPS),$($(x)))) | ||
|
||
o/$(MODE)/test/libc/system/system.pkg: \ | ||
$(TEST_LIBC_SYSTEM_OBJS) \ | ||
$(foreach x,$(TEST_LIBC_SYSTEM_DIRECTDEPS),$($(x)_A).pkg) | ||
|
||
o/$(MODE)/test/libc/system/%.dbg: \ | ||
$(TEST_LIBC_SYSTEM_DEPS) \ | ||
o/$(MODE)/test/libc/system/%.o \ | ||
o/$(MODE)/test/libc/system/system.pkg \ | ||
o/$(MODE)/tool/build/echo.zip.o \ | ||
$(LIBC_TESTMAIN) \ | ||
$(CRT) \ | ||
$(APE_NO_MODIFY_SELF) | ||
@$(APELINK) | ||
|
||
o/$(MODE)/test/libc/system/popen_test.dbg: \ | ||
$(TEST_LIBC_SYSTEM_DEPS) \ | ||
o/$(MODE)/test/libc/system/popen_test.o \ | ||
o/$(MODE)/test/libc/system/system.pkg \ | ||
o/$(MODE)/tool/build/echo.zip.o \ | ||
$(LIBC_TESTMAIN) \ | ||
$(CRT) \ | ||
$(APE_NO_MODIFY_SELF) | ||
@$(APELINK) | ||
|
||
o/$(MODE)/test/libc/system/system_test.dbg: \ | ||
$(TEST_LIBC_SYSTEM_DEPS) \ | ||
o/$(MODE)/test/libc/system/system_test.o \ | ||
o/$(MODE)/test/libc/system/system.pkg \ | ||
o/$(MODE)/tool/build/echo.zip.o \ | ||
o/$(MODE)/tool/build/cocmd.zip.o \ | ||
o/$(MODE)/tool/build/false.zip.o \ | ||
$(LIBC_TESTMAIN) \ | ||
$(CRT) \ | ||
$(APE_NO_MODIFY_SELF) | ||
@$(APELINK) | ||
|
||
$(TEST_LIBC_SYSTEM_OBJS): test/libc/system/BUILD.mk | ||
|
||
.PHONY: o/$(MODE)/test/libc/system | ||
o/$(MODE)/test/libc/system: \ | ||
$(TEST_LIBC_SYSTEM_BINS) \ | ||
$(TEST_LIBC_SYSTEM_CHECKS) |
File renamed without changes.
File renamed without changes.
Oops, something went wrong.