git: 84f06098ef0a - main - zfs: Use .section .rodata instead of .rodata on FreeBSD

From: Mateusz Guzik <mjg_at_FreeBSD.org>
Date: Mon, 13 Mar 2023 13:50:38 UTC
The branch main has been updated by mjg:

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

commit 84f06098ef0a1c7d3d385e3b5d5f8009e985f6d2
Author:     Dimitry Andric <dimitry@andric.com>
AuthorDate: 2023-02-25 00:45:48 +0000
Commit:     Mateusz Guzik <mjg@FreeBSD.org>
CommitDate: 2023-03-13 13:48:05 +0000

    zfs: Use .section .rodata instead of .rodata on FreeBSD
    
    In commit 0a5b942d4 the FreeBSD SECTION_STATIC macro was set to
    ".rodata". This assembler directive is supported by LLVM (as a
    convenience alias for ".section .rodata") by not by GNU as.
    
    This caused the FreeBSD builds that are done with gcc to fail.
    Therefore, use ".section .rodata" instead, similar to the other
    asm_linkage.h headers.
    
    [mjg: cherry-picked from upstream zfs bf1bec394e715de9f7ac4a54b5b1b884d7e41a32
     to unbreak gcc12 build]
    
    Reviewed-by: Mateusz Guzik <mjguzik@gmail.com>
    Reviewed-by: Attila Fülöp <attila@fueloep.org>
    Reviewed-by: Jorgen Lundman <lundman@lundman.net>
    Signed-off-by: Dimitry Andric <dimitry@andric.com>
    Closes #14526
---
 sys/contrib/openzfs/include/os/freebsd/spl/sys/ia32/asm_linkage.h       | 2 +-
 .../openzfs/lib/libspl/include/os/freebsd/sys/ia32/asm_linkage.h        | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/sys/contrib/openzfs/include/os/freebsd/spl/sys/ia32/asm_linkage.h b/sys/contrib/openzfs/include/os/freebsd/spl/sys/ia32/asm_linkage.h
index 1ebfd8350661..d1f53cf22f41 100644
--- a/sys/contrib/openzfs/include/os/freebsd/spl/sys/ia32/asm_linkage.h
+++ b/sys/contrib/openzfs/include/os/freebsd/spl/sys/ia32/asm_linkage.h
@@ -36,7 +36,7 @@
 #define	ENDBR
 
 #define	SECTION_TEXT .text
-#define	SECTION_STATIC .rodata
+#define	SECTION_STATIC .section .rodata
 
 #ifdef	__cplusplus
 extern "C" {
diff --git a/sys/contrib/openzfs/lib/libspl/include/os/freebsd/sys/ia32/asm_linkage.h b/sys/contrib/openzfs/lib/libspl/include/os/freebsd/sys/ia32/asm_linkage.h
index 08c73037990f..1c4d74423644 100644
--- a/sys/contrib/openzfs/lib/libspl/include/os/freebsd/sys/ia32/asm_linkage.h
+++ b/sys/contrib/openzfs/lib/libspl/include/os/freebsd/sys/ia32/asm_linkage.h
@@ -40,7 +40,7 @@
 #define	ENDBR
 
 #define	SECTION_TEXT .text
-#define	SECTION_STATIC .rodata
+#define	SECTION_STATIC .section .rodata
 
 #ifdef	__cplusplus
 extern "C" {