Objtool: 'call without frame pointer save/setup' errors with pre-compiled blobs on kernel 6.19 with CONFIG_UNWINDER_FRAME_POINTER

  ---             
  Environment

  - Driver version: 580.126.18
  - OS: openSUSE Tumbleweed
  - Kernel: 6.19.3-lowlatency-sunlight1
  - GPU: NVIDIA GeForce RTX 3060 Laptop
  - Architecture: x86_64
  - Installer: nvidia-installer ncurses v6 user interface
  - Relevant kernel config:
  CONFIG_FRAME_POINTER=y
  CONFIG_UNWINDER_FRAME_POINTER=y
  CONFIG_OBJTOOL_WERROR=y
  CONFIG_STACK_VALIDATION=y

  Build errors

  The build fails when objtool validates the composite module objects containing the pre-compiled binary blobs:

  nvidia.o: error: objtool: _nv049762rm+0x44: call without frame pointer save/setup
  nvidia.o: error: objtool: _nv028852rm+0x11: call without frame pointer save/setup
  nvidia.o: error: objtool: _nv000802rm+0x31: call without frame pointer save/setup
  nvidia.o: error: objtool: rm_i2c_transfer.cold+0xd: call without frame pointer save/setup
  nvidia.o: error: objtool: _nv000780rm.cold+0x5: call without frame pointer save/setup
  nvidia.o: error: objtool: rm_i2c_is_smbus_capable.cold+0xb: call without frame pointer save/setup
  nvidia.o: error: objtool: rm_disable_gpu_state_persistence.cold+0xb: call without frame pointer save/setup
  nvidia.o: error: objtool: _nv000847rm+0x9: call without frame pointer save/setup
  nvidia.o: error: objtool: _nv000843rm+0xa: call without frame pointer save/setup
  nvidia.o: error: objtool: _nv049523rm+0x10: call without frame pointer save/setup
  nvidia.o: error: objtool: _nv000762rm+0x27: call without frame pointer save/setup
  nvidia.o: error: objtool: _nv000727rm.cold+0x5: call without frame pointer save/setup
  nvidia.o: error: objtool: _nv000761rm+0x13: call without frame pointer save/setup
  nvidia.o: error: objtool: _nv059423rm+0x26: call without frame pointer save/setup
  nvidia.o: error: objtool: _nv000785rm+0x13: call without frame pointer save/setup
  nvidia.o: error: objtool: _nv000753rm+0x36: call without frame pointer save/setup
  nvidia.o: error: objtool: _nv027631rm+0xf: call without frame pointer save/setup
  nvidia.o: error: objtool: _nv027635rm+0xf: call without frame pointer save/setup
  nvidia.o: error: objtool: _nv027633rm+0xf: call without frame pointer save/setup
  nvidia.o: error: objtool: _nv057281rm+0x13: call without frame pointer save/setup
  nvidia.o: error: objtool: _nv057285rm+0x12: call without frame pointer save/setup
  nvidia.o: error: objtool: _nv057283rm+0xf: call without frame pointer save/setup
  nvidia.o: error: objtool: _nv061279rm+0x2e: call without frame pointer save/setup

  Root cause

  The pre-compiled binary blobs (nv-kernel.o_binary, nv-modeset-kernel.o_binary) shipped with the installer were compiled without -fno-omit-frame-pointer. When the kernel is configured with CONFIG_UNWINDER_FRAME_POINTER=y
  (which forces CONFIG_FRAME_POINTER=y), objtool validates that all functions have proper frame pointer save/setup in their prologues (push %rbp; mov %rsp, %rbp). The proprietary blob functions (_nvXXXXXXrm symbols) use
  compiler-optimized prologues that omit the frame pointer, failing this validation.

  Combined with CONFIG_OBJTOOL_WERROR=y, these warnings become fatal errors and the build fails.

  This is the same class of issue as the previously reported MITIGATION_RETHUNK objtool errors — the pre-compiled blobs do not match the compiler flags expected by the target kernel configuration.

  Note: The driver builds and installs successfully on a default openSUSE Tumbleweed kernel (6.19.2-1-default) which uses CONFIG_UNWINDER_ORC=y instead and does not set CONFIG_OBJTOOL_WERROR.

  Workaround

  Option 1: Switch the kernel to use ORC unwinder instead of frame pointer unwinder:
  CONFIG_UNWINDER_ORC=y
  # CONFIG_UNWINDER_FRAME_POINTER is not set

  Option 2: Disable CONFIG_OBJTOOL_WERROR=n in the kernel config, turning objtool errors into warnings.

  Expected fix

  The nv-kernel.o_binary and nv-modeset-kernel.o_binary blobs should be compiled with -fno-omit-frame-pointer so they pass objtool frame pointer validation on kernels configured with CONFIG_UNWINDER_FRAME_POINTER=y, without
  requiring kernel config workarounds. This is particularly relevant for real-time and low-latency kernel configurations that prefer frame pointer unwinding for more reliable stack traces and debugging.

  ---