Jump to content
Sign in to follow this  
Followers 0

Compile kext

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



Edited by Allan

Share this post

Link to post
Share on other sites

Hmm good to know.


Thanks buddy  ;)

That test uses xcode.  But linking options extracted about should work.

You need to supply the correct -I and -L to make it actually work.

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  
Followers 0

  • Recently Browsing   0 members

    No registered users viewing this page.