From nobody Fri May 17 05:50:20 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=reject dis=none) header.from=citrix.com ARC-Seal: i=1; a=rsa-sha256; t=1674243922; cv=none; d=zohomail.com; s=zohoarc; b=bskQPYJLpiVckFkI6IAyszKfwIKgvP4fjo6csFS90S3QO6CC4v43z3wn+/UmrzM3YCymgmReIygPJDATW5f+Q85OMHi5Y2zp14gNsH+1v8u0oJc85ca+XtZffrQSr73aAkCYN1rVas93PMKeHsIxj9ScdkRWWfb1x1f6CxBkyD4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1674243922; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=hEK0GtctY7HbXKWs9fELL7Ngfa6hz6KD5xvDY5iDR+Y=; b=X/sQ5UbneG2DBeXzks+qD8RlML/UYG1XuXEWVKOQzIaxrGdbYajEIRtR5ROZ4Hdc9OZ0GnkLNdO8I7O8+OT+JwARU2msunka9rLAush/QbYVtUwOlV8+RkflWpzqNxEp7otDezkfykyCSVGA1jYfrVXoJ3pZgi692DJZgIO2f60= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1674243922516192.69340655729843; Fri, 20 Jan 2023 11:45:22 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.482099.747450 (Exim 4.92) (envelope-from ) id 1pIxJk-0007Cu-Sp; Fri, 20 Jan 2023 19:44:52 +0000 Received: by outflank-mailman (output) from mailman id 482099.747450; Fri, 20 Jan 2023 19:44:52 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1pIxJk-0007Cn-Pp; Fri, 20 Jan 2023 19:44:52 +0000 Received: by outflank-mailman (input) for mailman id 482099; Fri, 20 Jan 2023 19:44:51 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1pIxJj-0006vE-Kx for xen-devel@lists.xenproject.org; Fri, 20 Jan 2023 19:44:51 +0000 Received: from esa4.hc3370-68.iphmx.com (esa4.hc3370-68.iphmx.com [216.71.155.144]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id e5f4d844-98fa-11ed-91b6-6bf2151ebd3b; Fri, 20 Jan 2023 20:44:50 +0100 (CET) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: e5f4d844-98fa-11ed-91b6-6bf2151ebd3b DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1674243889; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=yUuDd1gBVYbDkE4V3W6tzEt+GcRRvH9lKf79QyzlwRo=; b=DlfZabN+4uDl62V2QsM9LZ6s318H2J5IwETN5iPrqBm3DNummPkxxF2V FQU+flX+hXswe6tJnp/06DyukKFOnldenWyNXYV+nzreJ2UogenoPjH0r 09YmQS0lnI6ILXqpYGFWiJ7QzA4sIyMIfyBEYyfcM/6pnXMR9E6m2NyWB 8=; Authentication-Results: esa4.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none X-SBRS: 4.0 X-MesageID: 96015186 X-Ironport-Server: esa4.hc3370-68.iphmx.com X-Remote-IP: 162.221.156.123 X-Policy: $RELAYED IronPort-Data: A9a23:kMFk+aNG9xApFkfvrR1sl8FynXyQoLVcMsEvi/4bfWQNrUp01GdUn zBNUW2BbPncajP9ftskYYW/phgAvZfcz4NnHgto+SlhQUwRpJueD7x1DKtS0wC6dZSfER09v 63yTvGacajYm1eF/k/F3oDJ9CU6jufQA+KmU4YoAwgpLSd8UiAtlBl/rOAwh49skLCRDhiE/ Nj/uKUzAnf8s9JPGj9Suv3rRC9H5qyo42tB5ARmPpingXeF/5UrJMNHTU2OByOQrrl8RoaSW +vFxbelyWLVlz9F5gSNy+uTnuUiG9Y+DCDW4pZkc/HKbitq/0Te5p0TJvsEAXq7vh3S9zxHJ HehgrTrIeshFvWkdO3wyHC0GQkmVUFN0OevzXRSLaV/ZqAJGpfh66wGMa04AWEX0v14UEtv7 P0HEyoqaEm7jrrt/rmATeY506zPLOGzVG8eknRpzDWfBvc6W5HTBa7N4Le03h9p2JoIR6yHI ZNEN3w2Nk+ojx5nYz/7DLo3mvuogX/uNSVVsluPqYI84nTJzRw327/oWDbQUo3UHZwIxxbGz o7A11zfGSMhDcyi8yu672mgmuOUkinAYI1HQdVU8dY12QbOlwT/EiY+RVa95PW0lEO6c9ZeM FAPvDojq7Ao806mRcW7WAe3yFaGtBMBX9tbE8Uh9RqAjKHT5m6xBHUATzNHQMwrsokxXzNC/ kSSg9rjCDhrsbuUYXGQ7LGZqXW1Iyd9BXAGTT8JS00C+daLiIM8lBXUVf54DbW4yNbyHFnNL yui9XZkwe9J1IhSivv9pAqc696xmnTXZhU6ty/2R2O61RleYtedbtTz11Pg6vkVee51UWK9l HQDnsGf6sUHApeMiDGBTY0xIV252xqWGGaC2AAyRvHN4xzooif+Jt4IvFmSMW8zaq45lSnVj Fg/UO+7zLtaJzOUYKB+eOpd4Ox6nPG7RbwJuh05B+eig6SdlyfdpkmCgHJ8OUi3yCARfVkXY 8vzTCpVJS9y5V5b5DS3XfwB9rQg2zozw2jeLbiikUv7i+HPOSfFFe9dWLdrUgzfxPncyOky2 48PX/ZmNj0FCLGuCsUp2dB7wa82wYgTWsmt9p0/mh+rKQt6AmAxY8I9Mpt4E7GJa599z7+Sl lnkAx8w9bYKrSGfQel8Qiw5OeyHsFcWhS5TABHAyn7xgihzPN31sPtEH3b1FJF+nNFeITdPZ 6FtU6297j5nFlwrJxx1gUHBkbFf IronPort-HdrOrdr: A9a23:DHRGl60tTacs22Tg72kkvQqjBLQkLtp133Aq2lEZdPRUGvb2qy nIpoV96faUskdpZJhOo7G90cW7LE80sKQFg7X5Xo3SODUO2lHJEGgK1+KLqFfd8m/Fh4tgPM 9bAs5D4bbLY2SS4/yX3ODBKadC/OW6 X-IronPort-AV: E=Sophos;i="5.97,233,1669093200"; d="scan'208";a="96015186" From: Anthony PERARD To: CC: Anthony PERARD , Andrew Cooper , Andrew Cooper , George Dunlap , Jan Beulich , Julien Grall , Stefano Stabellini , Wei Liu , Juergen Gross Subject: [XEN PATCH for-4.17 v6 1/5] libs: Fix auto-generation of version-script for unstable libs Date: Fri, 20 Jan 2023 19:44:27 +0000 Message-ID: <20230120194431.55922-2-anthony.perard@citrix.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230120194431.55922-1-anthony.perard@citrix.com> References: <20230120194431.55922-1-anthony.perard@citrix.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @citrix.com) X-ZM-MESSAGEID: 1674243924556100003 Content-Type: text/plain; charset="utf-8" When there isn't a version-script for a shared library (like for unstable libs), we create one based on the current Xen version. But that version-script became out-of-date as soon as Xen's version changes and make as no way to regenerate the version-script on rebuild. For unstable libs, we only needs the symver to be different from a previous release of Xen. There's an option "--default-symver" which allow to use the soname as symver and as the soname have the Xen release version, it will be different for every release. With --default-symver we don't need to generate a version-script. But we also need to know if there's already an existing version script , for that we introduce $(version-script) to be used to point to the path of the existing script. (Guessing if a version script exist for a stable library with for example $(wildcard) won't work as a file will exist when building the library without this patch.) We don't need the version-script unless we are making the shared library so it is removed from the "all" target. Signed-off-by: Anthony PERARD Acked-by: Andrew Cooper --- Notes: v6: - use --default-symver instead of generating a version-script. (option was available in binutils 2.16, according to the doc, so that should work.) =20 v4: - new patch =20 CC: Andrew Cooper tools/libs/call/Makefile | 1 + tools/libs/ctrl/Makefile | 3 --- tools/libs/devicemodel/Makefile | 1 + tools/libs/evtchn/Makefile | 1 + tools/libs/foreignmemory/Makefile | 1 + tools/libs/gnttab/Makefile | 1 + tools/libs/guest/Makefile | 3 --- tools/libs/hypfs/Makefile | 1 + tools/libs/light/Makefile | 1 - tools/libs/stat/Makefile | 2 +- tools/libs/store/Makefile | 1 + tools/libs/toolcore/Makefile | 1 + tools/libs/toollog/Makefile | 1 + tools/libs/util/Makefile | 3 --- tools/libs/vchan/Makefile | 3 --- tools/libs/libs.mk | 10 ++++------ .gitignore | 6 ------ 17 files changed, 14 insertions(+), 26 deletions(-) diff --git a/tools/libs/call/Makefile b/tools/libs/call/Makefile index 103f5ad360..56a964b517 100644 --- a/tools/libs/call/Makefile +++ b/tools/libs/call/Makefile @@ -3,6 +3,7 @@ include $(XEN_ROOT)/tools/Rules.mk =20 MAJOR =3D 1 MINOR =3D 3 +version-script :=3D libxencall.map =20 include Makefile.common =20 diff --git a/tools/libs/ctrl/Makefile b/tools/libs/ctrl/Makefile index 93442ab389..094e84b8d8 100644 --- a/tools/libs/ctrl/Makefile +++ b/tools/libs/ctrl/Makefile @@ -10,6 +10,3 @@ PKG_CONFIG_NAME :=3D Xencontrol NO_HEADERS_CHK :=3D y =20 include $(XEN_ROOT)/tools/libs/libs.mk - -clean:: - rm -f libxenctrl.map diff --git a/tools/libs/devicemodel/Makefile b/tools/libs/devicemodel/Makef= ile index b70dd774e4..20d1d112e7 100644 --- a/tools/libs/devicemodel/Makefile +++ b/tools/libs/devicemodel/Makefile @@ -3,6 +3,7 @@ include $(XEN_ROOT)/tools/Rules.mk =20 MAJOR =3D 1 MINOR =3D 4 +version-script :=3D libxendevicemodel.map =20 include Makefile.common =20 diff --git a/tools/libs/evtchn/Makefile b/tools/libs/evtchn/Makefile index 3dad3840c6..18cdaab89e 100644 --- a/tools/libs/evtchn/Makefile +++ b/tools/libs/evtchn/Makefile @@ -3,6 +3,7 @@ include $(XEN_ROOT)/tools/Rules.mk =20 MAJOR =3D 1 MINOR =3D 2 +version-script :=3D libxenevtchn.map =20 include Makefile.common =20 diff --git a/tools/libs/foreignmemory/Makefile b/tools/libs/foreignmemory/M= akefile index b70dd774e4..81398e88b1 100644 --- a/tools/libs/foreignmemory/Makefile +++ b/tools/libs/foreignmemory/Makefile @@ -3,6 +3,7 @@ include $(XEN_ROOT)/tools/Rules.mk =20 MAJOR =3D 1 MINOR =3D 4 +version-script :=3D libxenforeignmemory.map =20 include Makefile.common =20 diff --git a/tools/libs/gnttab/Makefile b/tools/libs/gnttab/Makefile index 3dad3840c6..4528830bdc 100644 --- a/tools/libs/gnttab/Makefile +++ b/tools/libs/gnttab/Makefile @@ -3,6 +3,7 @@ include $(XEN_ROOT)/tools/Rules.mk =20 MAJOR =3D 1 MINOR =3D 2 +version-script :=3D libxengnttab.map =20 include Makefile.common =20 diff --git a/tools/libs/guest/Makefile b/tools/libs/guest/Makefile index 19d3ff2fdb..93338a9301 100644 --- a/tools/libs/guest/Makefile +++ b/tools/libs/guest/Makefile @@ -14,6 +14,3 @@ NO_HEADERS_CHK :=3D y include $(XEN_ROOT)/tools/libs/libs.mk =20 libxenguest.so.$(MAJOR).$(MINOR): LDLIBS +=3D $(ZLIB_LIBS) -lz - -clean:: - rm -f libxenguest.map diff --git a/tools/libs/hypfs/Makefile b/tools/libs/hypfs/Makefile index 630e1e6f3e..7fae5c750d 100644 --- a/tools/libs/hypfs/Makefile +++ b/tools/libs/hypfs/Makefile @@ -3,6 +3,7 @@ include $(XEN_ROOT)/tools/Rules.mk =20 MAJOR =3D 1 MINOR =3D 0 +version-script :=3D libxenhypfs.map =20 LDLIBS +=3D -lz =20 diff --git a/tools/libs/light/Makefile b/tools/libs/light/Makefile index 4fddcc6f51..cd3fa855e1 100644 --- a/tools/libs/light/Makefile +++ b/tools/libs/light/Makefile @@ -262,6 +262,5 @@ clean:: $(RM) testidl.c.new testidl.c *.api-ok $(RM) $(TEST_PROGS) libxenlight_test.so libxl_test_*.opic $(RM) -r __pycache__ - $(RM) libxenlight.map $(RM) $(AUTOSRCS) $(AUTOINCS) $(MAKE) -C $(ACPI_PATH) ACPI_BUILD_DIR=3D$(CURDIR) clean diff --git a/tools/libs/stat/Makefile b/tools/libs/stat/Makefile index 7eaf50e91e..ee5c42bf7b 100644 --- a/tools/libs/stat/Makefile +++ b/tools/libs/stat/Makefile @@ -134,4 +134,4 @@ uninstall:: uninstall-perl-bindings endif =20 clean:: - $(RM) libxenstat.map $(BINDINGS) $(BINDINGSRC) + $(RM) $(BINDINGS) $(BINDINGSRC) diff --git a/tools/libs/store/Makefile b/tools/libs/store/Makefile index 3557a8c76d..daed9d148f 100644 --- a/tools/libs/store/Makefile +++ b/tools/libs/store/Makefile @@ -3,6 +3,7 @@ include $(XEN_ROOT)/tools/Rules.mk =20 MAJOR =3D 4 MINOR =3D 0 +version-script :=3D libxenstore.map =20 ifeq ($(CONFIG_Linux),y) LDLIBS +=3D -ldl diff --git a/tools/libs/toolcore/Makefile b/tools/libs/toolcore/Makefile index 0d92b68b3b..20671dadd0 100644 --- a/tools/libs/toolcore/Makefile +++ b/tools/libs/toolcore/Makefile @@ -3,6 +3,7 @@ include $(XEN_ROOT)/tools/Rules.mk =20 MAJOR =3D 1 MINOR =3D 0 +version-script :=3D libxentoolcore.map =20 LIBHEADER :=3D xentoolcore.h =20 diff --git a/tools/libs/toollog/Makefile b/tools/libs/toollog/Makefile index 2361b8cbf1..d612227c85 100644 --- a/tools/libs/toollog/Makefile +++ b/tools/libs/toollog/Makefile @@ -3,6 +3,7 @@ include $(XEN_ROOT)/tools/Rules.mk =20 MAJOR =3D 1 MINOR =3D 0 +version-script :=3D libxentoollog.map =20 include Makefile.common =20 diff --git a/tools/libs/util/Makefile b/tools/libs/util/Makefile index 493d2e00be..e016baf888 100644 --- a/tools/libs/util/Makefile +++ b/tools/libs/util/Makefile @@ -47,6 +47,3 @@ $(OBJS-y) $(PIC_OBJS): $(AUTOINCS) %.c %.h:: %.l @rm -f $*.[ch] $(FLEX) --header-file=3D$*.h --outfile=3D$*.c $< - -clean:: - $(RM) libxenutil.map diff --git a/tools/libs/vchan/Makefile b/tools/libs/vchan/Makefile index ac2bff66f5..a1ef60ac8e 100644 --- a/tools/libs/vchan/Makefile +++ b/tools/libs/vchan/Makefile @@ -11,6 +11,3 @@ OBJS-y +=3D io.o NO_HEADERS_CHK :=3D y =20 include $(XEN_ROOT)/tools/libs/libs.mk - -clean:: - rm -f libxenvchan.map diff --git a/tools/libs/libs.mk b/tools/libs/libs.mk index 3eb91fc8f3..0e4b5e0bd0 100644 --- a/tools/libs/libs.mk +++ b/tools/libs/libs.mk @@ -4,6 +4,7 @@ # PKG_CONFIG: name of pkg-config file (xen$(LIBNAME).pc if empty) # 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. =20 LIBNAME :=3D $(notdir $(CURDIR)) =20 @@ -53,7 +54,7 @@ $(PKG_CONFIG_LOCAL): PKG_CONFIG_INCDIR =3D $(XEN_INCLUDE) $(PKG_CONFIG_LOCAL): PKG_CONFIG_LIBDIR =3D $(CURDIR) =20 .PHONY: all -all: $(TARGETS) $(PKG_CONFIG_LOCAL) libxen$(LIBNAME).map $(LIBHEADERS) +all: $(TARGETS) $(PKG_CONFIG_LOCAL) $(LIBHEADERS) =20 ifneq ($(NO_HEADERS_CHK),y) all: headers.chk @@ -71,9 +72,6 @@ headers.lst: FORCE @{ set -e; $(foreach h,$(LIBHEADERS),echo $(h);) } > $@.tmp @$(call move-if-changed,$@.tmp,$@) =20 -libxen$(LIBNAME).map: - echo 'VERS_$(MAJOR).$(MINOR) { global: *; };' >$@ - lib$(LIB_FILE_NAME).a: $(OBJS-y) $(AR) rc $@ $^ =20 @@ -82,8 +80,8 @@ lib$(LIB_FILE_NAME).so: lib$(LIB_FILE_NAME).so.$(MAJOR) lib$(LIB_FILE_NAME).so.$(MAJOR): lib$(LIB_FILE_NAME).so.$(MAJOR).$(MINOR) $(SYMLINK_SHLIB) $< $@ =20 -lib$(LIB_FILE_NAME).so.$(MAJOR).$(MINOR): $(PIC_OBJS) libxen$(LIBNAME).map - $(CC) $(LDFLAGS) $(PTHREAD_LDFLAGS) -Wl,$(SONAME_LDFLAG) -Wl,lib$(LIB_FIL= E_NAME).so.$(MAJOR) -Wl,--version-script=3Dlibxen$(LIBNAME).map $(SHLIB_LDF= LAGS) -o $@ $(PIC_OBJS) $(LDLIBS) $(APPEND_LDFLAGS) +lib$(LIB_FILE_NAME).so.$(MAJOR).$(MINOR): $(PIC_OBJS) $(version-script) + $(CC) $(LDFLAGS) $(PTHREAD_LDFLAGS) -Wl,$(SONAME_LDFLAG) -Wl,lib$(LIB_FIL= E_NAME).so.$(MAJOR) -Wl,$(if $(version-script),--version-script=3D$(version= -script),--default-symver) $(SHLIB_LDFLAGS) -o $@ $(PIC_OBJS) $(LDLIBS) $(A= PPEND_LDFLAGS) =20 # If abi-dumper is available, write out the ABI analysis ifneq ($(ABI_DUMPER),) diff --git a/.gitignore b/.gitignore index 880ba88c55..d9c906670d 100644 --- a/.gitignore +++ b/.gitignore @@ -110,8 +110,6 @@ tools/config.cache config/Tools.mk config/Stubdom.mk config/Docs.mk -tools/libs/ctrl/libxenctrl.map -tools/libs/guest/libxenguest.map tools/libs/guest/xc_bitops.h tools/libs/guest/xc_core.h tools/libs/guest/xc_core_arm.h @@ -121,7 +119,6 @@ tools/libs/light/_*.[ch] tools/libs/light/*.pyc tools/libs/light/_libxl.api-for-check tools/libs/light/*.api-ok -tools/libs/light/libxenlight.map tools/libs/light/libxl-save-helper tools/libs/light/dsdt* tools/libs/light/mk_dsdt @@ -131,13 +128,10 @@ tools/libs/light/testidl.c tools/libs/light/test_timedereg tools/libs/light/test_fdderegrace tools/libs/light/tmp.* -tools/libs/stat/libxenstat.map tools/libs/store/list.h tools/libs/store/utils.h tools/libs/store/xs_lib.c tools/libs/util/libxlu_cfg_y.output -tools/libs/util/libxenutil.map -tools/libs/vchan/libxenvchan.map tools/debugger/gdb/gdb-6.2.1-linux-i386-xen/* tools/debugger/gdb/gdb-6.2.1/* tools/debugger/gdb/gdb-6.2.1.tar.bz2 --=20 Anthony PERARD From nobody Fri May 17 05:50:20 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=reject dis=none) header.from=citrix.com ARC-Seal: i=1; a=rsa-sha256; t=1674243925; cv=none; d=zohomail.com; s=zohoarc; b=RRw0I/zGhHnV32NgMogsYu0W58GV6Reu3YblcJE0EX2zRGm8NXZqDxVVScGNaZn2yJbYJlyPu1UTYNercfVDvHpTOfoIc+2HB1tqKbmu5gg1OJiTSZN8+qzZIhew0eAXioTBn4s7zNeznJI9J1IcN3minb9FFOeXSHRCvYNIOU4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1674243925; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=f+0bLvKS9AJB70NgXN88VZmt76tR9xyFx9BF/0zNNPE=; b=cKaNa18VOdFnfWiwbru8Cf+PIZ9toNhBhhcVP7x2ffwcnDW3Yv16lfJbWXRy49BOrGqpT6+meQLd2Y1wqE1/O1d4BME0zqhKR7nnUAMo2nV/AFahRrSpCcq2KMVwO+vE3e+2DqWZPMkPaU9MtzFg25236G8RaGoXBVNjvY//7Sg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1674243925252303.64025866319923; Fri, 20 Jan 2023 11:45:25 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.482100.747460 (Exim 4.92) (envelope-from ) id 1pIxJn-0007T8-4Q; Fri, 20 Jan 2023 19:44:55 +0000 Received: by outflank-mailman (output) from mailman id 482100.747460; Fri, 20 Jan 2023 19:44:55 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1pIxJn-0007T1-1I; Fri, 20 Jan 2023 19:44:55 +0000 Received: by outflank-mailman (input) for mailman id 482100; Fri, 20 Jan 2023 19:44:54 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1pIxJm-0006vE-9G for xen-devel@lists.xenproject.org; Fri, 20 Jan 2023 19:44:54 +0000 Received: from esa5.hc3370-68.iphmx.com (esa5.hc3370-68.iphmx.com [216.71.155.168]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id e776542c-98fa-11ed-91b6-6bf2151ebd3b; Fri, 20 Jan 2023 20:44:52 +0100 (CET) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: e776542c-98fa-11ed-91b6-6bf2151ebd3b DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1674243892; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=wkzc8EHjHeIToBQwmAPpP3ELZs15aV2ACnx/cVw+uyo=; b=ftb0DCwjopmb3pSx+teFq8NvYUw7DWhEq1lQ6m/hxwGaIK8Msfn9TEhX hiTRYnVXIe0qR0X7v76f2VHKbOxzKhhUW2LG/g9fPurVF2Lc3D9zo743h K08OU2II4mkU8b/6piPc1EwNSaniGzPAtYnzaxfaaNLVcvcOA8Qs1xNh8 c=; Authentication-Results: esa5.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none X-SBRS: 4.0 X-MesageID: 92472092 X-Ironport-Server: esa5.hc3370-68.iphmx.com X-Remote-IP: 162.221.156.123 X-Policy: $RELAYED IronPort-Data: A9a23:Qg9Zi6+iZD9/AiYE3Y+bDrUDlH6TJUtcMsCJ2f8bNWPcYEJGY0x3z 2UbCmvQOvrYa2L1ftF+b4zgp04F7ZeAzdVhHQA5qS08E34SpcT7XtnIdU2Y0wF+jCHgZBk+s 5hBMImowOQcFCK0SsKFa+C5xZVE/fjUAOG6UKucYHsZqTZMEE8JkQhkl/MynrlmiN24BxLlk d7pqojUNUTNNwRcawr40Ire7kIw1BjOkGlA5AdmPKoT5AS2e0Q9V/rzG4ngdxMUfaEMdgKKb 76r5K20+Grf4yAsBruN+losWhRXKlJ6FVHmZkt+A8BOsDAbzsAB+v9T2M4nQVVWk120c+VZk 72hg3ASpTABZcUgkMxFO/VR/roX0aduoNcrKlDn2SCfItGvn9IBDJyCAWlvVbD09NqbDkl/1 eY/OhsOQCnfnt2b3omfQ+JU2PsseZyD0IM34hmMzBncBPciB5vCX7/L9ZlT2zJYasJmRKiEI ZBDMHw2MUqGOkcUUrsUIMtWcOOAj3/jczpeuRSNqLA++WT7xw1tyrn9dtHSf7RmQO0ExBrH/ DqXpQwVBDkZGtvE2we+1kiuodWXvynZaoUuEJqRo6sCbFq7mTVIVUx+uUGAiem0jAuyVsxSL 2QQ+zEytu4i+UqzVN7/Uhak5nmesXY0RN54A+A8rgaXxcL84QmDAXMfZiVcc9Fgv8gzLQHGz XfQwYmvX2Y29uTIFzTErOz8QS6O1TY9HE8YQj0vTiU8v8DcjZ8IqhvEdohcH/vg5jHqIg3Yz zePpSk4orwci88Xyqm2lWz6byKQSovhFVBsuFiONo6xxkYgPdP+OdT0gbTOxawYRLt1WGVtq 5TtdyK2yOkVRa+AmyWWKAnmNOH4vq3VWNEwbLMGInXAy9hO0yT5FWy13N2YDB0xWvvogRezP CfuVfp5vfe/xkeCY65teJ6WAM8316XmHtmNfqmKMYYUOcksLV/bpHkGiausM4bFyhBEfUYXY MfzTCpRJSxCVfQPIMSeGY/xLoPHNghhnDiOFPgXPjys0KaEZW79dFv2GALmUwzN14vd+F+92 48GZ6O3J+B3DLWWjt//rdRCcjjn7BETWfjLliCgXrfaclo7Qzt9V6S5LHFIU9UNopm5X9zgp hmVMnK0AnKm7ZEbAW1mskxeVY4= IronPort-HdrOrdr: A9a23:0UvX76j0lAuPl4zJVFek+OFeSHBQXssji2hC6mlwRA09TyX4ra 2TdZEgvnXJYVkqKRIdcK+7Scu9qB/nm6KdgrN8AV7BZmnbUQKTRelfBODZrAEIdReeygdV79 YET5RD X-IronPort-AV: E=Sophos;i="5.97,233,1669093200"; d="scan'208";a="92472092" From: Anthony PERARD To: CC: Anthony PERARD , Wei Liu , Juergen Gross Subject: [XEN PATCH for-4.17 v6 2/5] libs/light: Rework targets prerequisites Date: Fri, 20 Jan 2023 19:44:28 +0000 Message-ID: <20230120194431.55922-3-anthony.perard@citrix.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230120194431.55922-1-anthony.perard@citrix.com> References: <20230120194431.55922-1-anthony.perard@citrix.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @citrix.com) X-ZM-MESSAGEID: 1674243926534100007 Content-Type: text/plain; charset="utf-8" No need for $(AUTOSRCS), GNU make can generate them as needed when trying to build them as needed when trying to build the object. Also, those two AUTOSRCS don't need to be a prerequisite of "all". As for the "clean" target, those two files are already removed via "_*.c". We don't need $(AUTOINCS) either: - As for both _libxl_save_msgs*.h headers, we are adding more selective dependencies so the headers will still be generated as needed. - "clean" rule already delete the _*.h files, so AUTOINCS aren't needed there. "libxl_internal_json.h" doesn't seems to have ever existed, so the dependency is removed. Rework objects prerequisites, to have them dependents on either "libxl.h" or "libxl_internal.h". "libxl.h" is not normally included directly in the source code as "libxl_internal.h" is used instead, but we have "libxl.h" as prerequisite of "libxl_internal.h", so generated headers will still be generated as needed. Make doesn't need "libxl.h" to generate "testidl.c", "libxl.h" is only needed later when building "testidl.o". This avoid the need to regenerate "testidl.c" when only "libxl.h" changed. Also use automatic variables $< and $@. Signed-off-by: Anthony PERARD Reviewed-by: Juergen Gross --- Notes: v6: - rebased, part of the patch commited as 4ff0811 - reword commit message =20 v4: - new patch tools/libs/light/Makefile | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/tools/libs/light/Makefile b/tools/libs/light/Makefile index cd3fa855e1..b28447a2ae 100644 --- a/tools/libs/light/Makefile +++ b/tools/libs/light/Makefile @@ -148,9 +148,6 @@ LIBXL_TEST_OBJS +=3D $(foreach t, $(LIBXL_TESTS_INSIDE)= ,libxl_test_$t.opic) TEST_PROG_OBJS +=3D $(foreach t, $(LIBXL_TESTS_PROGS),test_$t.o) test_comm= on.o TEST_PROGS +=3D $(foreach t, $(LIBXL_TESTS_PROGS),test_$t) =20 -AUTOINCS =3D _libxl_save_msgs_callout.h _libxl_save_msgs_helper.h -AUTOSRCS =3D _libxl_save_msgs_callout.c _libxl_save_msgs_helper.c - CLIENTS =3D testidl libxl-save-helper =20 SAVE_HELPER_OBJS =3D libxl_save_helper.o _libxl_save_msgs_helper.o @@ -178,13 +175,13 @@ libxl_x86_acpi.o libxl_x86_acpi.opic: CFLAGS +=3D -I$= (XEN_ROOT)/tools $(SAVE_HELPER_OBJS): CFLAGS +=3D $(CFLAGS_libxenctrl) $(CFLAGS_libxenevtch= n) $(CFLAGS_libxenguest) =20 testidl.o: CFLAGS +=3D $(CFLAGS_libxenctrl) $(CFLAGS_libxenlight) -testidl.c: libxl_types.idl gentest.py $(XEN_INCLUDE)/libxl.h $(AUTOINCS) - $(PYTHON) gentest.py libxl_types.idl testidl.c.new - mv testidl.c.new testidl.c +testidl.c: libxl_types.idl gentest.py + $(PYTHON) gentest.py $< $@.new + mv -f $@.new $@ =20 -all: $(CLIENTS) $(TEST_PROGS) $(AUTOSRCS) $(AUTOINCS) +all: $(CLIENTS) $(TEST_PROGS) =20 -$(OBJS-y) $(PIC_OBJS) $(SAVE_HELPER_OBJS) $(LIBXL_TEST_OBJS) $(TEST_PROG_O= BJS): $(AUTOINCS) libxl.api-ok +$(OBJS-y) $(PIC_OBJS) $(SAVE_HELPER_OBJS) $(LIBXL_TEST_OBJS) $(TEST_PROG_O= BJS): libxl.api-ok =20 $(DSDT_FILES-y): acpi =20 @@ -196,7 +193,7 @@ libxl.api-ok: check-libxl-api-rules _libxl.api-for-check $(PERL) $^ touch $@ =20 -_libxl.api-for-check: $(XEN_INCLUDE)/libxl.h $(AUTOINCS) +_libxl.api-for-check: $(XEN_INCLUDE)/libxl.h $(CC) $(CPPFLAGS) $(CFLAGS) -c -E $< $(APPEND_CFLAGS) \ -DLIBXL_EXTERNAL_CALLERS_ONLY=3DLIBXL_EXTERNAL_CALLERS_ONLY \ >$@.new @@ -208,14 +205,22 @@ _libxl_save_msgs_helper.h _libxl_save_msgs_callout.h:= \ $(PERL) -w $< $@ >$@.new $(call move-if-changed,$@.new,$@) =20 +# +# headers dependencies on generated headers +# $(XEN_INCLUDE)/libxl.h: $(XEN_INCLUDE)/_libxl_types.h $(XEN_INCLUDE)/libxl_json.h: $(XEN_INCLUDE)/_libxl_types_json.h libxl_internal.h: $(XEN_INCLUDE)/libxl.h $(XEN_INCLUDE)/libxl_json.h libxl_internal.h: _libxl_types_internal.h _libxl_types_private.h _libxl_ty= pes_internal_private.h -libxl_internal_json.h: _libxl_types_internal_json.h +libxl_internal.h: _libxl_save_msgs_callout.h =20 -$(OBJS-y) $(PIC_OBJS) $(LIBXL_TEST_OBJS) $(TEST_PROG_OBJS) $(SAVE_HELPER_O= BJS): $(XEN_INCLUDE)/libxl.h +# +# objects dependencies on headers that depends on generated headers +# +$(TEST_PROG_OBJS): $(XEN_INCLUDE)/libxl.h $(OBJS-y) $(PIC_OBJS) $(LIBXL_TEST_OBJS): libxl_internal.h +$(SAVE_HELPER_OBJS): $(XEN_INCLUDE)/libxl.h _libxl_save_msgs_helper.h +testidl.o: $(XEN_INCLUDE)/libxl.h =20 # This exploits the 'multi-target pattern rule' trick. # gentypes.py should be executed only once to make all the targets. @@ -262,5 +267,4 @@ clean:: $(RM) testidl.c.new testidl.c *.api-ok $(RM) $(TEST_PROGS) libxenlight_test.so libxl_test_*.opic $(RM) -r __pycache__ - $(RM) $(AUTOSRCS) $(AUTOINCS) $(MAKE) -C $(ACPI_PATH) ACPI_BUILD_DIR=3D$(CURDIR) clean --=20 Anthony PERARD From nobody Fri May 17 05:50:20 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=reject dis=none) header.from=citrix.com ARC-Seal: i=1; a=rsa-sha256; t=1674243922; cv=none; d=zohomail.com; s=zohoarc; b=F2yNyuPlrshA0Qh5PHoGIWmcjMWQBxd40SKCIGIZclq8OFsooneZhtGsp+3E+oINMJ81qc0OYrmE1ufSqEWuX49NuhDwZ0gWafcgpHdPYFwWHVCvzD9DAiyGRX2EbTtCUycvjb3qWdsmqLYzdHYUl+VykdkJRztvsuF77121keA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1674243922; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=FUCsi8fHSieImU+Vb3O1oMzsiEZkx6uw/jn5SZYu/pM=; b=iAgDdJULOq2NyGRF75Ymq3tsp80eigmRFj1Z0RZ3C4KZuGvxmBgkSg7IEIupSwDdCiHGnN6HR4FcjY/oqO+5bulw6qzoe9er18rjK0/ihZH0MdNoaImJpvt4NccV1BeFIXjoij6V/4oYgbf3U0/saxoV/usc+8Eg+YeZz8dBHK8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1674243922684493.8650411596874; Fri, 20 Jan 2023 11:45:22 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.482101.747470 (Exim 4.92) (envelope-from ) id 1pIxJo-0007k1-Cj; Fri, 20 Jan 2023 19:44:56 +0000 Received: by outflank-mailman (output) from mailman id 482101.747470; Fri, 20 Jan 2023 19:44:56 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1pIxJo-0007jq-9b; Fri, 20 Jan 2023 19:44:56 +0000 Received: by outflank-mailman (input) for mailman id 482101; Fri, 20 Jan 2023 19:44:55 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1pIxJn-0007So-5n for xen-devel@lists.xenproject.org; Fri, 20 Jan 2023 19:44:55 +0000 Received: from esa6.hc3370-68.iphmx.com (esa6.hc3370-68.iphmx.com [216.71.155.175]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id e7997d30-98fa-11ed-b8d1-410ff93cb8f0; Fri, 20 Jan 2023 20:44:52 +0100 (CET) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: e7997d30-98fa-11ed-b8d1-410ff93cb8f0 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1674243892; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=qbIop1KczSm54uhv5dm8fTDAeLbDBaP++MO1eIvO/KI=; b=UrZkweEhhieC1HE1Oj90vdmqCb32sFEGeOaXaUkFCesrUzcExh74KnrM wZL3oxEjZPWUn9r8GgWJ391/PitXL3dwSZ6D+6Pv9KwILRDyQjDMcOs9J +iphaWP2XKmGlzgJmVBac4693spBVk+KoO58O6mCr0pmVDXlBj9WuxQmb Y=; Authentication-Results: esa6.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none X-SBRS: 4.0 X-MesageID: 93020460 X-Ironport-Server: esa6.hc3370-68.iphmx.com X-Remote-IP: 162.221.156.123 X-Policy: $RELAYED IronPort-Data: A9a23:iVGmQ6Al5g3PdBVW/z3jw5YqxClBgxIJ4kV8jS/XYbTApG4r3zRUx 2QdXG6BPP2KZ2T8fdpzaNu+90ICsZXRxodkQQY4rX1jcSlH+JHPbTi7wuUcHAvJd5GeExg3h yk6QoOdRCzhZiaE/n9BCpC48T8nk/nNHuCnYAL9EngZbRd+Tys8gg5Ulec8g4p56fC0GArIs t7pyyHlEAbNNwVcbyRFtMpvlDs15K6p4GpC5gRlDRx2lAS2e0c9Xcp3yZ6ZdxMUcqEMdsamS uDKyq2O/2+x13/B3fv8z94X2mVTKlLjFVDmZkh+AsBOsTAbzsAG6Y4pNeJ0VKtio27hc+ada jl6ncfYpQ8BZsUgkQmGOvVSO3kW0aZuoNcrLZUj2CA6IoKvn3bEmp1T4E8K0YIw8O10RmxB0 KYhLB9QRE3fv/+o4ZerY7w57igjBJGD0II3v3hhyXfSDOo8QICFSKLPjTNa9G5u3IYUR6+YP pdHL2M1N3wsYDUWUrsTIJs4gOevgGi5azBCoUiZjaE2/3LS3Ep6172F3N/9K4fSH50JwB7wS mTu3mLDXABCZNyjzhG8ok/xnL/hpwDQcddHfFG/3qEz2wDCroAJMzUJUXOrrP//jVSxM/pdJ FYT4TEGtrUp+QqgSdyVdw21pjuIswARX/JUEvYm80edx6zM+QGbC2MYCDlbZ7QbWNQeHGJwk AXTxpWwWGIp6efOIZ6AyluKhTm5Om8YIkpYXCsrECFYv+H+vqAWnjuaG76PD5WJptHyHDjxx RWDoy4/m6gfgKY36kmrwbzUq2ny/8aUF2bZ8i2SBzv4tV0hOOZJcqTysTDmAeB8wJF1p7Vrl FwNgICg4e8HFvlhfwTdEbxWTNlFCxtoWQAwYGKD/LF7rVxBHkJPm6gKuFlDyL9BaJpsRNMQS Ba7VfltzJFSJmC2SqR8fpi8Dc8npYC5S4u5DKuFM4MePsApHONiwM2ITRTIt4wKuBF8+ZzTx L/BKZr8ZZrkIfoPIMWKqxc1juZwm3FWKZL7TpHn1RW3uYdyl1bMIYrpxGCmN7hjhIvd+VW9z jqqH5fSo/mpeLGkM3a/HE96BQxiEEXX8riv8pwHK7XZflY9cIzjYteIqY4cl0Vet/w9vo/1E ruVASe0FHKXaaX7FDi3 IronPort-HdrOrdr: A9a23:ix/VBKq0DbD/C/hmaFsaDlkaV5sGLNV00zEX/kB9WHVpm5Oj5q eTdaUgpHvJYWgqKRQdcIi7Sdu9qXO1z+8O3WBjB8bWYOCGghrqEGgG1+DfKlLbalPDH4JmpN 9dmu1Fea7N5DtB/ITHCWuDYqcdKbC8mcjY55a5vg5QpENRGtFdBmxCe3um+zhNNXZ77O0CZe ahD6R81kGdkHIsDrXZOpD6ZYf+Tibw+a4OnSRmO/fc0mOzZMyThIIS7iL34j4uFxd0hZsy+2 nMlAL0oo2lrvGA0xfZk0PD8phMn9Pl691bQOiBkNIcJDnAghuhIN0JYczHgBkF5MWUrHo6mt jFpBkte+x19nPqZ2mw5Tf9xgX61z4qynn6jXuVm2Hqr8DVTC8zT+BBmYVaWB3E7FdIhqA47I t7m0ai87ZHBxLJmyrwo/LSUQtxq0ayqX0+1cYOkn12S+IlGflshL1a2HkQPIYLHSr85oxiOv JpFtvg6PFfdk7fR2zFv1No3MenUh0Ib067qwk5y5SoOgpt7SpEJngjtZEid7A7hc4Aoqx/lr /522JT5e5zp4EtHPxA7aw6ML+K4yT2MGXx2SSpUBPa/eg8SgTwgo+y77Mv6O6wfpsUiJM0hZ TaSVtd8XU/YkT0FKS1rdN2Gz32MSmAtA7Wu45jzok8vqe5SKvgMCWFRlxrm8y8o+8HCsmeX/ qoIppZD/LqMGOrQO9yrk3DcogXLWNbXNweu949VV7LqsXXKpfyvuiedPrIPrLiHTstR2u6CH oeWzr4ItlG8ymQKz7FqQmUX2modl30/Jp2HqSf9+8PyJIVPokJqQQRgUTR3LDHFdSDiN19QK JTGsKtrkrgnxj+wY/h1RQgBiZg X-IronPort-AV: E=Sophos;i="5.97,233,1669093200"; d="scan'208";a="93020460" From: Anthony PERARD To: CC: Anthony PERARD , Wei Liu , "Juergen Gross" Subject: [XEN PATCH for-4.17 v6 3/5] libs/light: Makefile cleanup Date: Fri, 20 Jan 2023 19:44:29 +0000 Message-ID: <20230120194431.55922-4-anthony.perard@citrix.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230120194431.55922-1-anthony.perard@citrix.com> References: <20230120194431.55922-1-anthony.perard@citrix.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @citrix.com) X-ZM-MESSAGEID: 1674243924744100005 Content-Type: text/plain; charset="utf-8" Rework "libacpi.h" include in "libxl_x86_acpi.c" as to be more selective about the include path and only add "tools/libacpi/". Also "libxl_dom.c" don't use "libacpi.h" anymore. Use "-iquote" for libacpi headers. Get rid of the weird "$(eval stem =3D" in the middle of a recipe and use a make automatic variable "$(*F)" instead. Signed-off-by: Anthony PERARD Reviewed-by: Juergen Gross --- Notes: v4: - new patch tools/libs/light/Makefile | 16 +++++++--------- tools/libs/light/libxl_x86_acpi.c | 2 +- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/tools/libs/light/Makefile b/tools/libs/light/Makefile index b28447a2ae..96daeabc47 100644 --- a/tools/libs/light/Makefile +++ b/tools/libs/light/Makefile @@ -170,8 +170,7 @@ LDLIBS +=3D $(LDLIBS-y) $(OBJS-y) $(PIC_OBJS) $(LIBXL_TEST_OBJS): CFLAGS +=3D $(CFLAGS_LIBXL) -inc= lude $(XEN_ROOT)/tools/config.h $(ACPI_OBJS) $(ACPI_PIC_OBJS): CFLAGS +=3D -I. -DLIBACPI_STDUTILS=3D\"$(CU= RDIR)/libxl_x86_acpi.h\" $(TEST_PROG_OBJS) _libxl.api-for-check: CFLAGS +=3D $(CFLAGS_libxentoollog= ) $(CFLAGS_libxentoolcore) -libxl_dom.o libxl_dom.opic: CFLAGS +=3D -I$(XEN_ROOT)/tools # include lib= acpi/x86.h -libxl_x86_acpi.o libxl_x86_acpi.opic: CFLAGS +=3D -I$(XEN_ROOT)/tools +libxl_x86_acpi.o libxl_x86_acpi.opic: CFLAGS +=3D -iquote $(ACPI_PATH) $(SAVE_HELPER_OBJS): CFLAGS +=3D $(CFLAGS_libxenctrl) $(CFLAGS_libxenevtch= n) $(CFLAGS_libxenguest) =20 testidl.o: CFLAGS +=3D $(CFLAGS_libxenctrl) $(CFLAGS_libxenlight) @@ -225,13 +224,12 @@ testidl.o: $(XEN_INCLUDE)/libxl.h # This exploits the 'multi-target pattern rule' trick. # gentypes.py should be executed only once to make all the targets. _libxl_type%.h _libxl_type%_json.h _libxl_type%_private.h _libxl_type%.c: = libxl_type%.idl gentypes.py idl.py - $(eval stem =3D $(notdir $*)) - $(PYTHON) gentypes.py libxl_type$(stem).idl __libxl_type$(stem).h __libxl= _type$(stem)_private.h \ - __libxl_type$(stem)_json.h __libxl_type$(stem).c - $(call move-if-changed,__libxl_type$(stem).h,_libxl_type$(stem).h) - $(call move-if-changed,__libxl_type$(stem)_private.h,_libxl_type$(stem)_p= rivate.h) - $(call move-if-changed,__libxl_type$(stem)_json.h,_libxl_type$(stem)_json= .h) - $(call move-if-changed,__libxl_type$(stem).c,_libxl_type$(stem).c) + $(PYTHON) gentypes.py libxl_type$(*F).idl __libxl_type$(*F).h __libxl_typ= e$(*F)_private.h \ + __libxl_type$(*F)_json.h __libxl_type$(*F).c + $(call move-if-changed,__libxl_type$(*F).h,_libxl_type$(*F).h) + $(call move-if-changed,__libxl_type$(*F)_private.h,_libxl_type$(*F)_priva= te.h) + $(call move-if-changed,__libxl_type$(*F)_json.h,_libxl_type$(*F)_json.h) + $(call move-if-changed,__libxl_type$(*F).c,_libxl_type$(*F).c) =20 .PRECIOUS: _libxl_type%.h _libxl_type%.c =20 diff --git a/tools/libs/light/libxl_x86_acpi.c b/tools/libs/light/libxl_x86= _acpi.c index 57a6b63790..22eb160659 100644 --- a/tools/libs/light/libxl_x86_acpi.c +++ b/tools/libs/light/libxl_x86_acpi.c @@ -16,7 +16,7 @@ #include "libxl_arch.h" #include #include -#include "libacpi/libacpi.h" +#include "libacpi.h" =20 /* Number of pages holding ACPI tables */ #define NUM_ACPI_PAGES 16 --=20 Anthony PERARD From nobody Fri May 17 05:50:20 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=reject dis=none) header.from=citrix.com ARC-Seal: i=1; a=rsa-sha256; t=1674243929; cv=none; d=zohomail.com; s=zohoarc; b=UF0THuX7Wu+UXh/8HYdCTk1Nbatkbj3Ola7jU9Wu0NLi0B0mhuxYU0vKpgBT769605N0zQ+NumgQytIQ7zMAGTEEKOIq9OV+DtvKzDt1HdwvhPJRAk35CDOgBtSt3hAHQeLup4NJrJt4qPTLC1LQccJaG2N4q4V3JZz1poLTuhA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1674243929; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=CKTFpwO7XlGMxoLBQgNCns2kJECiIRrvHdXEOwbQVVo=; b=cDHaDOjuUXaDxqI/KnFUgQXUJrmelHz14hkbqzNkV+JpPArdowJ4dcEdupzyQZOgriwP+Mp5uc9vpVIC0DibFaVIphpjoINDwy6CH3Nqjn72+edU6of3vVi50sv8YQTHY1O0sKlXLFa4+/TNCY3jdfyUepQkcLK4mc/ydMmZpZ8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1674243929815456.225802980508; Fri, 20 Jan 2023 11:45:29 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.482102.747480 (Exim 4.92) (envelope-from ) id 1pIxJq-00083m-R9; Fri, 20 Jan 2023 19:44:58 +0000 Received: by outflank-mailman (output) from mailman id 482102.747480; Fri, 20 Jan 2023 19:44:58 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1pIxJq-00083b-NV; Fri, 20 Jan 2023 19:44:58 +0000 Received: by outflank-mailman (input) for mailman id 482102; Fri, 20 Jan 2023 19:44:57 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1pIxJp-0007So-81 for xen-devel@lists.xenproject.org; Fri, 20 Jan 2023 19:44:57 +0000 Received: from esa6.hc3370-68.iphmx.com (esa6.hc3370-68.iphmx.com [216.71.155.175]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id e99920fc-98fa-11ed-b8d1-410ff93cb8f0; Fri, 20 Jan 2023 20:44:54 +0100 (CET) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: e99920fc-98fa-11ed-b8d1-410ff93cb8f0 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1674243894; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=fh1/fP1mhvs+CCh30pp4CnSP8cqF7mY8PIja6gPahWo=; b=AE+pFJRR2f5GPi3prwKn3GM5537qaFuLSUKfhY6IojnQf03qNZ9UONoH 29iJZexjzXdrd3fTZ6O1J+iE644PgfDFtTOO3lPCu5McpmzrxsqqFW9pJ Z8KzEWBK3BNOiwKKXBUP1Y9d5zJOnJhU6xtxHUGDORZgWoZBh6Nuf7F+I w=; Authentication-Results: esa6.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none X-SBRS: 4.0 X-MesageID: 93020461 X-Ironport-Server: esa6.hc3370-68.iphmx.com X-Remote-IP: 162.221.156.123 X-Policy: $RELAYED IronPort-Data: A9a23:SxzEw6OQwPfn1tDvrR2gl8FynXyQoLVcMsEvi/4bfWQNrUonhGFWn 2AbWmCPPfbcZmT3e9BzYdvg80JTvZ6HxoRrHQto+SlhQUwRpJueD7x1DKtS0wC6dZSfER09v 63yTvGacajYm1eF/k/F3oDJ9CU6jufQA+KmU4YoAwgpLSd8UiAtlBl/rOAwh49skLCRDhiE/ Nj/uKUzAnf8s9JPGj9Suv3rRC9H5qyo42tB5ARmPpingXeF/5UrJMNHTU2OByOQrrl8RoaSW +vFxbelyWLVlz9F5gSNy+uTnuUiG9Y+DCDW4pZkc/HKbitq/0Te5p0TJvsEAXq7vh3S9zxHJ HehgrTrIeshFvWkdO3wyHC0GQkmVUFN0OevzXRSLaV/ZqAJGpfh66wGMa04AWEX0ux8AiZD+ tlCETQiMzre29qr3pOeWsA506zPLOGzVG8eknRpzDWfBvc6W5HTBa7N4Le03h9p2JoIR6yHI ZNEN3w2Nk+ojx5nYz/7DLo3mvuogX/uNSVVsluPqYI84nTJzRw327/oWDbQUo3RHZ8NwhjBz o7A10DoIzsxJO2Y9X2q83aJp9eXlyb2Y41HQdVU8dY12QbOlwT/EiY+RVa95PW0lEO6c9ZeM FAPvDojq7Ao806mRcW7WAe3yFabujYMVtwWFPc1gDxh0YKNvVzfXDJdCGccNpp/7pReqSEWO kGhldjqQjFgleesTV3A3OrIlS6sGA0FBDpXDcMbdjct797mqYA1qxvASNd/DaK45uHI9SHML yOi93Zn2ehK5SIf/+DipA2c3WrwznTcZlRtjjg7SF5J+e+QiGSNQ4WzoWbW4v9bRGpyZgnQ5 SNU8yRyAQ1nMH1sqMBuaL9XdF1M2xpjGGeE6WOD57F7q1yQF4eLJOi8Gg1WKkZzKdojcjT0e kLVsg45zMYNYyfwNv4qOtLtU5xCIU3c+TLNDKi8gj1mO8gZSeN61Hs2OR74M57FziDAbp3Ty b/EKJ3xXB72+IxszSasRvd17FPY7nlW+I8nfriil07P+ePHNBaopUItbAPmghYRsPnV/204M r93a6O39vmoeLSnMnmKqtRPcQtiwLpSLcmelvG7v9WremJOcFzNwdeKqV/9U+SJR5hoq9o= IronPort-HdrOrdr: A9a23:OExSj6lFFYnKjizn/1RoicDHNVfpDfMBiWdD5ihNYBxZY6Wkfp +V7ZMmPE7P+VIssS8b6LW90fG7MAHhHZ4c2/hqAV7QZniShILIFvAg0WKG+Vbd8kLFh5BgPM tbAtBD4ZjLfCtHZKXBkUuF+rQbsai6GcmT7I+urQYKPHhXguNbnndE422gYzBLrXx9dOUE/e 2nl7Z6TlSbCA8qh8KAZghnYwE8nbL2fWndDCLu+yRH1OB1t1mVAUHBfyRwIy1xbxp/hZMZtU TVmQ3w4auu99m91x/nzmfWq7hGhdf7zdNHJcqUzuwYMC/lhAqEbJloH+TqhkFwnMifrHIR1P XcqRYpOMp+r1vXY2GOuBPonyXwzTo07Hfm6FmAxV/uu9bwSj4WA9dIwahZbhzawUw9u8wU6t MP40up875sST/QliX04NbFEztwkFCvnHYkmekPy1RCTIo3ctZq3Moi1XIQNK1FMDPx6YghHu UrJtrb/uxqfVSTaG2clnVzwearQm84En69MxE/U42uomBrdUJCvhElLf8k7yo9HVUGOsV5Dt H/Q/9VfXd1P5ArhOxGdbk8qICMexjwqFr3QRWvyBLcZeY60jv22ujKyaRw6+ewdJMSypwu3J zHTVNDrGY3P1njEMuUwfRwg17wqUiGLHjQI/tlltdEk6y5QKCuPTyISVgoncflq/IDAtfDU/ L2PJ5NGffsIWbnBI4MhmTFKtlvAGhbVNdQtscwWlqIrM6OIor2tvbDePKWILb2Cz4rVm72H3 NGVjnuI8dL6FytRxbD8VnscmKofla68YN7EaDc8eRWwI8RNpdUugxQkli97tHjE0wOjkX3Rj o1HFrKqNLxmYDtxxeA04xAAGsUMnpo X-IronPort-AV: E=Sophos;i="5.97,233,1669093200"; d="scan'208";a="93020461" From: Anthony PERARD To: CC: Anthony PERARD , Wei Liu Subject: [XEN PATCH for-4.17 v6 4/5] tools: Introduce macro $(xenlibs-cflags,) and introduce $(USELIBS) in subdirs Date: Fri, 20 Jan 2023 19:44:30 +0000 Message-ID: <20230120194431.55922-5-anthony.perard@citrix.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230120194431.55922-1-anthony.perard@citrix.com> References: <20230120194431.55922-1-anthony.perard@citrix.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @citrix.com) X-ZM-MESSAGEID: 1674243930550100001 Content-Type: text/plain; charset="utf-8" Introduce $(xenlibs-cflags,) to get the CFLAGS needed to build with the xen library listed as argument. This mainly give the ability to use the same list of xen libs as we can use with the other macro $(xenlibs-ldlibs,). Also, we can avoid listing $(CFLAGS_xeninclude) more than once. We will use $(USELIBS) to list the xen libraries been used by a subdirectory or a binary. Since we usually want the CFLAGS, LDFLAGS and LDLIBS of possibly several xen libs, we don't need to duplicate the list for each flags. This change to use $(USELIBS) is only done in console/ and helpers/ for now as those already use the $(xenlibs-ldlibs,) macro Signed-off-by: Anthony PERARD --- Notes: v6: - new patch tools/console/client/Makefile | 7 ++++--- tools/console/daemon/Makefile | 10 ++++------ tools/helpers/Makefile | 26 +++++++++----------------- tools/Rules.mk | 6 ++++++ 4 files changed, 23 insertions(+), 26 deletions(-) diff --git a/tools/console/client/Makefile b/tools/console/client/Makefile index 62d89fdeb9..071262c9ae 100644 --- a/tools/console/client/Makefile +++ b/tools/console/client/Makefile @@ -1,11 +1,12 @@ XEN_ROOT=3D$(CURDIR)/../../.. include $(XEN_ROOT)/tools/Rules.mk =20 -CFLAGS +=3D $(CFLAGS_libxenctrl) -CFLAGS +=3D $(CFLAGS_libxenstore) +USELIBS :=3D ctrl store + +CFLAGS +=3D $(call xenlibs-cflags,$(USELIBS)) CFLAGS +=3D -include $(XEN_ROOT)/tools/config.h =20 -LDLIBS +=3D $(call xenlibs-ldlibs,ctrl store) +LDLIBS +=3D $(call xenlibs-ldlibs,$(USELIBS)) LDLIBS +=3D $(SOCKET_LIBS) =20 OBJS-y :=3D main.o diff --git a/tools/console/daemon/Makefile b/tools/console/daemon/Makefile index 9fc3b6711f..e53c874eee 100644 --- a/tools/console/daemon/Makefile +++ b/tools/console/daemon/Makefile @@ -1,15 +1,13 @@ XEN_ROOT=3D$(CURDIR)/../../.. include $(XEN_ROOT)/tools/Rules.mk =20 -CFLAGS +=3D $(CFLAGS_libxenctrl) -CFLAGS +=3D $(CFLAGS_libxenstore) -CFLAGS +=3D $(CFLAGS_libxenevtchn) -CFLAGS +=3D $(CFLAGS_libxengnttab) -CFLAGS +=3D $(CFLAGS_libxenforeignmemory) +USELIBS :=3D ctrl store evtchn gnttab foreignmemory + +CFLAGS +=3D $(call xenlibs-cflags,$(USELIBS)) CFLAGS-$(CONFIG_ARM) +=3D -DCONFIG_ARM CFLAGS +=3D -include $(XEN_ROOT)/tools/config.h =20 -LDLIBS +=3D $(call xenlibs-ldlibs,ctrl store evtchn gnttab foreignmemory) +LDLIBS +=3D $(call xenlibs-ldlibs,$(USELIBS)) LDLIBS +=3D $(SOCKET_LIBS) LDLIBS +=3D $(UTIL_LIBS) LDLIBS +=3D -lrt diff --git a/tools/helpers/Makefile b/tools/helpers/Makefile index 09590eb5b6..0d4df01365 100644 --- a/tools/helpers/Makefile +++ b/tools/helpers/Makefile @@ -15,29 +15,21 @@ TARGETS +=3D init-dom0less endif endif =20 +XEN_INIT_DOM0_USELIBS :=3D ctrl toollog store light XEN_INIT_DOM0_OBJS =3D xen-init-dom0.o init-dom-json.o -$(XEN_INIT_DOM0_OBJS): CFLAGS +=3D $(CFLAGS_libxentoollog) -$(XEN_INIT_DOM0_OBJS): CFLAGS +=3D $(CFLAGS_libxenstore) -$(XEN_INIT_DOM0_OBJS): CFLAGS +=3D $(CFLAGS_libxenlight) -$(XEN_INIT_DOM0_OBJS): CFLAGS +=3D $(CFLAGS_libxenctrl) -xen-init-dom0: LDLIBS +=3D $(call xenlibs-ldlibs,ctrl toollog store light) +$(XEN_INIT_DOM0_OBJS): CFLAGS +=3D $(call xenlibs-cflags,$(XEN_INIT_DOM0_U= SELIBS)) +xen-init-dom0: LDLIBS +=3D $(call xenlibs-ldlibs,$(XEN_INIT_DOM0_USELIBS)) =20 +INIT_XENSTORE_DOMAIN_USELIBS :=3D toollog store ctrl guest light INIT_XENSTORE_DOMAIN_OBJS =3D init-xenstore-domain.o init-dom-json.o -$(INIT_XENSTORE_DOMAIN_OBJS): CFLAGS +=3D $(CFLAGS_libxentoollog) -$(INIT_XENSTORE_DOMAIN_OBJS): CFLAGS +=3D $(CFLAGS_libxenguest) -$(INIT_XENSTORE_DOMAIN_OBJS): CFLAGS +=3D $(CFLAGS_libxenctrl) -$(INIT_XENSTORE_DOMAIN_OBJS): CFLAGS +=3D $(CFLAGS_libxenstore) -$(INIT_XENSTORE_DOMAIN_OBJS): CFLAGS +=3D $(CFLAGS_libxenlight) +$(INIT_XENSTORE_DOMAIN_OBJS): CFLAGS +=3D $(call xenlibs-cflags,$(INIT_XEN= STORE_DOMAIN_USELIBS)) $(INIT_XENSTORE_DOMAIN_OBJS): CFLAGS +=3D -include $(XEN_ROOT)/tools/confi= g.h -init-xenstore-domain: LDLIBS +=3D $(call xenlibs-ldlibs,toollog store ctrl= guest light) +init-xenstore-domain: LDLIBS +=3D $(call xenlibs-ldlibs,$(INIT_XENSTORE_DO= MAIN_USELIBS)) =20 +INIT_DOM0LESS_USELIBS :=3D ctrl evtchn toollog store light guest foreignme= mory INIT_DOM0LESS_OBJS =3D init-dom0less.o init-dom-json.o -$(INIT_DOM0LESS_OBJS): CFLAGS +=3D $(CFLAGS_libxentoollog) -$(INIT_DOM0LESS_OBJS): CFLAGS +=3D $(CFLAGS_libxenstore) -$(INIT_DOM0LESS_OBJS): CFLAGS +=3D $(CFLAGS_libxenlight) -$(INIT_DOM0LESS_OBJS): CFLAGS +=3D $(CFLAGS_libxenctrl) -$(INIT_DOM0LESS_OBJS): CFLAGS +=3D $(CFLAGS_libxenevtchn) -init-dom0less: LDLIBS +=3D $(call xenlibs-ldlibs,ctrl evtchn toollog store= light guest foreignmemory) +$(INIT_DOM0LESS_OBJS): CFLAGS +=3D $(call xenlibs-cflags,$(INIT_DOM0LESS_U= SELIBS)) +init-dom0less: LDLIBS +=3D $(call xenlibs-ldlibs,$(INIT_DOM0LESS_USELIBS)) =20 .PHONY: all all: $(TARGETS) diff --git a/tools/Rules.mk b/tools/Rules.mk index 6e135387bd..d7c1f61cdf 100644 --- a/tools/Rules.mk +++ b/tools/Rules.mk @@ -88,6 +88,12 @@ define xenlibs-dependencies $(USELIBS_$(lib)) $(call xenlibs-dependencies,$(USELIBS_$(lib))))) endef =20 +define xenlibs-cflags + $(CFLAGS_xeninclude) \ + $(foreach lib,$(1), \ + $(filter-out $(CFLAGS_xeninclude),$(CFLAGS_libxen$(lib)))) +endef + # Flags for linking recursive dependencies of Xen libraries in $(1) define xenlibs-rpath $(addprefix -Wl$(comma)-rpath-link=3D$(XEN_ROOT)/tools/libs/,$(call xe= nlibs-dependencies,$(1))) --=20 Anthony PERARD From nobody Fri May 17 05:50:20 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=reject dis=none) header.from=citrix.com ARC-Seal: i=1; a=rsa-sha256; t=1674243934; cv=none; d=zohomail.com; s=zohoarc; b=LCfPfOSVMxuivW5doYkbFQoTMI+ZoNfIaj+Uc6LRgx3Z59j2pVFpt2vcsOSWzpelmL7E8rr3qWyO/GT74lApdPWBZiQ+CfIJdryvWQkc5Ldsc3Y6sttw2R0fdpQbc1rDEesemaZBaQc9nIS4fmK3dmqyls6WSni0kkxqR+J8uD8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1674243934; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=dmdfkzAiGcbBz7KhsXWtNn9ZcCauKC3EyODduxCli+o=; b=CWVD5kRzF1vr8HEbUKoqxk9+fp44kdt0zbdmwkCS/FIMWxC8fwhwht7h4gZij03Se8RVV5MQhbSQ4Q4UKb/8ZTRb7XODfH60YLMLG2L7BHfrzJeexoxQ+do8Ud4tx17Hfx9uVIT0pYdRgrOA6VOxKy+pyrrK+UNvYoQDMSGAPNQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1674243934654487.02159490382144; Fri, 20 Jan 2023 11:45:34 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.482110.747490 (Exim 4.92) (envelope-from ) id 1pIxK1-0000Kc-4n; Fri, 20 Jan 2023 19:45:09 +0000 Received: by outflank-mailman (output) from mailman id 482110.747490; Fri, 20 Jan 2023 19:45:09 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1pIxK1-0000KS-1L; Fri, 20 Jan 2023 19:45:09 +0000 Received: by outflank-mailman (input) for mailman id 482110; Fri, 20 Jan 2023 19:45:08 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1pIxK0-0006vE-Ca for xen-devel@lists.xenproject.org; Fri, 20 Jan 2023 19:45:08 +0000 Received: from esa1.hc3370-68.iphmx.com (esa1.hc3370-68.iphmx.com [216.71.145.142]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id efe55da1-98fa-11ed-91b6-6bf2151ebd3b; Fri, 20 Jan 2023 20:45:06 +0100 (CET) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: efe55da1-98fa-11ed-91b6-6bf2151ebd3b DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1674243906; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=czljIDkPlFECumG7RW3BRd1WcvEq3rBtflkOOFMBXuk=; b=L9TkPakuEwcpPhaVlAdEo3F4GCluaY577X5AP4Q4IQoPokZDu/Lqifwy eEbJesvTDEj2jusmIx1VGIbq26ZoxAOJLXOiTrL4B+asXNVM9Xv0lW/wi LotfjsLEUVMkeg5SU+YuyfAFIzHnBaRSR88B5B5vdMnLXPXu6HMFTz1wg w=; Authentication-Results: esa1.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none X-SBRS: 4.0 X-MesageID: 93989459 X-Ironport-Server: esa1.hc3370-68.iphmx.com X-Remote-IP: 162.221.156.123 X-Policy: $RELAYED IronPort-Data: A9a23:ze4jb681pHhkaKnqqM2hDrUDl36TJUtcMsCJ2f8bNWPcYEJGY0x3x 2QfWGiCP/uKYjD8fNx3O9/i9RsEuZfSmtNhTAo9qCo8E34SpcT7XtnIdU2Y0wF+jCHgZBk+s 5hBMImowOQcFCK0SsKFa+C5xZVE/fjUAOG6UKucYHsZqTZMEE8JkQhkl/MynrlmiN24BxLlk d7pqojUNUTNNwRcawr40Ire7kIw1BjOkGlA5AdmPKoT5AS2e0Q9V/rzG4ngdxMUfaEMdgKKb 76r5K20+Grf4yAsBruN+losWhRXKlJ6FVHmZkt+A8BOsDAbzsAB+v9T2M4nQVVWk120c+VZk 72hg3ASpTABZcUgkMxFO/VR/roX0aduoNcrKlDn2SCfItGvn9IBDJyCAWlvVbD09NqbDklup KYSKjMUaiyvqPC65++mYbhz3c8KeZyD0IM34hmMzBncBPciB5vCX7/L9ZlT2zJYasJmRKiEI ZBDMHw2MUqGOkcUUrsUIMtWcOOAj3/jczpeuRSNqLA++WT7xw1tyrn9dtHSf7RmQO0ExRfI9 z6brgwVBDk5C4eC0X2f/kmN2PLtuB28froMRI+Bo6sCbFq7mTVIVUx+uUGAiea9ol6zXZRYM UN80ight68p72SwU8LwGRa/pRasrhMaHtZdDeA+wAWM0bbPpRaUAHAeSTxMY8Bgs9U5LQHGz XfQwYmvX2Y29uTIFzTErOz8QS6O1TY9DT5Yby0HVA85z/bxrKZukzmeUY1oOfvg5jHqIg3Yz zePpSk4orwci88Xyqm2lWz6byKQSovhFVBsuFiONo6xxkYgPdP+OdT0gbTOxawYRLt1WGVtq 5TtdyK2yOkVRa+AmyWWKAnmNOH4vq3VWNEwbLMGInXAy9hO0yT5FWy13N2YDB0xWvvogRezP CfuVfp5vfe/xkeCY65teJ6WAM8316XmHtmNfqmKMYYUOcksLV/bpHkGiausM4bFyhBEfUYXY MfzTCpRJSxCVfQPIMSeGY/xLoPHNghhnDiOFPgXPjys0KaEZW79dFv2GALmUwzN14vd+F+92 48GZ6O3J+B3DLWWjt//rdRCcjjn7BETWfjLliCgXrfaclo7Qzt9V6S5LHFIU9UNopm5X9zgp hmVMnK0AnKk2xUr9S3ihqhfVY7S IronPort-HdrOrdr: A9a23:q5bd6653bndodm+OHQPXweWCI+orL9Y04lQ7vn2ZFiYlFfBwxv re+MjziyWE7Qr5AEtQ6+xpOMG7MAnhHO1OkPws1NaZLUrbUQ6TR72KgrGSvQEIdxeOjtK1kJ 0QAJSWa+eAT2SS7/yKkTVQeuxIqKjkgcbY/Ns2jU0dPT2CAJsQkjuRfzzrbXGeMzM2eabReq DsnfavoQDBCBcqhzqAaUXtpNKvmzQ2rvPbiOQ9bSLPFzPjsdpU0tDHOind+i1bfyJEwL8k/2 SAuwvl5p+7u/X+5g7A23TV55F2nsKk7tdYHsSDhuUcNz2p02+TFcBccozHmApwjPCk6V4snt WJixA8P/5r43eUUnCprQDr0wzA1i9rz3P501eXjVbqvMS8bjMnDMhqg55fb3Limg8dleA59J gO83OStpJRAx+Ftj/6/cL0WxZjkVfxiWY+kMYI5kYvF7c2Wft0l8gy7UlVGJAPEGbR84Y8Ct RjC8na+bJ/bU6aVXbEpWNiqebcB0jbXy32GnTqiPbliQS+r0oJknfwA/ZvwkvowahNEKWsId 60bZiA2os+EPP+JpgNcNvpCfHHfVAlByi8d156aG6XYp0vKjbDrYX6764y4/zvcJsUzIEqkJ CES19As3UuEnieR/Fm8ac7viwlel/NEgjF24Vb/dx0q7f8TL3kPWmKT00vidKpp7EaDtfAU/ i+NZpKC7u7RFGeWbphzkn7Qd1fOHMeWMoatpIyXE+PuNvCLsnvuvbAePjeKbLxGXIvW3/5AH EEQD/vTf8wr3yDSzv9mlzcSnntckvw8dZ5F7Xb5fEazMwXOohFomEu+BmEDwGwWHd/W4ANDQ BDyenc4+qGTEGNjC7101k= X-IronPort-AV: E=Sophos;i="5.97,233,1669093200"; d="scan'208";a="93989459" From: Anthony PERARD To: CC: Anthony PERARD , Wei Liu , "Juergen Gross" Subject: [XEN PATCH for-4.17 v6 5/5] tools: Rework $(xenlibs-ldlibs, ) to provide library flags only. Date: Fri, 20 Jan 2023 19:44:31 +0000 Message-ID: <20230120194431.55922-6-anthony.perard@citrix.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230120194431.55922-1-anthony.perard@citrix.com> References: <20230120194431.55922-1-anthony.perard@citrix.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @citrix.com) X-ZM-MESSAGEID: 1674243936620100001 Content-Type: text/plain; charset="utf-8" LDLIBS is usually only the library flags (that is the `-l` flags), as proposed in GNU make manual, while LDFLAGS would be extra flags such as `-L`. Rework the make macro $(xenlibs-ldlibs, ) to only provide the library flags. $(xenlibs-ldflags, ) already only provide the extra flags like the -rpath-link flags. Also fix "test_%" recipe in libs/light as "libxenlight.so" in $(LDLIBS_libxenlight) is been replaced by "-lxenlight". Instead of just changing the filter, we will start using the $(xenlibs-*,) macro. For LDFLAGS, we only needs the one for libxenlight, as the one for toolcore and toollog are already in $(LDFLAGS), they are dependencies to build libxenlight.so. Signed-off-by: Anthony PERARD Reviewed-by: Juergen Gross --- Notes: v6: - new patch tools/console/client/Makefile | 1 + tools/console/daemon/Makefile | 1 + tools/helpers/Makefile | 3 +++ tools/libs/light/Makefile | 2 +- tools/Rules.mk | 16 +++++++--------- tools/libs/libs.mk | 1 + 6 files changed, 14 insertions(+), 10 deletions(-) diff --git a/tools/console/client/Makefile b/tools/console/client/Makefile index 071262c9ae..ea7819c03e 100644 --- a/tools/console/client/Makefile +++ b/tools/console/client/Makefile @@ -6,6 +6,7 @@ USELIBS :=3D ctrl store CFLAGS +=3D $(call xenlibs-cflags,$(USELIBS)) CFLAGS +=3D -include $(XEN_ROOT)/tools/config.h =20 +LDFLAGS +=3D $(call xenlibs-ldflags,$(USELIBS)) LDLIBS +=3D $(call xenlibs-ldlibs,$(USELIBS)) LDLIBS +=3D $(SOCKET_LIBS) =20 diff --git a/tools/console/daemon/Makefile b/tools/console/daemon/Makefile index e53c874eee..400611fc2d 100644 --- a/tools/console/daemon/Makefile +++ b/tools/console/daemon/Makefile @@ -7,6 +7,7 @@ CFLAGS +=3D $(call xenlibs-cflags,$(USELIBS)) CFLAGS-$(CONFIG_ARM) +=3D -DCONFIG_ARM CFLAGS +=3D -include $(XEN_ROOT)/tools/config.h =20 +LDFLAGS +=3D $(call xenlibs-ldflags,$(USELIBS)) LDLIBS +=3D $(call xenlibs-ldlibs,$(USELIBS)) LDLIBS +=3D $(SOCKET_LIBS) LDLIBS +=3D $(UTIL_LIBS) diff --git a/tools/helpers/Makefile b/tools/helpers/Makefile index 0d4df01365..5db88dc81b 100644 --- a/tools/helpers/Makefile +++ b/tools/helpers/Makefile @@ -18,17 +18,20 @@ endif XEN_INIT_DOM0_USELIBS :=3D ctrl toollog store light XEN_INIT_DOM0_OBJS =3D xen-init-dom0.o init-dom-json.o $(XEN_INIT_DOM0_OBJS): CFLAGS +=3D $(call xenlibs-cflags,$(XEN_INIT_DOM0_U= SELIBS)) +xen-init-dom0: LDFLAGS +=3D $(call xenlibs-ldflags,$(XEN_INIT_DOM0_USELIBS= )) xen-init-dom0: LDLIBS +=3D $(call xenlibs-ldlibs,$(XEN_INIT_DOM0_USELIBS)) =20 INIT_XENSTORE_DOMAIN_USELIBS :=3D toollog store ctrl guest light INIT_XENSTORE_DOMAIN_OBJS =3D init-xenstore-domain.o init-dom-json.o $(INIT_XENSTORE_DOMAIN_OBJS): CFLAGS +=3D $(call xenlibs-cflags,$(INIT_XEN= STORE_DOMAIN_USELIBS)) $(INIT_XENSTORE_DOMAIN_OBJS): CFLAGS +=3D -include $(XEN_ROOT)/tools/confi= g.h +init-xenstore-domain: LDFLAGS +=3D $(call xenlibs-ldflags,$(INIT_XENSTORE_= DOMAIN_USELIBS)) init-xenstore-domain: LDLIBS +=3D $(call xenlibs-ldlibs,$(INIT_XENSTORE_DO= MAIN_USELIBS)) =20 INIT_DOM0LESS_USELIBS :=3D ctrl evtchn toollog store light guest foreignme= mory INIT_DOM0LESS_OBJS =3D init-dom0less.o init-dom-json.o $(INIT_DOM0LESS_OBJS): CFLAGS +=3D $(call xenlibs-cflags,$(INIT_DOM0LESS_U= SELIBS)) +init-dom0less: LDFLAGS +=3D $(call xenlibs-ldflags,$(INIT_DOM0LESS_USELIBS= )) init-dom0less: LDLIBS +=3D $(call xenlibs-ldlibs,$(INIT_DOM0LESS_USELIBS)) =20 .PHONY: all diff --git a/tools/libs/light/Makefile b/tools/libs/light/Makefile index 96daeabc47..273f3d0864 100644 --- a/tools/libs/light/Makefile +++ b/tools/libs/light/Makefile @@ -244,7 +244,7 @@ libxenlight_test.so: $(PIC_OBJS) $(LIBXL_TEST_OBJS) $(CC) $(LDFLAGS) -Wl,$(SONAME_LDFLAG) -Wl,libxenlight.so.$(MAJOR) $(SHLIB= _LDFLAGS) -o $@ $^ $(LDLIBS) $(APPEND_LDFLAGS) =20 test_%: test_%.o test_common.o libxenlight_test.so - $(CC) $(LDFLAGS) -o $@ $^ $(filter-out %libxenlight.so, $(LDLIBS_libxenli= ght)) $(LDLIBS_libxentoollog) $(LDLIBS_libxentoolcore) -lyajl $(APPEND_LDFL= AGS) + $(CC) $(LDFLAGS) $(call xenlibs-ldflags,light) -o $@ $^ $(call xenlibs-ld= libs,toollog toolcore) -lyajl $(APPEND_LDFLAGS) =20 libxl-save-helper: $(SAVE_HELPER_OBJS) libxenlight.so $(CC) $(LDFLAGS) -o $@ $(SAVE_HELPER_OBJS) $(LDLIBS_libxentoollog) $(LDLI= BS_libxenctrl) $(LDLIBS_libxenguest) $(LDLIBS_libxentoolcore) $(APPEND_LDFL= AGS) diff --git a/tools/Rules.mk b/tools/Rules.mk index d7c1f61cdf..007a64f2f5 100644 --- a/tools/Rules.mk +++ b/tools/Rules.mk @@ -105,12 +105,6 @@ define xenlibs-libs $(XEN_ROOT)/tools/libs/$(lib)/lib$(FILENAME_$(lib))$(libextension)) endef =20 -# Flags for linking against all Xen libraries listed in $(1) -define xenlibs-ldlibs - $(call xenlibs-rpath,$(1)) $(call xenlibs-libs,$(1)) \ - $(foreach lib,$(1),$(xenlibs-ldlibs-$(lib))) -endef - # Provide needed flags for linking an in-tree Xen library by an external # project (or when it is necessary to link with "-lxen$(1)" instead of usi= ng # the full path to the library). @@ -119,12 +113,16 @@ define xenlibs-ldflags $(foreach lib,$(1),-L$(XEN_ROOT)/tools/libs/$(lib)) endef =20 +# Flags for linking against all Xen libraries listed in $(1) +define xenlibs-ldlibs + $(foreach lib,$(1),-l$(FILENAME_$(lib)) $(xenlibs-ldlibs-$(lib))) +endef + # Flags for linking against all Xen libraries listed in $(1) but by making= use # of -L and -l instead of providing a path to the shared library. define xenlibs-ldflags-ldlibs $(call xenlibs-ldflags,$(1)) \ - $(foreach lib,$(1), -l$(FILENAME_$(lib))) \ - $(foreach lib,$(1),$(xenlibs-ldlibs-$(lib))) + $(call xenlibs-ldlibs,$(1)) endef =20 define LIB_defs @@ -132,7 +130,7 @@ define LIB_defs XEN_libxen$(1) =3D $$(XEN_ROOT)/tools/libs/$(1) CFLAGS_libxen$(1) =3D $$(CFLAGS_xeninclude) SHLIB_libxen$(1) =3D $$(call xenlibs-rpath,$(1)) -Wl,-rpath-link=3D$$(XEN= _libxen$(1)) - LDLIBS_libxen$(1) =3D $$(call xenlibs-ldlibs,$(1)) + LDLIBS_libxen$(1) =3D $$(call xenlibs-ldflags,$(1)) $$(call xenlibs-ldlib= s,$(1)) endef =20 $(foreach lib,$(LIBS_LIBS),$(eval $(call LIB_defs,$(lib)))) diff --git a/tools/libs/libs.mk b/tools/libs/libs.mk index 0e4b5e0bd0..fc6aa7ede9 100644 --- a/tools/libs/libs.mk +++ b/tools/libs/libs.mk @@ -17,6 +17,7 @@ CFLAGS +=3D -Wmissing-prototypes CFLAGS +=3D $(CFLAGS_xeninclude) CFLAGS +=3D $(foreach lib, $(USELIBS_$(LIBNAME)), $(CFLAGS_libxen$(lib))) =20 +LDFLAGS +=3D $(call xenlibs-ldflags,$(USELIBS_$(LIBNAME))) LDLIBS +=3D $(call xenlibs-ldlibs,$(USELIBS_$(LIBNAME))) =20 PIC_OBJS :=3D $(OBJS-y:.o=3D.opic) --=20 Anthony PERARD