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

0.43 doesn't build with clang-13 #41

Open
riesebie opened this issue Nov 20, 2021 · 4 comments
Open

0.43 doesn't build with clang-13 #41

riesebie opened this issue Nov 20, 2021 · 4 comments

Comments

@riesebie
Copy link

Is it possible to build tp-smapi with clang? I am running a clang built kernel 5.15.3. tp-smapi build fails with:

DKMS make.log for tp_smapi-0.43 for kernel 5.15.3-galadriel-lxtec-amd64 (x86_64)
2021-11-20T16:46:57 CET
make: Entering directory '/usr/src/linux-5.15.3'
   CC [M]  /var/lib/dkms/tp_smapi/0.43/build/thinkpad_ec.o                                                                                                                                                                                   
   LTO [M] /var/lib/dkms/tp_smapi/0.43/build/thinkpad_ec.lto.o                                                                                                                                                                               
   CC [M]  /var/lib/dkms/tp_smapi/0.43/build/tp_smapi.o
/var/lib/dkms/tp_smapi/0.43/build/tp_smapi.c:202:14: error: invalid use of a cast in a inline asm context requiring an lvalue: remove the cast or build with -fheinous-gnu-extensions                                                       
                           "m"((u16)smapi_port)                                                                                                                                                                                               
                               ~~~~~^~~~~~~~~~                                                                                                                                                                                                
  1 error generated.                                                                                                                                                                                                                          
  make[1]: *** [scripts/Makefile.build:277: /var/lib/dkms/tp_smapi/0.43/build/tp_smapi.o] Error 1                                                                                                                                             
  make: *** [Makefile:1871: /var/lib/dkms/tp_smapi/0.43/build] Error 2                                                                                                                                                                        
  make: Leaving directory '/usr/src/linux-5.15.3'

Same is with 5.14.20

@evgeni
Copy link
Member

evgeni commented Nov 20, 2021

Given it doesn't build for you, I guess the answer is no? ;)

Never tried to use LLVM to compile it, and given the age of the code, I doubt it will be trivial to fix.

@evgeni
Copy link
Member

evgeni commented Nov 20, 2021

On the other hand, that cast really seems unnecessary here, smapi_port is an unsigned short which is the same as u16?!

@riesebie
Copy link
Author

Well, I would test a possible fix on a clang and a gcc compiled kernel. But I don't have skils to adapt a fix myself.

evgeni added a commit that referenced this issue Aug 6, 2023
the generated assembly looks identical with and without the cast on
GCC-13

Fixes: #41
@evgeni
Copy link
Member

evgeni commented Aug 6, 2023

I posted an untested (well, it compiles 🤷‍♀️) patch in #55 - mind testing it?

hmtheboy154 pushed a commit to android-generic/tp_smapi that referenced this issue Dec 11, 2023
the generated assembly looks identical with and without the cast on
GCC-13

Fixes: linux-thinkpad#41
evgeni added a commit that referenced this issue May 20, 2024
the generated assembly looks identical with and without the cast on
GCC-13

Fixes: #41
evgeni added a commit that referenced this issue May 20, 2024
the generated assembly looks identical with and without the cast on
GCC-13

Fixes: #41
evgeni added a commit that referenced this issue May 20, 2024
the generated assembly looks identical with and without the cast on
GCC-13

Fixes: #41
evgeni added a commit that referenced this issue May 20, 2024
the generated assembly looks identical with and without the cast on
GCC-13

Fixes: #41
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