Adjust Tupfiles

This commit is contained in:
Ehmry - 2019-09-18 00:59:50 +02:00
parent 5acd689675
commit f587fb66b2
3 changed files with 15 additions and 18 deletions

View File

@ -70,12 +70,10 @@ export LD
CC = $CC
CXX = $CXX
LD= $LD
AR = $(TOOL_CHAIN_PREFIX)ar
AS = $(TOOL_CHAIN_PREFIX)as
OBJCOPY = $(TOOL_CHAIN_PREFIX)objcopy
AS_OPT += $(AS_MARCH)
OBJCOPY = $OBJCOPY
CXXFLAGS += -Wno-undefined-bool-conversion -Wno-unknown-attributes -Wno-unused-command-line-argument
CXXFLAGS += -Wno-undefined-bool-conversion -Wno-unknown-attributes -Wsystem-headers -Werror
#CXXFLAGS += -Wno-unused-command-line-argument
export NIX_PATH
NIX_BUILD = nix-build --option substitute no
@ -86,15 +84,16 @@ LIB_DIR = $(OUTPUTS_DEV)/lib
PKG_CONFIG_DIR = $(OUTPUTS_DEV)/lib/pkgconfig
PKG_CONFIG = PKG_CONFIG_PATH=$(PKG_CONFIG_DIR) pkg-config
!asm = |> ^ CC %b^ @(CC_WRAPPER) $(CC) $(DEFINES) $(CFLAGS) $(CFLAGS_%e) $(CFLAGS_%f) -D__ASSEMBLY__ $(INCLUDES) -c %f -o %o |> %B.o
DEFINES += -g
OLEVEL = -O0
!cc = | $(GENODE_DIR)/<pkg-config> |> ^o CC %f^ @(CC_WRAPPER) $(CC) $(DEFINES) $(CFLAGS) $(CFLAGS_%e) $(CFLAGS_%f) `$(PKG_CONFIG) --cflags $(LIBS) $(LIBS_CFLAGS)` $(INCLUDES) -c -fPIC -g %f -o %o |> %B.o
!ir = | $(GENODE_DIR)/<pkg-config> |> clang $(OLEVEL) $(DEFINES) $(CXXFLAGS) $(CXXFLAGS_%e) $(CXXFLAGS_%f) `$(PKG_CONFIG) --cflags $(LIBS)` $(INCLUDES) -S -emit-llvm %f |> %B.ll
!cc_port = | $(GENODE_DIR)/<pkg-config> |> ^o CC %o^ @(CC_WRAPPER) $(CC) $(DEFINES) $(CFLAGS) $(CFLAGS_%o) $(INCLUDES) `$(PKG_CONFIG) --cflags $(LIBS) $(LIBS_CFLAGS)` -c -fPIC -g -o %o |> %B.o
!asm = |> ^ CC %b^ @(CC_WRAPPER) $(CC) $(OLEVEL) $(DEFINES) $(CFLAGS) $(CFLAGS_%e) $(CFLAGS_%f) -D__ASSEMBLY__ $(INCLUDES) -c %f -o %o |> %B.o
!cxx = | $(GENODE_DIR)/<pkg-config> |> ^o CXX %b^ @(CC_WRAPPER) $(CXX) $(DEFINES) $(CXXFLAGS) $(CXXFLAGS_%e) $(CXXFLAGS_%f) `$(PKG_CONFIG) --cflags $(LIBS)` $(INCLUDES) -c -fPIC -g %f -o %o |> %B.o
!cc = | $(GENODE_DIR)/<pkg-config> |> ^o CC %f^ @(CC_WRAPPER) $(CC) $(OLEVEL) $(DEFINES) $(CFLAGS) $(CFLAGS_%e) $(CFLAGS_%f) `$(PKG_CONFIG) --cflags $(LIBS) $(LIBS_CFLAGS)` $(INCLUDES) -c -fPIC %f -o %o |> %B.o
!cxx_port = | $(GENODE_DIR)/<pkg-config> |> ^o CXX %o^ @(CC_WRAPPER) $(CXX) $(DEFINES) $(CXXFLAGS) $(CXXFLAGS_%f) `$(PKG_CONFIG) --cflags $(LIBS)` $(INCLUDES) -c -fPIC -g -o %o |> %B.o
!cxx = | $(GENODE_DIR)/<pkg-config> |> ^o CXX %b^ @(CC_WRAPPER) $(CXX) $(OLEVEL) $(DEFINES) $(CXXFLAGS) $(CXXFLAGS_%e) $(CXXFLAGS_%f) `$(PKG_CONFIG) --cflags $(LIBS)` $(INCLUDES) -c -fPIC %f -o %o |> %B.o
!ld = | $(GENODE_DIR)/<lib> $(GENODE_DIR)/<pkg-config> |> ^o LD %o^ $(LD) $(LDFLAGS) `$(PKG_CONFIG) --libs $(LIBS)` --whole-archive --start-group %f --no-whole-archive --end-group -o %o |>
@ -138,11 +137,11 @@ endif
BASE_DIR = $(GENODE_DIR)/repos/base
&BASE_DIR = repos/base
export AS
!incbin = |> ^ incbin %f^ \
export SYM=_binary_`echo %f | sed 's/\./_/g'`; \
echo ".global ${SYM}_start, ${SYM}_end; .data; .align 4; ${SYM}_start:; .incbin \"%f\"; ${SYM}_end:" |\
$AS $(AS_MARCH) -f -o %o - |> binary_%b.o
echo ".global ${SYM}_start, ${SYM}_end; .data; .align 4; ${SYM}_start:; .incbin \"%f\"; ${SYM}_end:" \
| llvm-mc -filetype=obj - > %o \
|> binary_%b.o
export AR
!ar = |> ^ MERGE %o^ $AR -rcs %o %f |>

View File

@ -18,5 +18,5 @@ ifeq ($(SPEC_DIR),)
error syscall library is missing rules for @(TUP_ARCH)
endif
: foreach $(SPEC_DIR)/*.S |> !cc |> {obj}
: foreach $(SPEC_DIR)/*.S |> !asm |> {obj}
: {obj} |> !ar |> syscall-linux.lib.a

View File

@ -21,8 +21,6 @@ INCLUDES += -I$(BASE_DIR)/include
# Override base macros to bypass pkg-config
CC_OLEVEL = -O2
DEFINES += \
-ffunction-sections \
-fno-strict-aliasing \
@ -37,14 +35,14 @@ CXXFLAGS += \
GCC_INCLUDE = -I`$(CC) -print-file-name=include`
!cc = |> ^ COMPILE %b^ \
@(CC_WRAPPER) $(CC) $(DEFINES) $(CC_OLEVEL) \
@(CC_WRAPPER) $(CC) $(DEFINES) $(OLEVEL) \
$(CFLAGS) $(CFLAGS_%e) $(CFLAGS_%f) \
$(INCLUDES) $(GCC_INCLUDE) $(CC_MARCH) \
-c %f -o %o \
|> %B.o
!cxx = |> ^ COMPILE %b^ \
@(CC_WRAPPER) $(CXX) $(DEFINES) $(CC_OLEVEL) \
@(CC_WRAPPER) $(CXX) $(DEFINES) $(OLEVEL) \
$(CXXFLAGS) $(CXXFLAGS_%e) $(CXXFLAGS_%f) \
$(INCLUDES) $(GCC_INCLUDE) $(CC_MARCH) \
-c %f -o %o \