git: f7144a9c4a11 - main - sdt: Use the "cc" operand modifier for the address of probes for GCC 15+

From: John Baldwin <jhb_at_FreeBSD.org>
Date: Mon, 02 Feb 2026 17:20:02 UTC
The branch main has been updated by jhb:

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

commit f7144a9c4a11214a71a3091ce1b232a8243b83ea
Author:     John Baldwin <jhb@FreeBSD.org>
AuthorDate: 2026-02-02 17:19:51 +0000
Commit:     John Baldwin <jhb@FreeBSD.org>
CommitDate: 2026-02-02 17:19:51 +0000

    sdt: Use the "cc" operand modifier for the address of probes for GCC 15+
    
    This is required for GCC on RISC-V.  The GCC 15 docs claim that "cc" is
    similar to "c" except that it "tries harder".
    
    NB: I have not yet found a way to make the DTrace probes compile on
    RISC-V with older versions of GCC.
    
    Reviewed by:    markj
    Differential Revision:  https://reviews.freebsd.org/D54964
---
 sys/sys/sdt.h | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/sys/sys/sdt.h b/sys/sys/sdt.h
index f705be915684..0be4e9ba6240 100644
--- a/sys/sys/sdt.h
+++ b/sys/sys/sdt.h
@@ -194,8 +194,12 @@ SET_DECLARE(sdt_argtypes_set, struct sdt_argtype);
 #define	_SDT_ASM_PROBE_CONSTRAINT	"i"
 #endif
 #ifndef	_SDT_ASM_PROBE_OPERAND
+#if !defined(__clang__) && __GNUC_PREREQ__(15, 0)
+#define	_SDT_ASM_PROBE_OPERAND		"cc"
+#else
 #define	_SDT_ASM_PROBE_OPERAND		"c"
 #endif
+#endif
 
 /*
  * The asm below generates records corresponding to the structure's layout, so