From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate001.proxmox.com (gate001.proxmox.com [45.144.208.40]) by lore.proxmox.com (Postfix) with ESMTPS id 163AF1FF0C2 for ; Thu, 22 Oct 2026 16:23:08 +0200 (CEST) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id B4EEA216A9; Thu, 22 Oct 2026 16:23:00 +0200 (CEST) From: Hannes Laimer To: pve-devel@lists.proxmox.com Subject: [PATCH pve-cluster 08/12] buildsys: link pmxcfs against the rust notify staticlib Date: Thu, 22 Oct 2026 16:22:01 +0200 Message-ID: <20261022142205.930536-9-h.laimer@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20261022142205.930536-1-h.laimer@proxmox.com> References: <20261022142205.930536-1-h.laimer@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1792678936300 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.345 Adjusted score from AWL reputation of From: address DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment (newer systems) RCVD_IN_DNSWL_MED -2.3 Sender listed at https://www.dnswl.org/, medium trust SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Message-ID-Hash: A3XKXNUDRYPY4NZBWQZVGCV3LSKCIV56 X-Message-ID-Hash: A3XKXNUDRYPY4NZBWQZVGCV3LSKCIV56 X-MailFrom: h.laimer@proxmox.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox VE development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: The C convenience library calls nothing in the staticlib, so the database tool and the test programs link as before. The pmxcfs Makefile builds the staticlib itself, so a standalone make in src/pmxcfs keeps working. The staticlib's prerequisites come from the dependency file cargo writes, so a changed Rust source rebuilds it. Signed-off-by: Hannes Laimer --- src/pmxcfs/Makefile | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/src/pmxcfs/Makefile b/src/pmxcfs/Makefile index 90bc6a5..e05b4e3 100644 --- a/src/pmxcfs/Makefile +++ b/src/pmxcfs/Makefile @@ -1,3 +1,4 @@ +include ../defines.mk DEPENDENCIES=libcpg libcmap libcorosync_common libquorum libqb glib-2.0 fuse sqlite3 librrd @@ -12,9 +13,18 @@ CFLAGS += -I../rust/pmxcfs-ffi/include LDFLAGS += -Wl,-z,relro $(shell pkg-config --libs $(DEPENDENCIES)) +NOTIFY_LIB := $(abspath ../rust/$(RUST_COMPILE_DIR)/libpmxcfs_ffi.a) +# from `cargo rustc -p pmxcfs-ffi --release -- --print native-static-libs` +NOTIFY_LIBS := -lgcc_s -lutil -lrt -lpthread -lm -ldl -lc + AR = ar ARFLAGS = crs +-include $(NOTIFY_LIB:.a=.d) +# a source file deleted since cargo wrote the dep file has no rule, and make +# would stop before the rebuild that drops it from the list +%.rs: ; + .c.o: $(CC) $(CFLAGS) -c -o $@ $< -MMD -MT $@ -MF $@.d @@ -26,9 +36,14 @@ libpmxcfs.a: cfs-utils.o memdb.o database.o libpmxcfs.a: $(AR) $(ARFLAGS) $@ $^ -pmxcfs: pmxcfs.o libpmxcfs.a - $(CC) -o $@ $^ $(LDFLAGS) +pmxcfs: pmxcfs.o libpmxcfs.a $(NOTIFY_LIB) + $(CC) -o $@ $^ $(LDFLAGS) $(NOTIFY_LIBS) +$(NOTIFY_LIB): ../rust/Cargo.toml ../rust/.cargo/config.toml \ + ../rust/pmxcfs-ffi/Cargo.toml ../rust/pmxcfs-notify/Cargo.toml + $(MAKE) -C ../rust all +.PHONY: notify-lib +notify-lib: $(NOTIFY_LIB) create_pmxcfs_db: create_pmxcfs_db.o libpmxcfs.a $(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS) -- 2.47.3