From: Sergiu Moga Date: Thu, 6 Feb 2025 09:26:55 +0000 (+0200) Subject: Introduce `EACHOLIB_EXPORTS` X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=b7d6ee32140c0d7aceb27313d8614ed8f99607bc;p=unikraft%2Funikraft.git Introduce `EACHOLIB_EXPORTS` Introduce the equivalent of `EACHOLIB_LOCALS`, but for exportsyms.uk. Now, one is able to add custom defined/named exportsyms.uk, in addition to an already existing exportsyms.uk. If no exportsyms.uk exists, then, unlike `EACHOLIB_LOCALS` which is processed regardless of whether a localsyms.uk exists or not, `EACHOLIB_EXPORTS` will be ignored. However, its result files may still be built as per Makefile recipe dependencies. Checkpatch-Ignore: UNIKRAFT_SUBJECT_FORMAT Signed-off-by: Sergiu Moga Reviewed-by: Michalis Pappas Approved-by: Michalis Pappas GitHub-Closes: #1577 --- diff --git a/Makefile b/Makefile index e6e45e408..bf41e1583 100644 --- a/Makefile +++ b/Makefile @@ -378,6 +378,8 @@ EACHOLIB_ALIBS := EACHOLIB_ALIBS-y := EACHOLIB_LOCALS := EACHOLIB_LOCALS-y := +EACHOLIB_EXPORTS := +EACHOLIB_EXPORTS-y := # Pull in the user's configuration file ifeq ($(filter $(noconfig_targets),$(MAKECMDGOALS)),) diff --git a/support/build/Makefile.rules b/support/build/Makefile.rules index 365fc1213..d60617784 100644 --- a/support/build/Makefile.rules +++ b/support/build/Makefile.rules @@ -1021,10 +1021,15 @@ $(call libname2preolib,$(1)): $$($(call vprefix_lib,$(1),OBJS)) \ $(call libname2olib,$(1)): $(call libname2preolib,$(1)) \ $$($(call vprefix_lib,$(1),EXPORTS)) $$($(call vprefix_lib,$(1),EXPORTS-y)) \ + $$(EACHOLIB_EXPORTS) $$(EACHOLIB_EXPORTS-y) \ $$($(call vprefix_lib,$(1),LOCALS)) $$($(call vprefix_lib,$(1),LOCALS-y)) \ $$(EACHOLIB_LOCALS) $$(EACHOLIB_LOCALS-y) $(call build_cmd,OBJCOPY,,$(call libname2olib,$(1)),\ - $(OBJCOPY) $$(addprefix --keep-global-symbols=,$$($(call vprefix_lib,$(1),EXPORTS)) $$($(call vprefix_lib,$(1),EXPORTS-y))) \ + $(OBJCOPY) \ + $$(addprefix --keep-global-symbols=,$$($(call vprefix_lib,$(1),EXPORTS)) $$($(call vprefix_lib,$(1),EXPORTS-y))) \ + $$(if \ + $$(and $$(strip $$($(call vprefix_lib,$(1),EXPORTS)) $$($(call vprefix_lib,$(1),EXPORTS-y))), $$(strip $$(EACHOLIB_EXPORTS) $$(EACHOLIB_EXPORTS-y))), \ + $$(addprefix --keep-global-symbols=,$$(EACHOLIB_EXPORTS) $$(EACHOLIB_EXPORTS-y))) \ $$(addprefix --localize-symbols=,$$($(call vprefix_lib,$(1),LOCALS)) $$($(call vprefix_lib,$(1),LOCALS-y))) \ $$(addprefix --localize-symbols=,$$(EACHOLIB_LOCALS) $$(EACHOLIB_LOCALS-y)) \ $$(OBJCFLAGS) $$(OBJCFLAGS-y) \