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

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

Message ID
DKIM signature
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"));
Message ID
<20230203174050.5175-1-contact+sr.ht@hacktivis.me> (view parent)
DKIM signature
Download raw message

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