~sircmpwn/hare-dev

This thread contains a patchset. You're looking at the original emails, but you may wish to use the patch review UI. Review patch
1

[PATCH hare] cmd/hare: Stick to POSIX ar(1) flags to avoid requiring ARFLAGS

Details
Message ID
<20230203174050.5175-1-contact+sr.ht@hacktivis.me>
DKIM signature
pass
Download raw message
Patch: +4 -10
From: "Haelwenn (lanodan) Monnier" <contact@hacktivis.me>

This also makes ARFLAGS consistent with CFLAGS as being designed for extra user flags.

Tested with GNU Binutils ar(1) and LLVM ar(1).

Signed-off-by: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
---
 cmd/hare/schedule.ha | 14 ++++----------
 1 file changed, 4 insertions(+), 10 deletions(-)

diff --git a/cmd/hare/schedule.ha b/cmd/hare/schedule.ha
index 643a80e9..98fcfc5f 100644
--- a/cmd/hare/schedule.ha
+++ b/cmd/hare/schedule.ha
@@ -165,19 +165,13 @@ fn sched_ar(plan: *plan, output: str, depend: *task...) *task = {
		status = status::SCHEDULED,
		output = output,
		depend = alloc(depend...),
		cmd = getcmd(&ar_tool),
		cmd = getcmd(&ar_tool, "-c", output),
		module = void,
	});

	// If you specify flags in `$ARFLAGS' or a different archiver in `$AR',
	// this assumes that you will pass the correct flags for creating an
	// archive, and will not pass the default `-csr', since `ar' is picky
	// about the order flags are given.
	if (len(task.cmd) == 1 && task.cmd[0] == plan.target.ar_cmd) {
		append(task.cmd, "-csr");
	};

	append(task.cmd, output);
	// POSIX specifies `ar -r [-cuv] <archive> <file>`
	// Add -r here so it is always before any ARFLAGS
	insert(task.cmd[1], "-r");

	for (let i = 0z; i < len(depend); i += 1) {
		assert(strings::hassuffix(depend[i].output, ".o"));
-- 
2.39.1
Details
Message ID
<CS0LLGR3QSXT.374W0MW2J0WHY@taiga>
In-Reply-To
<20230203174050.5175-1-contact+sr.ht@hacktivis.me> (view parent)
DKIM signature
pass
Download raw message
Thanks!

To git@git.sr.ht:~sircmpwn/hare
   4ef0cf5b..5740e481  master -> master
Reply to thread Export thread (mbox)