git: acb474c084b8 - main - kboot: Centralize ldscript addition

From: Warner Losh <imp_at_FreeBSD.org>
Date: Sun, 25 Feb 2024 00:58:28 UTC
The branch main has been updated by imp:

URL: https://cgit.FreeBSD.org/src/commit/?id=acb474c084b8e3b7bb738a286f9218f926a15823

commit acb474c084b8e3b7bb738a286f9218f926a15823
Author:     Warner Losh <imp@FreeBSD.org>
AuthorDate: 2024-02-25 00:56:23 +0000
Commit:     Warner Losh <imp@FreeBSD.org>
CommitDate: 2024-02-25 00:56:23 +0000

    kboot: Centralize ldscript addition
    
    Make the pattern for ldscripts always be
    arch/$MACHINE_ARCH/$MACHINE_ARCH.ldscript so we can add it from a
    central Makefile. This also moves from ldscript.arch to arch.ldscript to
    match the loader's new convention.
    
    Sponsored by:           Netflix
    Reviewed by:            tsoome, kevans
    Differential Revision:  https://reviews.freebsd.org/D44057
---
 stand/kboot/kboot/Makefile                                             | 3 +++
 stand/kboot/kboot/arch/aarch64/Makefile.inc                            | 2 --
 stand/kboot/kboot/arch/aarch64/{ldscript.aarch64 => aarch64.ldscript}  | 0
 stand/kboot/kboot/arch/amd64/Makefile.inc                              | 2 --
 stand/kboot/kboot/arch/amd64/{ldscript.amd64 => amd64.ldscript}        | 0
 stand/kboot/kboot/arch/powerpc64/Makefile.inc                          | 2 --
 .../kboot/arch/powerpc64/{ldscript.powerpc => powerpc64.ldscript}      | 0
 7 files changed, 3 insertions(+), 6 deletions(-)

diff --git a/stand/kboot/kboot/Makefile b/stand/kboot/kboot/Makefile
index b571c3acada1..c6cb47fbbba2 100644
--- a/stand/kboot/kboot/Makefile
+++ b/stand/kboot/kboot/Makefile
@@ -51,6 +51,9 @@ HELP_FILENAME=	loader.help.kboot
 .PATH:	${.CURDIR}/arch/${MACHINE_ARCH}
 .include "${.CURDIR}/arch/${MACHINE_ARCH}/Makefile.inc"
 
+# Bring in our ldscript
+LDFLAGS=	-nostdlib -static -T ${.CURDIR}/arch/${MACHINE_ARCH}/${MACHINE_ARCH}.ldscript
+
 # Always add MI sources
 .include	"${BOOTSRC}/loader.mk"
 CFLAGS+=	-I${.CURDIR} -I${.CURDIR}/arch/${MACHINE_ARCH}
diff --git a/stand/kboot/kboot/arch/aarch64/Makefile.inc b/stand/kboot/kboot/arch/aarch64/Makefile.inc
index 744a15f363d3..3e856f5322b3 100644
--- a/stand/kboot/kboot/arch/aarch64/Makefile.inc
+++ b/stand/kboot/kboot/arch/aarch64/Makefile.inc
@@ -8,5 +8,3 @@ CFLAGS+=	-I${SYSDIR}/contrib/dev/acpica/include
 # load address. set in linker script
 RELOC?=		0x0
 CFLAGS+=	-DRELOC=${RELOC}
-
-LDFLAGS=	-nostdlib -static -T ${.CURDIR}/arch/${MACHINE_ARCH}/ldscript.${MACHINE_ARCH}
diff --git a/stand/kboot/kboot/arch/aarch64/ldscript.aarch64 b/stand/kboot/kboot/arch/aarch64/aarch64.ldscript
similarity index 100%
rename from stand/kboot/kboot/arch/aarch64/ldscript.aarch64
rename to stand/kboot/kboot/arch/aarch64/aarch64.ldscript
diff --git a/stand/kboot/kboot/arch/amd64/Makefile.inc b/stand/kboot/kboot/arch/amd64/Makefile.inc
index 55b1819ccdee..edb8a1de0bba 100644
--- a/stand/kboot/kboot/arch/amd64/Makefile.inc
+++ b/stand/kboot/kboot/arch/amd64/Makefile.inc
@@ -1,5 +1,3 @@
 SRCS+=		amd64_tramp.S elf64_freebsd.c load_addr.c fdt_arch.c
 
 CFLAGS+=	-I${SYSDIR}/contrib/dev/acpica/include
-
-LDFLAGS=	-nostdlib -static -T ${.CURDIR}/arch/${MACHINE_ARCH}/ldscript.amd64
diff --git a/stand/kboot/kboot/arch/amd64/ldscript.amd64 b/stand/kboot/kboot/arch/amd64/amd64.ldscript
similarity index 100%
rename from stand/kboot/kboot/arch/amd64/ldscript.amd64
rename to stand/kboot/kboot/arch/amd64/amd64.ldscript
diff --git a/stand/kboot/kboot/arch/powerpc64/Makefile.inc b/stand/kboot/kboot/arch/powerpc64/Makefile.inc
index 338d1222ab65..11a67a93d9e0 100644
--- a/stand/kboot/kboot/arch/powerpc64/Makefile.inc
+++ b/stand/kboot/kboot/arch/powerpc64/Makefile.inc
@@ -2,6 +2,4 @@ CFLAGS+=	-mcpu=powerpc64
 
 SRCS+=		ppc64_elf_freebsd.c kerneltramp.S load_addr.c fdt_arch.c
 
-LDFLAGS=	-nostdlib -static -T ${.CURDIR}/arch/${MACHINE_ARCH}/ldscript.powerpc
-
 MK_PIE=		no
diff --git a/stand/kboot/kboot/arch/powerpc64/ldscript.powerpc b/stand/kboot/kboot/arch/powerpc64/powerpc64.ldscript
similarity index 100%
rename from stand/kboot/kboot/arch/powerpc64/ldscript.powerpc
rename to stand/kboot/kboot/arch/powerpc64/powerpc64.ldscript