Jump to content

Compile kext


Allan
 Share

6 posts in this topic

Recommended Posts

Hello guys.

 

There's a way to compile a kext without Xcode?

 

Sorry if my question are dumb.  :P

It is possible.  Install the headers from xnu source and figure out how to link Mach-O kext bundle. 

xcodebuild command line shows these linking argument for clang++  

clang++ -arch x86_64 -mmacosx-version-min=10.12 -stdlib=libc++ -Xlinker -kext -nostdlib -lkmodc++ obj.o  -lkmod -lcc_kext  -o obj.kext/Contents/MacOS/obj

I think libkmod and libcc_kext come from xnu.

 

Actually, there is a kext test in xnu,  any other kext can be built the same way as the test

 

https://github.com/Shaneee92/SierraAMD-XNU/tree/master/tools/tests/testkext

Edited by Allan
  • Like 3
Link to comment
Share on other sites

 Share

×
×
  • Create New...