git: 88ec6ce7d159 - stable/14 - loader/efi: Use unique linker set for lua

From: Warner Losh <imp_at_FreeBSD.org>
Date: Tue, 16 Apr 2024 20:13:20 UTC
The branch stable/14 has been updated by imp:

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

commit 88ec6ce7d15915d53f68b9930b7f2cbb791d227f
Author:     Warner Losh <imp@FreeBSD.org>
AuthorDate: 2024-02-25 00:57:13 +0000
Commit:     Warner Losh <imp@FreeBSD.org>
CommitDate: 2024-04-16 19:54:27 +0000

    loader/efi: Use unique linker set for lua
    
    After the linker set cleanup in ldscripts, there's now only one place we
    need to know the linkerset name, so go ahead and change the lua
    interpreter augmentation linker set to be uniquely named.
    
    Sponsored by:           Netflix
    Reviewed by:            tsoome, kevans
    Differential Revision:  https://reviews.freebsd.org/D44062
    
    (cherry picked from commit b4e85f760b6b77d276747c9beb6191bfb864e0c2)
---
 stand/efi/loader/Makefile | 2 +-
 stand/liblua/lutils.h     | 7 ++++---
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/stand/efi/loader/Makefile b/stand/efi/loader/Makefile
index 2031400814e9..bb95b6480646 100644
--- a/stand/efi/loader/Makefile
+++ b/stand/efi/loader/Makefile
@@ -117,7 +117,7 @@ ${LOADER}.efi: ${PROG}
 	${OBJCOPY} -j .peheader -j .text -j .sdata -j .data \
 		-j .dynamic -j .dynsym -j .rel.dyn \
 		-j .rela.dyn -j .reloc -j .eh_frame -j set_Xcommand_set \
-		-j set_Xficl_compile_set \
+		-j set_Xficl_compile_set -j set_Xlua_compile_set \
 		--output-target=${EFI_TARGET} ${.ALLSRC} ${.TARGET}
 
 LIBEFI=		${BOOTOBJ}/efi/libefi/libefi.a
diff --git a/stand/liblua/lutils.h b/stand/liblua/lutils.h
index 522abfd3d0d4..ea715096df09 100644
--- a/stand/liblua/lutils.h
+++ b/stand/liblua/lutils.h
@@ -34,8 +34,9 @@ int	luaopen_pager(lua_State *);
 #include <sys/linker_set.h>
 
 typedef void lua_init_md_t(lua_State *);
+#define _LUA_COMPIE_SET Xlua_compile_set
 #define LUA_COMPILE_SET(func)	\
-	DATA_SET(Xficl_compile_set, func)	/* XXX linker set know by ldscrips */
+	DATA_SET(_LUA_COMPILE_SET, func)
 #define LUA_FOREACH_SET(s) \
-	SET_FOREACH((s), Xficl_compile_set)
-SET_DECLARE(Xficl_compile_set, lua_init_md_t);
+	SET_FOREACH((s), _LUA_COMPILE_SET)
+SET_DECLARE(_LUA_COMPILE_SET, lua_init_md_t);