[DTrace-devel] [PATCH 2/2] drti: do not compile with LTO

Nick Alcock nick.alcock at oracle.com
Thu Jan 16 21:54:18 UTC 2025


drti.o is shipped as object code and can be reused by many compiler
versions: we must not put LTO IR into it.

Signed-off-by: Nick Alcock <nick.alcock at oracle.com>
---
 libdtrace/Build | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/libdtrace/Build b/libdtrace/Build
index 722351591aaea..307d7e8bf6434 100644
--- a/libdtrace/Build
+++ b/libdtrace/Build
@@ -122,6 +122,10 @@ dt_prov_uprobe.c_CFLAGS := -Wno-pedantic
 dt_debug.c_CFLAGS := -Wno-prio-ctor-dtor
 drti.c_CFLAGS := -Wno-prio-ctor-dtor
 
+# drti is shipped as an object file, so do not ever generate
+# LTO for it, since that is compiler-version-specific.
+drti.c_CFLAGS += -fno-lto
+
 SHORTKERNELS := $(foreach kernel,$(KERNELS),$(shell printf %s $(kernel) | sed -e 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*$$/\1.\2.\3/'))
 
 -include libdtrace/$(ARCHINC)/Build
-- 
2.47.1.279.g84c5f4e78e




More information about the DTrace-devel mailing list