|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [XEN PATCH] libs: Fix unstable libs build on FreeBSD, auto-generate version-script
Unfortunatly, --default-symver doesn't work on FreeBSD 12, with LLVM's
LD. Instead, we will generate a temporary version-script.
In order to allow regenerating the script, we'll have a different
filename. In order to check if the content is up-to-date, we'll always
generated it and compare.
Reported-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
Fixes: 98d95437edb6 ("libs: Fix auto-generation of version-script for unstable
libs")
Signed-off-by: Anthony PERARD <anthony.perard@xxxxxxxxxx>
---
tools/libs/libs.mk | 13 +++++++++++--
1 file changed, 11 insertions(+), 2 deletions(-)
diff --git a/tools/libs/libs.mk b/tools/libs/libs.mk
index 0e4b5e0bd0..cab8e9704a 100644
--- a/tools/libs/libs.mk
+++ b/tools/libs/libs.mk
@@ -5,6 +5,7 @@
# MAJOR: major version of lib (Xen version if empty)
# MINOR: minor version of lib (0 if empty)
# version-script: Specify the name of a version script to the linker.
+# (If empty, a temporary one for unstable library is created)
LIBNAME := $(notdir $(CURDIR))
@@ -13,6 +14,10 @@ MAJOR := $(shell $(XEN_ROOT)/version.sh
$(XEN_ROOT)/xen/Makefile)
endif
MINOR ?= 0
+ifeq ($(origin version-script), undefined)
+version-script := libxen$(LIBNAME).map.tmp
+endif
+
CFLAGS += -Wmissing-prototypes
CFLAGS += $(CFLAGS_xeninclude)
CFLAGS += $(foreach lib, $(USELIBS_$(LIBNAME)), $(CFLAGS_libxen$(lib)))
@@ -72,6 +77,10 @@ headers.lst: FORCE
@{ set -e; $(foreach h,$(LIBHEADERS),echo $(h);) } > $@.tmp
@$(call move-if-changed,$@.tmp,$@)
+libxen$(LIBNAME).map.tmp: FORCE
+ echo 'VERS_$(MAJOR).$(MINOR) { global: *; };' >.$@.tmp
+ $(call move-if-changed,.$@.tmp,$@)
+
lib$(LIB_FILE_NAME).a: $(OBJS-y)
$(AR) rc $@ $^
@@ -81,7 +90,7 @@ lib$(LIB_FILE_NAME).so.$(MAJOR):
lib$(LIB_FILE_NAME).so.$(MAJOR).$(MINOR)
$(SYMLINK_SHLIB) $< $@
lib$(LIB_FILE_NAME).so.$(MAJOR).$(MINOR): $(PIC_OBJS) $(version-script)
- $(CC) $(LDFLAGS) $(PTHREAD_LDFLAGS) -Wl,$(SONAME_LDFLAG)
-Wl,lib$(LIB_FILE_NAME).so.$(MAJOR) -Wl,$(if
$(version-script),--version-script=$(version-script),--default-symver)
$(SHLIB_LDFLAGS) -o $@ $(PIC_OBJS) $(LDLIBS) $(APPEND_LDFLAGS)
+ $(CC) $(LDFLAGS) $(PTHREAD_LDFLAGS) -Wl,$(SONAME_LDFLAG)
-Wl,lib$(LIB_FILE_NAME).so.$(MAJOR) -Wl,--version-script=$(version-script)
$(SHLIB_LDFLAGS) -o $@ $(PIC_OBJS) $(LDLIBS) $(APPEND_LDFLAGS)
# If abi-dumper is available, write out the ABI analysis
ifneq ($(ABI_DUMPER),)
@@ -120,7 +129,7 @@ TAGS:
clean::
rm -rf $(TARGETS) *~ $(DEPS_RM) $(OBJS-y) $(PIC_OBJS)
rm -f lib$(LIB_FILE_NAME).so.$(MAJOR).$(MINOR)
lib$(LIB_FILE_NAME).so.$(MAJOR)
- rm -f headers.chk headers.lst
+ rm -f headers.chk headers.lst libxen*.map.tmp
.PHONY: distclean
distclean: clean
--
Anthony PERARD
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |