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

KERNEL_CC=clang CC=clang make #59

Open
dreirund opened this issue Sep 15, 2024 · 1 comment
Open

KERNEL_CC=clang CC=clang make #59

dreirund opened this issue Sep 15, 2024 · 1 comment

Comments

@dreirund
Copy link

dreirund commented Sep 15, 2024

Ahoj,

build for clang-build Linux 6.10.10 fails for me -- make system is trying to use gcc.

I try build as follows:

git clone https://github.com/freemed/tty0tty.git
cd tty0tty/module
CC=clang make

KERNEL_CC=clang CC=clang make fails with

make -C /lib/modules/6.10.10-xanmod-customconfig-clang/build M=/tmp/tty0tty/module modules
make[1]: Entering directory '/usr/lib/modules/6.10.10-xanmod-customconfig-clang/build'
warning: the compiler differs from the one used to build the kernel
  The kernel was built by: clang version 18.1.8
  You are using:           gcc (GCC) 14.2.1 20240910
  CC [M]  /tmp/tty0tty/module/tty0tty.o
gcc: error: unrecognized argument to ‘-fsanitize=’ option: ‘kcfi’
gcc: error: unrecognized command-line option ‘-mretpoline-external-thunk’
make[3]: *** [scripts/Makefile.build:244: /tmp/tty0tty/module/tty0tty.o] Error 1
make[2]: *** [/usr/lib/modules/6.10.10-xanmod-customconfig-clang/build/Makefile:2080: /tmp/tty0tty/module] Error 2
make[1]: *** [Makefile:240: __sub-make] Error 2
make[1]: Leaving directory '/usr/lib/modules/6.10.10-xanmod-customconfig-clang/build'
make: *** [Makefile:26: default] Error 2

The kernel is built with clang, but this seems to be ignored.

git describe --tags of the cloned tty0tty source shows 1.2-59-gac540b8, i.e. at commit ac540b8.


Edit: With dkms, it works, though.

Regards!

@dreirund dreirund changed the title CC=clang make uses gcc instead of clang for clang-built kernel. Build fails with warning: the compiler differs from the one used to build the kernel and gcc: error: unrecognized argument to ‘-fsanitize=’ option: ‘kcfi’ and gcc: error: unrecognized command-line option ‘-mretpoline-external-thunk’. KERNEL_CC=clang CC=clang make uses gcc instead of clang for clang-built kernel. Build fails with warning: the compiler differs from the one used to build the kernel and gcc: error: unrecognized argument to ‘-fsanitize=’ option: ‘kcfi’ and gcc: error: unrecognized command-line option ‘-mretpoline-external-thunk’. Sep 15, 2024
@stappersg stappersg changed the title KERNEL_CC=clang CC=clang make uses gcc instead of clang for clang-built kernel. Build fails with warning: the compiler differs from the one used to build the kernel and gcc: error: unrecognized argument to ‘-fsanitize=’ option: ‘kcfi’ and gcc: error: unrecognized command-line option ‘-mretpoline-external-thunk’. KERNEL_CC=clang CC=clang make Sep 15, 2024
@stappersg
Copy link
Collaborator

patches welcome

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants