[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[UNIKRAFT PATCH 1/3] build: Support multiple symbol export files



Adds support that `$(LIBNAME_EXPORTS)` can contain a list of symbol
export files instead of only a single one. In order to simplify
writing of `Makefile.uk` files, a `$(LIBNAME_EXPORTS-y)` variant is
provided, too. With this variant, export symbols can be dependent to
library configuration, for example:
 LIBNAME_EXPORTS-$(CONFIG_MYLIB_EXTENDEDABI) += extendedsyms.uk
Having this feature, library symbols can be masked even without the
existence of a single `exportsyms.uk` file: Because of this, this
patch removes the "missing exportsyms.uk"-warning. In the case an
`exportsyms.uk` file exists for a library, it is still automatically
included and used: The previous behavior is preserved.

Signed-off-by: Simon Kuenzer <simon.kuenzer@xxxxxxxxx>
---
 support/build/Makefile.rules | 13 +++++--------
 1 file changed, 5 insertions(+), 8 deletions(-)

diff --git a/support/build/Makefile.rules b/support/build/Makefile.rules
index af08f830..384f24f0 100644
--- a/support/build/Makefile.rules
+++ b/support/build/Makefile.rules
@@ -189,7 +189,7 @@ $(call mk_sub_build_dir,$(1))
 UK_LIBS += $(1)
 $(eval $(call uc,$(1))_BASE    := $(_IMPORT_BASE))
 $(eval $(call uc,$(1))_BUILD   := $(BUILD_DIR)/$(1))
-$(eval $(call uc,$(1))_EXPORTS := $(_IMPORT_BASE)/exportsyms.uk)
+$(eval $(call uc,$(1))_EXPORTS += $(wildcard $(_IMPORT_BASE)/exportsyms.uk))
 endef
 
 # addlib_s $libname,$switch
@@ -206,7 +206,7 @@ $(eval $(call uc,$(2))_PLATS   += $(call uc,$(1)))
 $(eval $(call uc,$(1))_LIBS    += $(2))
 $(eval $(call uc,$(2))_BASE    := $(_IMPORT_BASE))
 $(eval $(call uc,$(2))_BUILD   := $(BUILD_DIR)/$(2))
-$(eval $(call uc,$(2))_EXPORTS := $(_IMPORT_BASE)/exportsyms.uk)
+$(eval $(call uc,$(2))_EXPORTS += $(wildcard $(_IMPORT_BASE)/exportsyms.uk))
 endef
 
 # addplatlib_s $platname,$libname,$switch
@@ -718,10 +718,6 @@ endef
 
 # buildrule_olib $libname
 define buildrule_olib =
-$(if $(wildcard $($(call vprefix_lib,$(1),EXPORTS))),,\
-       $(call verbose_info,Warning: Definition of exported symbols for $(1) 
missing: $($(call vprefix_lib,$(1),EXPORTS))) \
-)
-
 $(call libname2preolib,$(1)): $($(call vprefix_lib,$(1),OBJS)) \
                              $($(call vprefix_lib,$(1),OBJS-y)) \
                              $($(call vprefix_lib,$(1),ALIBS)) \
@@ -742,9 +738,10 @@ $(call libname2preolib,$(1)): $($(call 
vprefix_lib,$(1),OBJS)) \
                      -Wl$(comma)--end-group \
                      -o $(call libname2preolib,$(1)))
 
-$(call libname2olib,$(1)): $(call libname2preolib,$(1)) $(if $(wildcard 
$($(call vprefix_lib,$(1),EXPORTS))),$($(call vprefix_lib,$(1),EXPORTS)),)
+$(call libname2olib,$(1)): $(call libname2preolib,$(1)) \
+                          $($(call vprefix_lib,$(1),EXPORTS)) $($(call 
vprefix_lib,$(1),EXPORTS-y)) \
        $(call build_cmd,OBJCOPY,,$(call libname2olib,$(1)),\
-               $(OBJCOPY) $(if $(wildcard $($(call 
vprefix_lib,$(1),EXPORTS))),--keep-global-symbols=$($(call 
vprefix_lib,$(1),EXPORTS)),) \
+               $(OBJCOPY) $(addprefix --keep-global-symbols=,$($(call 
vprefix_lib,$(1),EXPORTS)) $($(call vprefix_lib,$(1),EXPORTS-y))) \
                           $(OBJCFLAGS) $(OBJCFLAGS-y) \
                           $($(call vprefix_lib,$(1),OBJCFLAGS)) $($(call 
vprefix_lib,$(1),OBJCFLAGS-y)) \
                           $(call libname2preolib,$(1)) $(call 
libname2olib,$(1)))
-- 
2.20.1




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.