mirror of
https://github.com/genodelabs/genode.git
synced 2024-12-18 21:27:56 +00:00
base: Do not link base libs against shared libs
Base libraries are already contained within ldso.lib.so. Remove unnecessary filtering from 'dep_lib.mk', make ldso depend on base libs. Issue #1017 Issue #989
This commit is contained in:
parent
481a8ede5f
commit
f447fbe1a5
@ -4,7 +4,7 @@
|
||||
# \date 2013-02-14
|
||||
#
|
||||
|
||||
LIBS += cxx l4 startup
|
||||
LIBS += cxx syscall startup
|
||||
|
||||
SRC_CC += cap_copy.cc
|
||||
SRC_CC += ipc/ipc.cc ipc/pager.cc ipc/ipc_marshal_cap.cc
|
||||
|
@ -4,7 +4,7 @@
|
||||
# These static libraries are filtered out when linking dynamically linked
|
||||
# binaries.
|
||||
#
|
||||
BASE_LIBS = base-common base cxx timed_semaphore alarm config
|
||||
BASE_LIBS = base-common base cxx timed_semaphore alarm config syscall
|
||||
|
||||
#
|
||||
# Name of Genode's dynamic linker
|
||||
|
@ -68,21 +68,17 @@ warn_missing_lib_mk: generate_lib_rule_for_defect_library
|
||||
override REP_DIR := $(firstword $(foreach REP,$(REPOSITORIES),$(findstring $(REP)/,$(LIB_MK))))
|
||||
override REP_DIR := $(REP_DIR:/=)
|
||||
|
||||
include $(LIB_MK)
|
||||
include $(BASE_DIR)/mk/base-libs.mk
|
||||
#
|
||||
# Libraries from the library depends on
|
||||
include $(LIB_MK)
|
||||
|
||||
ifdef SHARED_LIB
|
||||
#
|
||||
# For shared libraries, we have to make sure to build ldso support before
|
||||
# building a shared library.
|
||||
#
|
||||
ifdef SHARED_LIB
|
||||
LIBS += ldso-startup
|
||||
|
||||
ifeq ($(LIB),$(DYNAMIC_LINKER))
|
||||
LIBS += $(BASE_LIBS)
|
||||
else
|
||||
LIBS := $(filter-out $(BASE_LIBS),$(LIBS))
|
||||
ifneq ($(LIB),$(DYNAMIC_LINKER))
|
||||
LIBS += $(DYNAMIC_LINKER)
|
||||
|
||||
#
|
||||
@ -95,7 +91,13 @@ LIBS += $(DYNAMIC_LINKER)
|
||||
LIBS += startup_dyn
|
||||
endif
|
||||
|
||||
|
||||
#
|
||||
# Ensure that startup_dyn is build for the dynamic programs that depend on a
|
||||
# shared library. They add it to their dependencies as replacement for the
|
||||
# static-case startup as soon as they recognize that they are dynamic.
|
||||
# The current library in contrast filters-out startup_dyn from its
|
||||
# dependencies before they get merged.
|
||||
#
|
||||
DEP_VAR_NAME := DEP_$(LIB).lib.so
|
||||
else
|
||||
DEP_VAR_NAME := DEP_$(LIB).lib
|
||||
|
@ -15,6 +15,8 @@
|
||||
## REP_DIR - repository where the library resides
|
||||
##
|
||||
|
||||
include $(BASE_DIR)/mk/base-libs.mk
|
||||
|
||||
#
|
||||
# Prevent <libname>.mk rules to be executed as default rule
|
||||
#
|
||||
@ -132,10 +134,11 @@ ifdef SHARED_LIB
|
||||
override DEPS := $(filter-out startup_dyn.lib,$(DEPS))
|
||||
|
||||
#
|
||||
# Prevent linkage of startup code against shared libraries except for ld.lib.so
|
||||
# Prevent linkage of startup code and base libs against shared libraries except
|
||||
# for ld.lib.so
|
||||
#
|
||||
ifneq ($(LIB),ld)
|
||||
override DEPS := $(filter-out startup.lib,$(DEPS))
|
||||
override DEPS := $(filter-out $(BASE_LIBS:=.lib) startup.lib,$(DEPS))
|
||||
endif
|
||||
endif
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
SRC_CC = main.cc
|
||||
TARGET = test-ldso
|
||||
LIBS = test-ldso base libc libm
|
||||
LIBS = test-ldso libc libm
|
||||
INC_DIR += $(REP_DIR)/src/test/ldso/include
|
||||
|
@ -1,6 +1,6 @@
|
||||
SRC_CC = parent_cap.cc binary_name.cc
|
||||
SRC_C = dummy.c
|
||||
LIBS = ldso_crt0 l4
|
||||
LIBS = ldso_crt0 syscall
|
||||
|
||||
vpath parent_cap.cc $(REP_DIR)/src/lib/ldso/arch
|
||||
vpath binary_name.cc $(REP_DIR)/src/lib/ldso/arch
|
||||
|
@ -1,7 +1,8 @@
|
||||
#note: leave empty to disable debugging output
|
||||
DEBUG =
|
||||
|
||||
LIBS = base ldso-arch
|
||||
include $(BASE_DIR)/mk/base-libs.mk
|
||||
LIBS = $(BASE_LIBS) ldso-arch
|
||||
|
||||
SRC_S = rtld_start.S
|
||||
SRC_C = reloc.c rtld.c map_object.c xmalloc.c debug.c main.c \
|
||||
|
Loading…
Reference in New Issue
Block a user