net-misc/graftcp: fix QA notice

Signed-off-by: Yuhang Zeng <unlsycn@unlsycn.com>
This commit is contained in:
Yuhang Zeng
2024-04-01 16:30:24 +08:00
parent f2619ed68a
commit 0e71f03fe6
3 changed files with 69 additions and 1 deletions

View File

@@ -0,0 +1,37 @@
From 2c1a891d5e11f0faf49e6a33a566342590ab62df Mon Sep 17 00:00:00 2001
From: "mingang.he" <dustgle@gmail.com>
Date: Thu, 22 Feb 2024 12:09:00 +0000
Subject: [PATCH] Fix parallel build dependency, close #65
This commit corrects the dependency issue in the Makefile which was causing errors during parallel builds. Specifically, it addresses the following changes:
- Separate build rules for local/graftcp-local and local/mgraftcp to individually specify their dependencies and build commands.
- Ensure local/mgraftcp explicitly depends on libgraftcp.a, and build it prior to local/mgraftcp to resolve potential race conditions.
- The local/graftcp-local target does not depend on libgraftcp.a, hence a separate rule is created without this dependency.
These adjustments ensure that each binary is built correctly respecting their precise dependencies, and thus preventing errors that may occur due to incorrect builds when using the -j option for parallel execution in make.
---
Makefile | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/Makefile b/Makefile
index 64d088a..22c46ab 100644
--- a/Makefile
+++ b/Makefile
@@ -67,8 +67,11 @@ libgraftcp.a: graftcp.o util.o cidr-trie.o conf.o
%.o: %.c
$(CC) $(CFLAGS) -c -o $@ $<
-$(GRAFTCP_LOCAL_BIN)::
- $(MAKE) -C local VERSION=$(VERSION) CC=$(CC) CXX=$(CXX) AR=$(AR)
+local/graftcp-local:
+ $(MAKE) -C $(dir $@) VERSION=$(VERSION) CC=$(CC) CXX=$(CXX) AR=$(AR) $(notdir $@)
+
+local/mgraftcp: libgraftcp.a
+ $(MAKE) -C $(dir $@) VERSION=$(VERSION) CC=$(CC) CXX=$(CXX) AR=$(AR) $(notdir $@)
install:: graftcp $(GRAFTCP_LOCAL_BIN)
$(INSTALL) $< $(DESTDIR)$(BINDIR)/$<
--
2.44.0

View File

@@ -0,0 +1,25 @@
From 17e60d1a6e9a1a8ee4e2c6016388a6ee5f1b2284 Mon Sep 17 00:00:00 2001
From: unlsycn <unlsycn@unlsycn.com>
Date: Mon, 1 Apr 2024 16:22:53 +0800
Subject: [PATCH] let graftcp respect LDFLAGS
---
Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Makefile b/Makefile
index 22c46ab..a9a6776 100644
--- a/Makefile
+++ b/Makefile
@@ -59,7 +59,7 @@ all:: $(TARGET)
graftcp: main.o graftcp.o util.o cidr-trie.o conf.o
- $(CC) $^ -o $@
+ $(CC) $^ -o $@ $(LDFLAGS)
libgraftcp.a: graftcp.o util.o cidr-trie.o conf.o
$(AR) rcs $@ $^
--
2.44.0

View File

@@ -33,9 +33,15 @@ PATCHES="
${FILESDIR}/0001-build-not-enabling-service-in-install_systemd.patch
${FILESDIR}/0002-build-no-longer-strip-symbols.patch
${FILESDIR}/0003-version-v0.7.patch
${FILESDIR}/0004-fix-parallel-build-dependency.patch
${FILESDIR}/0005-let-graftcp-respect-LDFLAGS.patch
"
MAKEOPTS="${MAKEOPTS} -j1"
# Generated by nim
QA_FLAGS_IGNORED="
/usr/bin/graftcp-local
/usr/bin/mgraftcp
"
src_prepare() {
default