From e5d9e9b23151896f6ab4aa7556542f01922490ce Mon Sep 17 00:00:00 2001 From: jca Date: Thu, 14 Sep 2023 16:39:00 +0000 Subject: [PATCH] Instead of ld -dc use ld -d, supported by both ld.bfd and ld.lld >= 15 Upstream LLVM decided to drop the -dc flag and keep its -d alias for some time: https://github.com/llvm/llvm-project/commit/0688b00fc39fe87ec6dd3d37a732d067ff487f16 So this is only a workaround to let us update llvm to a recent release. We'll probably need another fix not so distant future. Another approach would be to just drop -dc from the linker invocation, and use cc -fno-common when building instbin with base-gcc (already the default with base-clang). But this approach needs more testing than I can provide, as deraadt@ feared it would break in subtle ways. ld -d compat alias pointed out by robert@, ok robert@ --- usr.sbin/crunchgen/crunchgen.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/usr.sbin/crunchgen/crunchgen.c b/usr.sbin/crunchgen/crunchgen.c index 1bb6c30f227..b5a859bd4df 100644 --- a/usr.sbin/crunchgen/crunchgen.c +++ b/usr.sbin/crunchgen/crunchgen.c @@ -1,4 +1,4 @@ -/* $OpenBSD: crunchgen.c,v 1.26 2023/04/16 19:57:01 deraadt Exp $ */ +/* $OpenBSD: crunchgen.c,v 1.27 2023/09/14 16:39:00 jca Exp $ */ /* * Copyright (c) 1994 University of Maryland @@ -904,7 +904,7 @@ 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, "LINK=$(LD) -dc -r ${LDFLAGS}\n"); + fprintf(outmk, "LINK=$(LD) -d -r ${LDFLAGS}\n"); fprintf(outmk, "LIBS="); for (l = libdirs; l != NULL; l = l->next) fprintf(outmk, " -L%s", l->str); -- 2.20.1