commit:     b938df58480fa18cda9e6ffd6b0793832d6f04d0
Author:     Mike Pagano <mpagano <AT> gentoo <DOT> org>
AuthorDate: Sat Sep  7 18:10:27 2024 +0000
Commit:     Mike Pagano <mpagano <AT> gentoo <DOT> org>
CommitDate: Sat Sep  7 18:10:27 2024 +0000
URL:        https://gitweb.gentoo.org/proj/linux-patches.git/commit/?id=b938df58

dtrace patch for 6.10.X (CTF, modules.builtin.objs) p3

Signed-off-by: Mike Pagano <mpagano <AT> gentoo.org>

 0000_README                                        |   2 +-
 ...race-6.10_p2.patch => 2995_dtrace-6.10_p3.patch | 126 +++++++++------------
 2 files changed, 56 insertions(+), 72 deletions(-)

diff --git a/0000_README b/0000_README
index 9948b161..574cd30b 100644
--- a/0000_README
+++ b/0000_README
@@ -123,7 +123,7 @@ Patch:  
2990_libbpf-v2-workaround-Wmaybe-uninitialized-false-pos.patch
 From:   https://lore.kernel.org/bpf/
 Desc:   libbpf: workaround -Wmaybe-uninitialized false positive
 
-Patch:  2995_dtrace-6.10_p2.patch
+Patch:  2995_dtrace-6.10_p3.patch
 From:   https://github.com/thesamesam/linux/tree/dtrace-sam/v2/6.10
 Desc:   dtrace patch for 6.10.X (CTF, modules.builtin.objs)
 

diff --git a/2995_dtrace-6.10_p2.patch b/2995_dtrace-6.10_p3.patch
similarity index 96%
rename from 2995_dtrace-6.10_p2.patch
rename to 2995_dtrace-6.10_p3.patch
index 3686ca5b..775a7868 100644
--- a/2995_dtrace-6.10_p2.patch
+++ b/2995_dtrace-6.10_p3.patch
@@ -115,87 +115,78 @@ index 2e5ac6ab3d476..635896f269f1f 100644
                -o -name '*.dtb.S' -o -name '*.dtbo.S' \
                -o -name '*.dt.yaml' -o -name 'dtbs-list' \
 diff --git a/arch/arm/vdso/Makefile b/arch/arm/vdso/Makefile
-index 01067a2bc43b7..6464089596088 100644
+index 01067a2bc43b7..d2193b8dfad83 100644
 --- a/arch/arm/vdso/Makefile
 +++ b/arch/arm/vdso/Makefile
-@@ -14,6 +14,12 @@ obj-vdso := $(addprefix $(obj)/, $(obj-vdso))
+@@ -14,6 +14,10 @@ obj-vdso := $(addprefix $(obj)/, $(obj-vdso))
  ccflags-y := -fPIC -fno-common -fno-builtin -fno-stack-protector
  ccflags-y += -DDISABLE_BRANCH_PROFILING -DBUILD_VDSO32
  
-+ifdef CONFIG_CTF
-+  # CTF in the vDSO would introduce a new section, which would
-+  # expand the vDSO to more than a page.
-+  ccflags-y += $(call cc-option,-gctf0)
-+endif
++# CTF in the vDSO would introduce a new section, which would
++# expand the vDSO to more than a page.
++ccflags-y += $(call cc-option,-gctf0)
 +
  ldflags-$(CONFIG_CPU_ENDIAN_BE8) := --be8
  ldflags-y := -Bsymbolic --no-undefined -soname=linux-vdso.so.1 \
            -z max-page-size=4096 -shared $(ldflags-y) \
 diff --git a/arch/arm64/kernel/vdso/Makefile b/arch/arm64/kernel/vdso/Makefile
-index d63930c828397..9ef2050690653 100644
+index d63930c828397..6e84d3822cfe3 100644
 --- a/arch/arm64/kernel/vdso/Makefile
 +++ b/arch/arm64/kernel/vdso/Makefile
-@@ -33,6 +33,12 @@ ldflags-y += -T
+@@ -33,6 +33,10 @@ ldflags-y += -T
  ccflags-y := -fno-common -fno-builtin -fno-stack-protector -ffixed-x18
  ccflags-y += -DDISABLE_BRANCH_PROFILING -DBUILD_VDSO
  
-+ifdef CONFIG_CTF
-+  # CTF in the vDSO would introduce a new section, which would
-+  # expand the vDSO to more than a page.
-+  ccflags-y += $(call cc-option,-gctf0)
-+endif
++# CTF in the vDSO would introduce a new section, which would
++# expand the vDSO to more than a page.
++ccflags-y += $(call cc-option,-gctf0)
 +
  # -Wmissing-prototypes and -Wmissing-declarations are removed from
  # the CFLAGS of vgettimeofday.c to make possible to build the
  # kernel with CONFIG_WERROR enabled.
 diff --git a/arch/loongarch/vdso/Makefile b/arch/loongarch/vdso/Makefile
-index d724d46b07c84..95ef763218f7b 100644
+index d724d46b07c84..fbedb95223ae1 100644
 --- a/arch/loongarch/vdso/Makefile
 +++ b/arch/loongarch/vdso/Makefile
-@@ -22,6 +22,11 @@ cflags-vdso := $(ccflags-vdso) \
+@@ -21,7 +21,8 @@ cflags-vdso := $(ccflags-vdso) \
+       -O2 -g -fno-strict-aliasing -fno-common -fno-builtin \
        -fno-stack-protector -fno-jump-tables -DDISABLE_BRANCH_PROFILING \
        $(call cc-option, -fno-asynchronous-unwind-tables) \
-       $(call cc-option, -fno-stack-protector)
-+
-+ifdef CONFIG_CTF
-+  cflags-vdso += $(call cc-option,-gctf0)
-+endif
-+
+-      $(call cc-option, -fno-stack-protector)
++      $(call cc-option, -fno-stack-protector) \
++      $(call cc-option,-gctf0)
  aflags-vdso := $(ccflags-vdso) \
        -D__ASSEMBLY__ -Wa,-gdwarf-2
  
 diff --git a/arch/mips/vdso/Makefile b/arch/mips/vdso/Makefile
-index b289b2c1b2946..6b5603f3b6a2d 100644
+index b289b2c1b2946..6c8d777525f9b 100644
 --- a/arch/mips/vdso/Makefile
 +++ b/arch/mips/vdso/Makefile
-@@ -34,6 +34,10 @@ cflags-vdso := $(ccflags-vdso) \
+@@ -30,7 +30,8 @@ cflags-vdso := $(ccflags-vdso) \
+       -O3 -g -fPIC -fno-strict-aliasing -fno-common -fno-builtin -G 0 \
+       -mrelax-pic-calls $(call cc-option, -mexplicit-relocs) \
+       -fno-stack-protector -fno-jump-tables -DDISABLE_BRANCH_PROFILING \
+-      $(call cc-option, -fno-asynchronous-unwind-tables)
++      $(call cc-option, -fno-asynchronous-unwind-tables) \
++      $(call cc-option,-gctf0)
  aflags-vdso := $(ccflags-vdso) \
        -D__ASSEMBLY__ -Wa,-gdwarf-2
  
-+ifdef CONFIG_CTF
-+cflags-vdso += $(call cc-option,-gctf0)
-+endif
-+
- ifneq ($(c-gettimeofday-y),)
- CFLAGS_vgettimeofday.o = -include $(c-gettimeofday-y)
- 
 diff --git a/arch/sparc/vdso/Makefile b/arch/sparc/vdso/Makefile
-index 243dbfc4609d8..432422fc3febb 100644
+index 243dbfc4609d8..e4f3e47074e9d 100644
 --- a/arch/sparc/vdso/Makefile
 +++ b/arch/sparc/vdso/Makefile
-@@ -46,6 +46,10 @@ CFL := $(PROFILING) -mcmodel=medlow -fPIC -O2 
-fasynchronous-unwind-tables -m64
+@@ -44,7 +44,7 @@ $(obj)/vdso-image-%.c: $(obj)/vdso%.so.dbg $(obj)/vdso%.so 
$(obj)/vdso2c FORCE
+ CFL := $(PROFILING) -mcmodel=medlow -fPIC -O2 -fasynchronous-unwind-tables 
-m64 \
+        $(filter -g%,$(KBUILD_CFLAGS)) -fno-stack-protector \
         -fno-omit-frame-pointer -foptimize-sibling-calls \
-        -DDISABLE_BRANCH_PROFILING -DBUILD_VDSO
+-       -DDISABLE_BRANCH_PROFILING -DBUILD_VDSO
++       $(call cc-option,-gctf0) -DDISABLE_BRANCH_PROFILING -DBUILD_VDSO
  
-+ifdef CONFIG_CTF
-+CFL += $(call cc-option,-gctf0)
-+endif
-+
  SPARC_REG_CFLAGS = -ffixed-g4 -ffixed-g5 -fcall-used-g5 -fcall-used-g7
  
- $(vobjs): KBUILD_CFLAGS := $(filter-out $(RANDSTRUCT_CFLAGS) 
$(GCC_PLUGINS_CFLAGS) $(SPARC_REG_CFLAGS),$(KBUILD_CFLAGS)) $(CFL)
 diff --git a/arch/x86/entry/vdso/Makefile b/arch/x86/entry/vdso/Makefile
-index 215a1b202a918..ffb33a1a7315b 100644
+index 215a1b202a918..2fa1613a06275 100644
 --- a/arch/x86/entry/vdso/Makefile
 +++ b/arch/x86/entry/vdso/Makefile
 @@ -54,6 +54,7 @@ $(obj)/vdso-image-%.c: $(obj)/vdso%.so.dbg $(obj)/vdso%.so 
$(obj)/vdso2c FORCE
@@ -206,31 +197,27 @@ index 215a1b202a918..ffb33a1a7315b 100644
         -DDISABLE_BRANCH_PROFILING -DBUILD_VDSO
  
  ifdef CONFIG_MITIGATION_RETPOLINE
-@@ -131,6 +132,9 @@ KBUILD_CFLAGS_32 += -m32 -msoft-float -mregparm=0 -fpic
+@@ -131,6 +132,7 @@ KBUILD_CFLAGS_32 += -m32 -msoft-float -mregparm=0 -fpic
  KBUILD_CFLAGS_32 += -fno-stack-protector
  KBUILD_CFLAGS_32 += $(call cc-option, -foptimize-sibling-calls)
  KBUILD_CFLAGS_32 += -fno-omit-frame-pointer
-+ifdef CONFIG_CTF
-+  KBUILD_CFLAGS_32 += $(call cc-option,-gctf0)
-+endif
++KBUILD_CFLAGS_32 += $(call cc-option,-gctf0)
  KBUILD_CFLAGS_32 += -DDISABLE_BRANCH_PROFILING
  
  ifdef CONFIG_MITIGATION_RETPOLINE
 diff --git a/arch/x86/um/vdso/Makefile b/arch/x86/um/vdso/Makefile
-index 6a77ea6434ffd..d99a60494286a 100644
+index 6a77ea6434ffd..6db233b5edd75 100644
 --- a/arch/x86/um/vdso/Makefile
 +++ b/arch/x86/um/vdso/Makefile
-@@ -42,6 +42,10 @@ CFL := $(PROFILING) -mcmodel=small -fPIC -O2 
-fasynchronous-unwind-tables -m64 \
+@@ -40,7 +40,7 @@ $(obj)/%.so: $(obj)/%.so.dbg FORCE
+ #
+ CFL := $(PROFILING) -mcmodel=small -fPIC -O2 -fasynchronous-unwind-tables 
-m64 \
         $(filter -g%,$(KBUILD_CFLAGS)) -fno-stack-protector \
-        -fno-omit-frame-pointer -foptimize-sibling-calls
+-       -fno-omit-frame-pointer -foptimize-sibling-calls
++       -fno-omit-frame-pointer -foptimize-sibling-calls $(call 
cc-option,-gctf0)
  
-+if CONFIG_CTF
-+CFL += $(call cc-option,-gctf0)
-+endif
-+
  $(vobjs): KBUILD_CFLAGS += $(CFL)
  
- #
 diff --git a/include/asm-generic/vmlinux.lds.h 
b/include/asm-generic/vmlinux.lds.h
 index f00a8e18f389f..2e307c0824574 100644
 --- a/include/asm-generic/vmlinux.lds.h
@@ -244,17 +231,21 @@ index f00a8e18f389f..2e307c0824574 100644
        *(.gnu.version*)                                                \
  
 diff --git a/include/linux/module.h b/include/linux/module.h
-index 330ffb59efe51..ec828908470c9 100644
+index 330ffb59efe51..2d9fcca542d13 100644
 --- a/include/linux/module.h
 +++ b/include/linux/module.h
-@@ -180,7 +180,9 @@ extern void cleanup_module(void);
+@@ -180,7 +180,13 @@ extern void cleanup_module(void);
  #ifdef MODULE
  #define MODULE_FILE
  #else
 -#define MODULE_FILE   MODULE_INFO(file, KBUILD_MODFILE);
++#ifdef CONFIG_CTF
 +#define MODULE_FILE                                                         \
 +                      MODULE_INFO(file, KBUILD_MODFILE);                    \
 +                      MODULE_INFO(objs, KBUILD_MODOBJS);
++#else
++#define MODULE_FILE MODULE_INFO(file, KBUILD_MODFILE);
++#endif
  #endif
  
  /*
@@ -322,14 +313,6 @@ index 59b6765d86b8f..dab7e6983eace 100644
  config DEBUG_FORCE_WEAK_PER_CPU
        bool "Force weak per-cpu definitions"
        depends on DEBUG_KERNEL
-diff --git a/scripts/.gitignore b/scripts/.gitignore
-index 3dbb8bb2457bc..11339fa922abd 100644
---- a/scripts/.gitignore
-+++ b/scripts/.gitignore
-@@ -11,3 +11,4 @@
- /sorttable
- /target.json
- /unifdef
 +y!/Makefile.ctf
 diff --git a/scripts/Makefile b/scripts/Makefile
 index fe56eeef09dd4..8e7eb174d3154 100644
@@ -502,7 +485,7 @@ index 0000000000000..210bef3854e9b
 +
 +endif
 diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
-index 7f8ec77bf35c9..97b0ea2eee9d4 100644
+index 7f8ec77bf35c9..8e67961ba2ec9 100644
 --- a/scripts/Makefile.lib
 +++ b/scripts/Makefile.lib
 @@ -118,6 +118,8 @@ modname-multi = $(sort $(foreach m,$(multi-obj-ym),\
@@ -514,17 +497,18 @@ index 7f8ec77bf35c9..97b0ea2eee9d4 100644
  modfile = $(addprefix $(obj)/,$(__modname))
  
  # target with $(obj)/ and its suffix stripped
-@@ -131,7 +133,8 @@ name-fix = $(call stringify,$(call name-fix-token,$1))
- basename_flags = -DKBUILD_BASENAME=$(call name-fix,$(basetarget))
- modname_flags  = -DKBUILD_MODNAME=$(call name-fix,$(modname)) \
+@@ -133,6 +135,10 @@ modname_flags  = -DKBUILD_MODNAME=$(call 
name-fix,$(modname)) \
                 -D__KBUILD_MODNAME=kmod_$(call name-fix-token,$(modname))
--modfile_flags  = -DKBUILD_MODFILE=$(call stringify,$(modfile))
-+modfile_flags  = -DKBUILD_MODFILE=$(call stringify,$(modfile)) \
-+                 -DKBUILD_MODOBJS=$(call stringify,$(modfile).o:$(subst 
$(space),|,$(modname-objs-prefixed)))
+ modfile_flags  = -DKBUILD_MODFILE=$(call stringify,$(modfile))
  
++ifdef CONFIG_CTF
++modfile_flags  += -DKBUILD_MODOBJS=$(call stringify,$(modfile).o:$(subst 
$(space),|,$(modname-objs-prefixed)))
++endif
++
  _c_flags       = $(filter-out $(CFLAGS_REMOVE_$(target-stem).o), \
                       $(filter-out $(ccflags-remove-y), \
-@@ -238,7 +241,7 @@ modkern_rustflags =                                        
      \
+                          $(KBUILD_CPPFLAGS) $(KBUILD_CFLAGS) $(ccflags-y)) \
+@@ -238,7 +244,7 @@ modkern_rustflags =                                        
      \
  
  modkern_aflags = $(if $(part-of-module),                              \
                        $(KBUILD_AFLAGS_MODULE) $(AFLAGS_MODULE),       \
@@ -533,7 +517,7 @@ index 7f8ec77bf35c9..97b0ea2eee9d4 100644
  
  c_flags        = -Wp,-MMD,$(depfile) $(NOSTDINC_FLAGS) $(LINUXINCLUDE)     \
                 -include $(srctree)/include/linux/compiler_types.h       \
-@@ -248,7 +251,7 @@ c_flags        = -Wp,-MMD,$(depfile) $(NOSTDINC_FLAGS) 
$(LINUXINCLUDE)     \
+@@ -248,7 +254,7 @@ c_flags        = -Wp,-MMD,$(depfile) $(NOSTDINC_FLAGS) 
$(LINUXINCLUDE)     \
  rust_flags     = $(_rust_flags) $(modkern_rustflags) 
@$(objtree)/include/generated/rustc_cfg
  
  a_flags        = -Wp,-MMD,$(depfile) $(NOSTDINC_FLAGS) $(LINUXINCLUDE)     \

Reply via email to