Browse Source

Tup: LLVM adjustments

master
Emery Hemingway 2 years ago
parent
commit
e0b84beafa
  1. 2
      Tuprules.llvm
  2. 9
      repos/Tuprules.tup
  3. 4
      repos/base-linux/src/core/Tupfile
  4. 4
      repos/base/src/lib/cxx/Tupfile
  5. 5
      repos/gems/src/server/terminal/Tupfile

2
Tuprules.llvm

@ -34,7 +34,7 @@ LIBGCC = `$(CC) $(CC_MARCH) -print-libgcc-file-name`
!ld = | $(DEV_DIR)/<lib> $(DEV_DIR)/<pkg-config> |> ^o LD %o^ $(LD) $(LDFLAGS) `$(PKG_CONFIG) --libs $(LIBS)` --whole-archive --start-group %f --no-whole-archive --end-group -o %o |>
!incbin = |> ^ incbin %f^ \
export SYM=_binary_`echo %f | sed 's/\./_/g'`; \
export SYM=_binary_`echo %b | sed 's/\./_/g'`; \
echo ".global ${SYM}_start, ${SYM}_end; .data; .align 4; ${SYM}_start:; .incbin \"%f\"; ${SYM}_end:" \
| llvm-mc -filetype=obj - > %o \
|> binary_%b.o

9
repos/Tuprules.tup

@ -18,8 +18,13 @@ endif
-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 \
%f > stub.s; \
$(CC) $(CC_MARCH) -x assembler -c stub.s; \
$(LD) -o %o \
-shared \
-T &(LD_SCRIPT_SO) \
stub.o; \
rm -v stub.o stub.s; \
|> $(DEV_LIB_DIR)/%B.lib.so $(DEV_DIR)/<lib>
BASE_DIR = $(GENODE_DIR)/repos/base

4
repos/base-linux/src/core/Tupfile

@ -41,7 +41,11 @@ LDFLAGS += -Ttext=0x01000000
LDFLAGS += -T$(BASE_DIR)/src/ld/genode.ld
LDFLAGS += -T$(REP_DIR)/src/ld/stack_area.ld
ifdef IS_LLVM
PKG_LIBS = -L$(DEV_DIR)/lib `$(PKG_CONFIG) --libs cxx-baremetal`
else
PKG_LIBS = -L$(DEV_DIR)/lib `$(PKG_CONFIG) --libs cxx`
endif
: {obj} | \
$(DEV_DIR)/<lib> \

4
repos/base/src/lib/cxx/Tupfile

@ -104,8 +104,8 @@ ifdef IS_LLVM
: supc++.tmp |> @(OBJCOPY) $(LOCAL_SYMBOLS) $(REDEF_SYMBOLS) %f %o |> supc++.o
: supc++-baremetal.tmp |> @(OBJCOPY) $(LOCAL_SYMBOLS) $(REDEF_SYMBOLS) %f %o |> supc++-baremetal.o
: supc++.o |> !ar |> cxx.a {bin}
: supc++-baremetal.o |> !ar |> cxx-baremetal.a {bin}
: supc++.o unwind.o |> !ar |> cxx.a {bin}
: supc++-baremetal.o unwind.o |> !ar |> cxx-baremetal.a {bin}
: foreach {bin} |> !collect_static |>
: |> !emit_lib_pkg_config |>

5
repos/gems/src/server/terminal/Tupfile

@ -1,5 +0,0 @@
include_rules
LIBS += vfs
: foreach *.cc |> !cxx |> {obj}
: {obj} |> !prg |> {bin}
: {bin} |> !collect_bin |>
Loading…
Cancel
Save