Xcode 6.1 error with error "Apple LLVM 6.0 error: the compiler does not support" fapple-kext ""

Creating a kext USB driver for our xcode 6.1 USB device with build settings. Architecture = universal (32/64-bit Intel) and base SDK = 10.8, build failure with an error,

clang: error: the clang compiler does not support 'fapple-kext' for C++ on Darwin/i386
Command /Applications/Xcode 2.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang failed with exit code 1

The same project will be successfully created if I select "Build Active Architecture only = Yes", but in this case the kextload error failed with subsequent errors on 10.8 OSX, but it worked on 10.9 OSX

Dec 19 17:36:22 localhost com.apple.kextd[16]: Failed to load /System/Library/Extensions/gdmuwm.kext - (libkern/kext) link error.
Dec 19 17:36:22 localhost kernel[0]: kxld[com.gct.driver.gdmuwm]: The super class vtable '__ZTV12IOUserClient' for vtable '__ZTV13GdmUserClient' is out of date. Make sure your kext has been built against the correct headers.
Dec 19 17:36:22 localhost kernel[0]: kxld[com.gct.driver.gdmuwm]: The super class vtable '__ZTV19IOEthernetInterface' for vtable '__ZTV5gdmif' is out of date. Make sure your kext has been built against the correct headers.
Dec 19 17:36:22 localhost kernel[0]: kxld[com.gct.driver.gdmuwm]: The super class vtable '__ZTV20IOEthernetController' for vtable '__ZTV6gdmuwm' is out of date. Make sure your kext has been built against the correct headers.
Dec 19 17:36:22 localhost kernel[0]: Can't load kext com.gct.driver.gdmuwm - link failed.
Dec 19 17:36:22 localhost kernel[0]: Failed to load executable for kext com.gct.driver.gdmuwm.
Dec 19 17:36:22 localhost kernel[0]: Kext com.gct.driver.gdmuwm failed to load (0xdc008016).
Dec 19 17:36:22 localhost kernel[0]: Failed to load kext com.gct.driver.gdmuwm (error 0xdc008016).

Please help me resolve this driver link error.

+4
source share
1 answer

OS X, clang/Xcode. clang kexts i386. , Xcode 32- kexts 4.6.3. ( Apple). , 32- kexts, 2 kext , OS X <= 10,7 >= 10,9. kext Xcode 4.6.3 Xcode 6.x.

/ OS X SDK. , , I/O kexts OS X SDK 10.y OS X 10.z, z < . , 10.8, SDK 10.8 ( ). , SDK, kext ( , 10.7 ) kext, , kext, kext , . , Xcode, - SDK.

OS X:

  • Kext 1: <= 10,7 ( , ), kext 2 >= 10,8 (, 64-)
  • Kext 1: <= 10.8 ( , ), kext 2 >= 10.9 (, 64-)

, 2 kext, .

, C, ++ .

2018 , , > 3 :

32- kexts . - OS X Xcode 4.6.3. , kexts , , , . , CI, , --.

, , macOS. Xcode 4 , 32- kexts.

bash :

VERBOSE=1
export XCODE463APP=`mdfind 'kMDItemCFBundleIdentifier = "com.apple.dt.Xcode" && kMDItemVersion = "4.6.3"' | head -n 1`
DARWIN_MAJOR=`uname -r | sed -E 's/^([0-9]+)\..*$/\1/'`


if [ -e "./build-tools/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang" ] && [ -e "./build-tools/Developer/usr/llvm-gcc-4.2/bin/llvm-gcc-4.2" ] ; then
    if (( $VERBOSE )); then
        echo 32-bit kext compiler appears to be in place
    fi
else
    echo "Setting up 32-bit kext compiler toolchain"
    mkdir -p "./build-tools/Developer/Toolchains"
    mkdir -p "./build-tools/Developer/usr/"
    cp -r "$XCODE463APP/Contents/Developer/Toolchains/XcodeDefault.xctoolchain" "./build-tools/Developer/Toolchains/"
    cp -r "$XCODE463APP/Contents/Developer/usr/llvm-gcc-4.2" "./build-tools/Developer/usr/"
fi

if [ -h "./build-tools/Developer/usr/llvm-gcc-4.2/libexec/gcc/i686-apple-darwin${DARWIN_MAJOR}" ] || [ -e "./build-tools/Developer/usr/llvm-gcc-4.2/libexec/gcc/i686-apple-darwin${DARWIN_MAJOR}" ] ; then
    if (( $VERBOSE )); then
        echo "32-bit kext compiler Darwin-version-specific stuff appears to be set up"
    fi
else
    echo "Setting up 32-bit kext compiler Darwin version specific symlink"
    ln -s "i686-apple-darwin11" "./build-tools/Developer/usr/llvm-gcc-4.2/libexec/gcc/i686-apple-darwin${DARWIN_MAJOR}"
fi

32- Xcode 4.6.3 , macOS (Darwin) , , , . Xcode 4.6.3 10.9 10.10, , , , . , 32- kext 10.6 SDK 10.11 10.12.

, , llvm-gcc , , , .

+4

Source: https://habr.com/ru/post/1568595/


All Articles