Emery Hemingway
969180525f
- Fetch and patch GCC distribution - Pass Tup config as a file - Fold out and dev outputs - Remove shellHook code for compatibility with dev-shell - Tweak Tup Nix conditionals - Add Tupfile.ini - Remove custom setup-hook
46 lines
1.5 KiB
Plaintext
46 lines
1.5 KiB
Plaintext
# Tup rules that are local to this Git repo and
|
|
# should not be shared with other projects.
|
|
|
|
&LD_SCRIPT_SO = base/src/ld/genode_rel.ld
|
|
|
|
ifeq (@(TUP_ARCH),x86_64)
|
|
ASM_SYM_DEPENDENCY = movq \1@GOTPCREL(%rip), %rax
|
|
else
|
|
ASM_SYM_DEPENDENCY = .long \1
|
|
endif
|
|
|
|
!abi_stub = |> ^ STUB %o^\
|
|
sed \
|
|
-e "s/^\(\w\+\) D \(\w\+\)\$/.data; .global \1; .type \1,%%object; .size \1,\2; \1:/" \
|
|
-e "s/^\(\w\+\) V/.data; .weak \1; .type \1,%%object; \1:/" \
|
|
-e "s/^\(\w\+\) T/.text; .global \1; .type \1,%%function; \1:/" \
|
|
-e "s/^\(\w\+\) R \(\w\+\)\$/.section .rodata; .global \1; .type \1,%%object; .size \1,\2; \1:/" \
|
|
-e "s/^\(\w\+\) W/.text; .weak \1; .type \1,%%function; \1:/" \
|
|
-e "s/^\(\w\+\) B \(\w\+\)\$/.bss; .global \1; .type \1,%%object; .size \1,\2; \1:/" \
|
|
-e "s/^\(\w\+\) U/.text; .global \1; $(ASM_SYM_DEPENDENCY)/" \
|
|
%f \
|
|
| $(CC) $(CC_MARCH) -x assembler -c - -Wl,-shared -Wl,-T&(LD_SCRIPT_SO) -o %o \
|
|
|> $(DEV_LIB_DIR)/%B.lib.so $(DEV_DIR)/<lib>
|
|
|
|
BASE_DIR = $(GENODE_DIR)/repos/base
|
|
&BASE_DIR = base
|
|
|
|
ifeq (@(TUP_ARCH),i386)
|
|
CPPFLAGS += -I$(BASE_DIR)/include/spec/x86_32
|
|
CPPFLAGS += -I$(BASE_DIR)/include/spec/x86
|
|
CPPFLAGS += -I$(BASE_DIR)/include/spec/32bit
|
|
endif
|
|
|
|
ifeq (@(TUP_ARCH),x86_64)
|
|
CPPFLAGS += -I$(BASE_DIR)/include/spec/x86_64
|
|
CPPFLAGS += -I$(BASE_DIR)/include/spec/x86
|
|
CPPFLAGS += -I$(BASE_DIR)/include/spec/64bit
|
|
endif
|
|
|
|
ifeq (@(TUP_ARCH),arm64)
|
|
CPPFLAGS += -I$(BASE_DIR)/include/spec/arm_64
|
|
CPPFLAGS += -I$(BASE_DIR)/include/spec/64bit
|
|
endif
|
|
|
|
CPPFLAGS += -I$(BASE_DIR)/include
|