Startup library header path must be overriden
The startup library might fail at runtime if local headers are included rather than headers from somewhere else.
This commit is contained in:
parent
3bf1cc09eb
commit
1dc25293b8
|
@ -47,7 +47,7 @@ LDFLAGS += -L$(LIB_DIR) `$(PKG_CONFIG) --libs cxx-baremetal`
|
|||
: {obj} | \
|
||||
$(DEV_DIR)/<lib> \
|
||||
$(GENODE_DIR)/<pkg-config> \
|
||||
$(BASE_DIR)/<startup> \
|
||||
$(REP_DIR)/<startup> \
|
||||
$(REP_DIR)/<base-common> \
|
||||
$(REP_DIR)/<syscall> \
|
||||
|> !ld %<base-common> %<startup> %<syscall> \
|
||||
|
|
|
@ -0,0 +1,2 @@
|
|||
include_rules
|
||||
include &(BASE_DIR)/src/lib/startup/Tupfile.inc
|
|
@ -51,9 +51,9 @@ LDFLAGS += -L$(LIB_DIR) `$(PKG_CONFIG) --libs cxx-baremetal`
|
|||
$(DEV_DIR)/<lib> \
|
||||
$(GENODE_DIR)/<pkg-config> \
|
||||
$(BASE_DIR)/<base-libs> \
|
||||
$(BASE_DIR)/<startup> \
|
||||
$(REP_DIR)/<startup> \
|
||||
$(REP_DIR)/<base-common> \
|
||||
|> $(LD) $(LDFLAGS) -u _start -r \
|
||||
%<base-libs> %<base-common> %<startup> %f -o %o \
|
||||
|> core.o $(REP_DIR)/<core> {core}
|
||||
: {core} |> cp %f %o |> $(DEV_DIR)/lib/core-nova.o
|
||||
: {core} |> cp %f %o |> $(OUT_DIR)/lib/core-nova.o
|
||||
|
|
|
@ -39,7 +39,7 @@ BASE_PKGS += alarm cxx-baremetal ldso-startup timeout
|
|||
|
||||
LDFLAGS += `$(PKG_CONFIG) --static --libs $(BASE_PKGS)` -L $(LIB_DIR)
|
||||
|
||||
: $(BASE_LIBS) {obj} | symbol.map $(BASE_DIR)/<startup> $(REP_DIR)/<base-common> $(GENODE_DIR)/<pkg-config> $(DEV_DIR)/<lib> \
|
||||
: $(BASE_LIBS) {obj} | symbol.map $(REP_DIR)/<startup> $(REP_DIR)/<base-common> $(GENODE_DIR)/<pkg-config> $(DEV_DIR)/<lib> \
|
||||
|> \
|
||||
$(LD) -o %o \
|
||||
$(LD_MARCH) $(LDFLAGS) \
|
||||
|
|
|
@ -0,0 +1,2 @@
|
|||
include_rules
|
||||
include &(BASE_DIR)/src/lib/startup/Tupfile.inc
|
|
@ -1,13 +0,0 @@
|
|||
include_rules
|
||||
|
||||
: foreach *.cc |> !cxx |> | $(BASE_DIR)/<startup> {obj}
|
||||
|
||||
ifeq (@(TUP_ARCH),i386)
|
||||
: foreach spec/x86_32/*.s |> !asm |> | $(BASE_DIR)/<startup> {obj}
|
||||
endif
|
||||
ifeq (@(TUP_ARCH),x86_64)
|
||||
: foreach spec/x86_64/*.s |> !asm |> | $(BASE_DIR)/<startup> {obj}
|
||||
endif
|
||||
ifeq (@(TUP_ARCH),arm64)
|
||||
: foreach spec/arm_64/*.s |> !asm |> | $(BASE_DIR)/<startup> {obj}
|
||||
endif
|
|
@ -0,0 +1,22 @@
|
|||
# This file must be included from another "repository" because
|
||||
# the C preprocessor is injecting headers that have the same
|
||||
# filename across "repositories", and if those headers are included
|
||||
# from this "repository", then things break at runtime. Thus the
|
||||
# preprocessor include directories must be set correctly before
|
||||
# this file is included. Do not be fooled into thinking that the
|
||||
# directory structure has significance.
|
||||
|
||||
: foreach $(BASE_DIR)/src/lib/startup/*.cc |> !cxx |> | $(REP_DIR)/<startup> {obj}
|
||||
|
||||
ifeq (@(TUP_ARCH),i386)
|
||||
: foreach $(BASE_DIR)/src/lib/startup/spec/x86_32/*.s \
|
||||
|> !asm |> | $(REP_DIR)/<startup> {obj}
|
||||
endif
|
||||
ifeq (@(TUP_ARCH),x86_64)
|
||||
: foreach $(BASE_DIR)/src/lib/startup/spec/x86_64/*.s \
|
||||
|> !asm |> | $(REP_DIR)/<startup> {obj}
|
||||
endif
|
||||
ifeq (@(TUP_ARCH),arm64)
|
||||
: foreach $(BASE_DIR)/src/lib/startup/spec/arm_64/*.s \
|
||||
|> !asm |> | $(REP_DIR)/<startup> {obj}
|
||||
endif
|
Loading…
Reference in New Issue