From 2ac06985373be209e0ef3fb8b263c89f0d0121fa Mon Sep 17 00:00:00 2001 From: Ed Maste Date: Thu, 9 Jan 2025 20:18:26 -0500 Subject: [PATCH] drm-kmod: Export all symbols We currently rely on the kernel linker's misbehaviour of exporting local symbols from modules, controlled by the debug.link_elf_obj_leak_locals and debug.link_elf_leak_locals sysctls. Explicitly export all symbols (making the current behaviour explicit) as a step to turning off the sysctls by default. A future change should have us export only the desired symbols. Sponsored by: The FreeBSD Foundation --- amd/amdgpu/Makefile | 2 ++ amd/amdkfd/Makefile | 2 ++ dmabuf/Makefile | 2 ++ drm/Makefile | 2 ++ dummygfx/Makefile | 2 ++ i915/Makefile | 2 ++ radeon/Makefile | 2 ++ ttm/Makefile | 2 ++ 8 files changed, 16 insertions(+) diff --git a/amd/amdgpu/Makefile b/amd/amdgpu/Makefile index 23abd367672..7c5c44f9b56 100644 --- a/amd/amdgpu/Makefile +++ b/amd/amdgpu/Makefile @@ -1387,3 +1387,5 @@ CWARNFLAGS.vegam_smumgr.c= -Wno-missing-prototypes # modules/* CWARNFLAGS.freesync.c= -Wno-unused-but-set-variable + +EXPORT_SYMS= yes diff --git a/amd/amdkfd/Makefile b/amd/amdkfd/Makefile index 998f58d0ce5..1868fa9b4bc 100644 --- a/amd/amdkfd/Makefile +++ b/amd/amdkfd/Makefile @@ -71,3 +71,5 @@ CWARNFLAGS.kfd_device_queue_manager.c= -Wno-format -Wno-strict-prototypes -Wno-i CWARNFLAGS.kfd_doorbell.c= -Wno-format CWARNFLAGS.kfd_packet_manager.c= -Wno-format CWARNFLAGS.kfd_queue.c= -Wno-format + +EXPORT_SYMS= yes diff --git a/dmabuf/Makefile b/dmabuf/Makefile index 0d5acd1dd20..958accc69b1 100644 --- a/dmabuf/Makefile +++ b/dmabuf/Makefile @@ -31,4 +31,6 @@ CFLAGS+= ${KCONFIG:C/(.*)/-DCONFIG_\1/} CWARNFLAGS.dma-buf.c+= -Wno-pointer-arith +EXPORT_SYMS= yes + .include diff --git a/drm/Makefile b/drm/Makefile index 3258c2d7b13..63dc1321751 100644 --- a/drm/Makefile +++ b/drm/Makefile @@ -162,4 +162,6 @@ CWARNFLAGS+= -Wno-pointer-sign -Wno-format CWARNFLAGS.drm_ioc32.c+= -Wno-address-of-packed-member +EXPORT_SYMS= yes + .include diff --git a/dummygfx/Makefile b/dummygfx/Makefile index 2f572a6511f..1df9e24dd2c 100644 --- a/dummygfx/Makefile +++ b/dummygfx/Makefile @@ -37,6 +37,8 @@ SRCS += \ pci_if.h \ vnode_if.h +EXPORT_SYMS= yes + .include CWARNFLAGS += -Wno-cast-qual diff --git a/i915/Makefile b/i915/Makefile index a161b827706..0ae64773e95 100644 --- a/i915/Makefile +++ b/i915/Makefile @@ -406,3 +406,5 @@ CWARNFLAGS.i9xx_plane.c= -Wno-unused-but-set-variable CWARNFLAGS.g4x_dp.c= -Wno-shift-count-overflow CWARNFLAGS.skl_universal_plane.c= -Wno-unused-but-set-variable CWARNFLAGS.vlv_dsi.c= -Wno-unused-but-set-variable + +EXPORT_SYMS= yes diff --git a/radeon/Makefile b/radeon/Makefile index 4a8c007a4f6..265e2b236da 100644 --- a/radeon/Makefile +++ b/radeon/Makefile @@ -184,3 +184,5 @@ CWARNFLAGS.trinity_dpm.c= -Wno-unused-const-variable CWARNFLAGS.vce_v1_0.c= -Wno-missing-prototypes -Wno-cast-qual CWARNFLAGS.vce_v2_0.c= -Wno-missing-prototypes CWARNFLAGS.radeon_atpx_handler.c= -Wno-missing-prototypes -Wno-unused-but-set-variable + +EXPORT_SYMS= yes diff --git a/ttm/Makefile b/ttm/Makefile index feb95d0f411..1d30a85366c 100644 --- a/ttm/Makefile +++ b/ttm/Makefile @@ -58,4 +58,6 @@ CWARNFLAGS+=-Wno-cast-qual CWARNFLAGS+= -Wno-pointer-arith -Wno-pointer-sign -Wno-format CWARNFLAGS+= -Wno-expansion-to-defined +EXPORT_SYMS= yes + .include