Tup: create ld.lib.so libraries when in a Nix build

This commit is contained in:
Ehmry - 2020-01-29 21:35:18 +01:00
parent 71e1a286e5
commit fa5b9a9002
2 changed files with 12 additions and 2 deletions

View File

@ -25,6 +25,11 @@ BASE_LIBS += $(REP_DIR)/src/lib/base/base-linux.lib.a
PKG_LIBS = -L$(DEV_DIR)/lib `$(PKG_CONFIG) --libs alarm cxx ldso-startup timeout`
OUTPUT = ld-linux.lib.so
ifdef NIX_OUTPUTS_DEV
OUTPUT = ld.lib.so
endif
: $(BASE_LIBS) {obj} | \
symbol.map \
$(DEV_DIR)/<lib> \
@ -32,6 +37,6 @@ PKG_LIBS = -L$(DEV_DIR)/lib `$(PKG_CONFIG) --libs alarm cxx ldso-startup timeout
$(REP_DIR)/<base-common> \
$(REP_DIR)/<startup> \
$(REP_DIR)/<syscall> \
|> $(LD) -o %o $(LD_MARCH) $(LDFLAGS) --whole-archive --start-group %<base-common> %<startup> %<syscall> %f $(PKG_LIBS) --end-group --no-whole-archive $(LIBGCC); printf "\x02" | dd of=%o bs=1 seek=16 count=1 conv=notrunc; |> ld-linux.lib.so $(REP_DIR)/<ld> {bin}
|> $(LD) -o %o $(LD_MARCH) $(LDFLAGS) --whole-archive --start-group %<base-common> %<startup> %<syscall> %f $(PKG_LIBS) --end-group --no-whole-archive $(LIBGCC); printf "\x02" | dd of=%o bs=1 seek=16 count=1 conv=notrunc; |> $(OUTPUT) $(REP_DIR)/<ld> {bin}
: {bin} |> !collect_bin |>

View File

@ -28,6 +28,11 @@ LDFLAGS += -T$(BASE_DIR)/src/ld/genode_rel.ld
PKG_LIBS = -L$(DEV_DIR)/lib `$(PKG_CONFIG) --libs alarm cxx ldso-startup timeout`
OUTPUT = ld-nova.lib.so
ifdef NIX_OUTPUTS_DEV
OUTPUT = ld.lib.so
endif
: {obj} | \
$(DEV_DIR)/<lib> \
$(DEV_DIR)/<pkg-config> \
@ -36,6 +41,6 @@ PKG_LIBS = -L$(DEV_DIR)/lib `$(PKG_CONFIG) --libs alarm cxx ldso-startup timeout
$(REP_DIR)/<startup> \
symbol.map \
|> $(LD) -o %o $(LD_MARCH) $(LDFLAGS) --whole-archive --start-group $(PKG_LIBS) %<base-common> %<base-nova> %<startup> %f --end-group --no-whole-archive $(LIBGCC) \
|> ld-nova.lib.so $(REP_DIR)/<ld> {lib}
|> $(OUTPUT) $(REP_DIR)/<ld> {lib}
: foreach {lib} |> !collect_shared |>