Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open-Source Kernel Modules Doesn't Link Against LLVM Thin-LTO TKG Kernel(s) #109

Open
ThisNekoGuy opened this issue May 16, 2022 · 5 comments
Labels
upstream wontfix This will not be worked on

Comments

@ThisNekoGuy
Copy link

ThisNekoGuy commented May 16, 2022

Below I've attached a full log of the issue.
nvidia-build.log

Both the kernel and the nvidia-all PKGBUILD are inheriting clang variables from makepkg.conf, for reference these are the set variables:

#-- Compiler and Linker Flags
export CC=clang
export CXX=clang++
export LD="/usr/bin/ld.lld"
export AR="/usr/bin/llvm-ar"
export NM="/usr/bin/llvm-nm"
export AS="/usr/bin/llvm-as"
export RANLIB="/usr/bin/llvm-ranlib"
export STRIP="/usr/bin/llvm-strip"
export OBJCOPY="/usr/bin/llvm-objcopy"

export OBJC=clang

#CPPFLAGS=""
CFLAGS="-march=znver2 -mtune=znver2 -O3 -pipe -fno-plt -minline-all-stringops -fexceptions -Wall \
        -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security \
        -fstack-clash-protection -fcf-protection"
CXXFLAGS="$CFLAGS -Wp,-D_GLIBCXX_ASSERTIONS"
LDFLAGS="-Wl,-O3,--sort-common,--as-needed,-z,relro,-z,now"
LTOFLAGS="-flto=auto"
#-- Debugging flags
## The "-fvar-tracking-assignments" flag is for GCC
DEBUG_CFLAGS="-g"
DEBUG_CXXFLAGS="${DEBUG_CFLAGS}"

Note: Disabling LTO via makepkg makes no difference.

@Tk-Glitch Tk-Glitch added wontfix This will not be worked on upstream labels May 16, 2022
@ptr1337
Copy link
Contributor

ptr1337 commented May 16, 2022

Create a own issue at https://github.com/NVIDIA/open-gpu-kernel-modules and follow their bug report guidelines.
Here also a upstream archlinux issue:
https://bugs.archlinux.org/task/74714?project=1&string=nvidia-open-dkms

@ptr1337
Copy link
Contributor

ptr1337 commented May 19, 2022

You can try to change the thinlto cachedir with the following patch, does work also for 5.17 the patch:
https://github.com/ptr1337/kernel-patches/blob/master/5.18/0001-thinlto-cachdir.patch

This fixes for me the compile of zfs modules with thinlto.

@ThisNekoGuy
Copy link
Author

You can try to change the thinlto cachedir with the following patch, does work also for 5.17 the patch: https://github.com/ptr1337/kernel-patches/blob/master/5.18/0001-thinlto-cachdir.patch

This fixes for me the compile of zfs modules with thinlto.

@ptr1337 I tried this and it made little difference; it seems to progress further(?) but it ultimately fails anyway:
nvidia-open-dkms.log

@ptr1337
Copy link
Contributor

ptr1337 commented May 20, 2022

One thing you ould try removed !buildflags from the pkgbuild and built the complete nvidia-open-dkms with llvm exported in your makepkg.conf and with this patch.

Actually I only have a 1070ti so I can't test it much.

@ThisNekoGuy
Copy link
Author

I've already tried that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
upstream wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

3 participants