On Fri, Dec 30 2022, Miod Vallat <[email protected]> wrote:
> You need this extra chunk for your diff to work. With that, the built
> instbin binary appears to behave as expected on hppa.

Heh, nice, thank you.

I'm not sure which way to go: either sprinkle some -fno-common between
crunchgen and distrib/special/Makefile.inc, or drop -dc on lld archs
only.  What would you folks prefer?


commit 548e9fc8c0cf82bccbd91ce2d0b7af7ae12a3207
Author: jca <[email protected]>
Date:   Fri Dec 30 08:01:56 2022 +0100

    crunchgen: stop using ld -dc on lld archs (dropped in lld 15)

diff --git a/usr.sbin/crunchgen/crunchgen.c b/usr.sbin/crunchgen/crunchgen.c
index 4526290197e..7136c1d19c9 100644
--- a/usr.sbin/crunchgen/crunchgen.c
+++ b/usr.sbin/crunchgen/crunchgen.c
@@ -898,7 +898,11 @@ top_makefile_rules(FILE * outmk)
        fprintf(outmk, "CFLAGS+=-fno-asynchronous-unwind-tables\n");
        fprintf(outmk, "LDFLAGS+=$(NOPIE_LDFLAGS)\n");
        fprintf(outmk, "STRIP?=strip\n");
+       fprintf(outmk, ".if ${LINKER_VERSION} == \"lld\"\n");
+       fprintf(outmk, "LINK=$(LD) -r ${LDFLAGS}\n");
+       fprintf(outmk, ".else\n");
        fprintf(outmk, "LINK=$(LD) -dc -r ${LDFLAGS}\n");
+       fprintf(outmk, ".endif\n");
        fprintf(outmk, "LIBS=");
        for (l = libdirs; l != NULL; l = l->next)
                fprintf(outmk, " -L%s", l->str);


-- 
jca | PGP : 0x1524E7EE / 5135 92C1 AD36 5293 2BDF  DDCC 0DFA 74AE 1524 E7EE

Reply via email to