2014-05-20 09:40:50 +00:00
|
|
|
SHARED_LIB = yes
|
2016-12-01 18:00:11 +00:00
|
|
|
DIR = $(BASE_DIR)/src/lib/ldso
|
2014-05-20 09:40:50 +00:00
|
|
|
|
2016-12-09 22:09:17 +00:00
|
|
|
LIB_IS_DYNAMIC_LINKER = yes
|
|
|
|
|
2014-05-20 09:40:50 +00:00
|
|
|
include $(BASE_DIR)/mk/base-libs.mk
|
|
|
|
|
|
|
|
LIBS = $(BASE_LIBS)
|
2016-10-30 14:17:24 +00:00
|
|
|
SRC_CC = main.cc test.cc exception.cc dependency.cc debug.cc \
|
2015-03-10 10:16:03 +00:00
|
|
|
shared_object.cc
|
2014-05-20 09:40:50 +00:00
|
|
|
SRC_S = jmp_slot.s
|
|
|
|
INC_DIR += $(DIR)/include
|
2016-04-18 14:00:51 +00:00
|
|
|
INC_DIR += $(BASE_DIR)/src/include
|
2016-12-23 11:57:29 +00:00
|
|
|
LD_OPT += -Bsymbolic-functions --version-script=symbol.map
|
|
|
|
|
2018-01-10 13:29:23 +00:00
|
|
|
# enable use of 'check_abi'
|
|
|
|
SYMBOLS := $(BASE_DIR)/lib/symbols/ld
|
|
|
|
|
2016-12-23 11:57:29 +00:00
|
|
|
#
|
|
|
|
# Generate symbol map from the ABI
|
|
|
|
#
|
|
|
|
$(LIB).lib.so: symbol.map
|
|
|
|
symbol.map: $(MAKEFILE_LIST)
|
|
|
|
symbol.map: $(BASE_DIR)/lib/symbols/ld
|
|
|
|
$(MSG_CONVERT)$@
|
|
|
|
$(VERBOSE)(echo -e "{\n\tglobal:";\
|
|
|
|
sed -n "s/^\(\w\+\) .*/\t\t\1;/p" $<;\
|
|
|
|
echo -e "\tlocal: *;\n};") > $@
|
2014-05-20 09:40:50 +00:00
|
|
|
|
|
|
|
ifneq ($(filter linux, $(SPECS)),)
|
2015-11-26 09:30:23 +00:00
|
|
|
|
|
|
|
ENTRY_POINT = _start_initial_stack
|
2019-08-20 12:32:01 +00:00
|
|
|
LD_SCRIPT_SO = $(call select_from_repositories,src/ld/stack_area.ld) \
|
|
|
|
-T$(BASE_DIR)/src/ld/genode_rel.ld
|
2015-11-26 09:30:23 +00:00
|
|
|
|
|
|
|
ifneq ($(filter x86_32, $(SPECS)),)
|
|
|
|
LD_OPT += -T$(DIR)/linux-32.ld
|
|
|
|
endif
|
|
|
|
|
2019-08-20 12:32:01 +00:00
|
|
|
#
|
2019-08-22 08:50:01 +00:00
|
|
|
# Set dynamic linker ELF type to executable
|
2019-08-20 12:32:01 +00:00
|
|
|
#
|
|
|
|
ifeq ($(called_from_lib_mk),yes)
|
|
|
|
$(LIB).lib.so.stripped: postprocess.tag
|
|
|
|
postprocess.tag: $(LIB).lib.so
|
2019-08-22 08:50:01 +00:00
|
|
|
$(VERBOSE)printf "\x02" |\
|
|
|
|
dd of=$(LIB).lib.so bs=1 seek=16 count=1 conv=notrunc \
|
|
|
|
2> /dev/null
|
2021-01-20 14:23:32 +00:00
|
|
|
$(VERBOSE)touch $@
|
2019-08-20 12:32:01 +00:00
|
|
|
endif
|
|
|
|
|
2014-05-20 09:40:50 +00:00
|
|
|
else
|
2015-11-26 09:30:23 +00:00
|
|
|
ENTRY_POINT = _start
|
|
|
|
LD_OPT += -T$(DIR)/linker.ld
|
2014-05-20 09:40:50 +00:00
|
|
|
endif
|
|
|
|
|
|
|
|
vpath %.cc $(DIR)
|
|
|
|
|
|
|
|
# vi:ft=make
|
|
|
|
|