IOPCIDevice not linked when loading kext - iokit

I am trying to write a driver for a PCI composite video capture card for OSX.
The kext builds just fine, but when I try to load it, I get this:
Diagnostics for /System/Library/Extensions/Conexant878.kext:
Code Signing Failure: code signature is invalid
WARNING - Invalid signature -67030 0xFFFFFFFFFFFEFA2A for kext "/System/Library/Extensions/Conexant878.kext"
(kernel) kxld[com.akasaka.Conexant878]: The following symbols are unresolved for this kext:
(kernel) kxld[com.akasaka.Conexant878]: __ZN11IOPCIDevice22_RESERVEDIOPCIDevice16Ev
(kernel) kxld[com.akasaka.Conexant878]: __ZN11IOPCIDevice22_RESERVEDIOPCIDevice17Ev
(kernel) kxld[com.akasaka.Conexant878]: __ZN11IOPCIDevice22_RESERVEDIOPCIDevice18Ev
(kernel) kxld[com.akasaka.Conexant878]: __ZN11IOPCIDevice22_RESERVEDIOPCIDevice19Ev
(kernel) kxld[com.akasaka.Conexant878]: __ZN11IOPCIDevice22_RESERVEDIOPCIDevice20Ev
(kernel) kxld[com.akasaka.Conexant878]: __ZN11IOPCIDevice22_RESERVEDIOPCIDevice21Ev
(kernel) kxld[com.akasaka.Conexant878]: __ZN11IOPCIDevice24getDeviceMemoryWithIndexEj
(kernel) Can't load kext com.akasaka.Conexant878 - link failed.
(kernel) Failed to load executable for kext com.akasaka.Conexant878.
(kernel) Kext com.akasaka.Conexant878 failed to load (0xdc008016).
(kernel) Failed to load kext com.akasaka.Conexant878 (error 0xdc008016).
Failed to load /System/Library/Extensions/Conexant878.kext - (libkern/kext) link error.
Check library declarations for your kext with kextlibs(8).
The kextlibs output is as follows:
For all architectures:
com.apple.iokit.IOPCIFamily = 2.9
com.apple.kpi.iokit = 13.4
com.apple.kpi.libkern = 13.4
For x86_64:
7 symbols not found in any library kext:
__ZN11IOPCIDevice24getDeviceMemoryWithIndexEj
__ZN11IOPCIDevice22_RESERVEDIOPCIDevice16Ev
__ZN11IOPCIDevice22_RESERVEDIOPCIDevice18Ev
__ZN11IOPCIDevice22_RESERVEDIOPCIDevice20Ev
__ZN11IOPCIDevice22_RESERVEDIOPCIDevice17Ev
__ZN11IOPCIDevice22_RESERVEDIOPCIDevice19Ev
__ZN11IOPCIDevice22_RESERVEDIOPCIDevice21Ev
My Info.plist contains all of the OSBundleLibraries I could think of being necessary in this context, but that is still a no-go:
...
<key>IOClass</key>
<string>ConexantTuner</string>
<key>OSBundleRequired</key>
<string>Local-Root</string>
<key>IOPCIMatch</key>
<string>0x036e109e</string>
<key>IOProviderClass</key>
<string>IOPCIDevice</string>
<key>IOKitPersonalities</key>
<dict/>
<key>OSBundleLibraries</key>
<dict>
<key>com.apple.iokit.IOPCIFamily</key>
<string>1.0.0b1</string>
<key>com.apple.kpi.mach</key>
<string>8.0</string>
<key>com.apple.kpi.unsupported</key>
<string>8.0</string>
<key>com.apple.kpi.iokit</key>
<string>8.0</string>
<key>com.apple.kpi.libkern</key>
<string>8.0</string>
<key>com.apple.kpi.bsd</key>
<string>8.0</string>
</dict>
</dict>
</plist>
What else can I attempt to determine what else I need to depend upon in order to get this to work?
Thanks in advance.
C++Filt output of the unresolved symbols:
IOPCIDevice::getDeviceMemoryWithIndex(unsigned int)
IOPCIDevice::_RESERVEDIOPCIDevice16()
IOPCIDevice::_RESERVEDIOPCIDevice18()
IOPCIDevice::_RESERVEDIOPCIDevice20()
IOPCIDevice::_RESERVEDIOPCIDevice17()
IOPCIDevice::_RESERVEDIOPCIDevice19()
IOPCIDevice::_RESERVEDIOPCIDevice21()

Sounds like a mismatch between the SDK version you are building against and the OS X version you are trying to load your kext on. Unlike OS X userspace, setting the "Deployment Target" to the minimum OS X version supported by your driver is not sufficient. You must also use the OS X SDK version matching the oldest supported OS X version for this very reason of reserved virtual functions.
So e.g. maybe you're building with the 10.10 or 10.11 SDK, but are trying to load the kext on 10.9. That won't work. Use Xcode 6.3.2 (the newest version that ships with the 10.9 SDK), select the 10.9 SDK, and build with that.

Related

I've successfully installed Cuda SDK and tested the compiler with an HelloWorld Then I've opened Nsight but Nsight can not opened

I've successfully installed Cuda SDK and tested the compiler with a HelloWorld. Then I've opened Nsight but Nsight can not opened.
Error that I get:
nsight
OpenJDK 64-Bit Server VM warning: Ignoring option MaxPermSize; support was removed in 8.0
CompileCommand: exclude java/lang/reflect/Array.newInstance
Gtk-Message: 16:52:26.477: Failed to load module "canberra-gtk-module"
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.eclipse.osgi.storage.FrameworkExtensionInstaller (file:/usr/local/cuda-10.2/libnsight/plugins/org.eclipse.osgi_3.10.1.v20140909-1633.jar) to method java.net.URLClassLoader.addURL(java.net.URL)
WARNING: Please consider reporting this to the maintainers of org.eclipse.osgi.storage.FrameworkExtensionInstaller
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
Gtk-Message: 16:52:34.530: Failed to load module "canberra-gtk-module"
I had the same problem and all the posts I found about installing various canberra-gtk-whatever packages didn't fix it. What finally fixed it was to install OpenJdk8 and then start nsight with that vm. Apparently Nvidia requires that exact vm and didn't document it. Typical poor documentation from Nvida.
I also have Oracle JDK 11 installed and only use OpenJdk8 to run insight.

Macdeployqt: ERROR: no file at "/Users/michael/Qt5.3.2/5.3/clang_64/lib/QtQuick.framework/Versions/5/QtQuick"

I recently updated from Qt 5.3 to Qt 5.5. Since the update, I can't seem to get macdeployqt to work properly. When I call it for my application, I get the following output:
Michaels-Mac-mini:Desktop michael$ ~/Qt/5.5/clang_64/bin/macdeployqt FlySightViewer.app
ERROR: Cannot resolve rpath "libvlc-qt.dylib (compatibility version 0.0.0, current version 0.0.0)"
ERROR: using QSet("/Users/michael/Qt/5.5/clang_64/lib")
ERROR: Cannot resolve rpath "libvlc-qt.dylib (compatibility version 0.0.0, current version 0.0.0)"
ERROR: using QSet("/Users/michael/Qt/5.5/clang_64/lib")
ERROR: no file at "/Users/michael/Qt5.3.2/5.3/clang_64/lib/QtQuick.framework/Versions/5/QtQuick"
ERROR: no file at "/Users/michael/Qt5.3.2/5.3/clang_64/lib/QtQml.framework/Versions/5/QtQml"
ERROR: no file at "/Users/michael/Qt5.3.2/5.3/clang_64/lib/QtNetwork.framework/Versions/5/QtNetwork"
ERROR: no file at "/Users/michael/Qt5.3.2/5.3/clang_64/lib/QtGui.framework/Versions/5/QtGui"
ERROR: no file at "/Users/michael/Qt5.3.2/5.3/clang_64/lib/QtCore.framework/Versions/5/QtCore"
ERROR: no file at "/Users/michael/Qt5.3.2/5.3/clang_64/lib/QtWidgets.framework/Versions/5/QtWidgets"
WARNING: Plugin "libqsqlodbc.dylib" uses private API and is not Mac App store compliant.
WARNING: Plugin "libqsqlpsql.dylib" uses private API and is not Mac App store compliant.
ERROR: no file at "/usr/local/lib/libpq.5.dylib"
What catches my attention in particular are the six errors that refer to ~/Qt5.3.2/5.3. This is where the old version of Qt was installed, but the only version I currently have installed is Qt 5.5. It seems like there is some reference in my project/system to the old version, but I have no idea where to look for it. Any help would be greatly appreciated!

xcode static library link error while building for iPhone device

I am using xcode 4.6. The SDK is iOS 6.1. The error I got is "Undefined symbols for architecture armv7" while project linking my own created static library, called "libEncrypt.a".
I am sure I have created the libEncrpt.a using architecture armv7. Using "otool -a" to verify the static library, it displays below message. Don't understand why xcode sill complains the error like "Undefined symbols for architecture armv7"??
> otool -a libEncrypt.a
Archive : libEncrypt.a (architecture armv7)
0100644 505/20 108 1360127518 #1/20
0100644 505/20 3604 1360127513 #1/20
Archive : libEncrypt.a (architecture armv7s)
0100644 505/20 108 1360127518 #1/20
0100644 505/20 3604 1360127513 #1/20
Add the detail error message blow:
Undefined symbols for architecture armv7:
"_OBJC_CLASS_$_libEncrypt", referenced from:
objc-class-ref in LoginViewController.o
objc-class-ref in SignupViewController.o
ld: symbol(s) not found for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Double check your "Build Active Architecture Only" settings in your app and static library projects.
I had this exact same issue because I had "Build Active Architecture Only" set to YES for my static library but not for my iOS app. When the iOS app tried do a Debug build it expected all architectures to exist but only armv7s was being built for the static library because I was deploying to my iPhone 5.

LInker error when switching from windows to console

I am using Qt for GUI and building my project in waf.
For switching to windows subsystem from console(default) i had to pass this argument to the VS linker throught my wscript(waf)
subsystem='windows'
i added this in build part for waf file and I am getting this error
MSVCRT.lib(crtexew.obj) : error LNK2019: unresolved external symbol _WinMain#16 referenced in function ___tmainCRTStartup
C:\cygwin\home\sobingt\project\build\src\View\app.exe : fatal error LNK1120: 1 unresolved externals
I want to run this program as windows not as console.The Code works if i run it as console
subsystem='console'
You need to link against qtmain.lib (IIRC). This provides a shim around winmain which you need for windowed windows apps.

Open CL with AMD

I am trying to implement matrix multiplication usign OpenCL. I have an ATI Radeon HD Radeon 5000 series graphics card.
This is one of the programs i found on the net, but linking errors are coming which i am not able to solve.
I tried running the code mentioned in this site
http://gpgpu-computing4.blogspot.in/2009/10/matrix-multiplication-3-opencl.html
I followed setting up my visual studio project from this site http://www.guineacode.com/2010/linking-and-compiling-opencl/
but the following errors come
error LNK2019: unresolved external symbol _oclLoadProgSource referenced in function _main
error LNK2019: unresolved external symbol _shrLogEx referenced in function "void __cdecl __shrCheckErrorEX(int,int,void (__cdecl*)(int),char const *,int)" (?__shrCheckErrorEX##YAXHHP6AXH#ZPBDH#Z)
Any help would be appreciated
Can you try this ?
Make sure you have the latest Catalyst driver from AMD.
Try downloading AMD APP SDK 2.6 from here : http://developer.amd.com/sdks/AMDAPPSDK/downloads/Pages/default.aspx
After the install, do the following
Make sure to include $(AMDAPPSDKROOT)\include for header files
Library Directory : $(AMDAPPSDKROOT)\lib\x86 or x86_64 depending on your bitness
4.Now you can build and run the program
Here is an older post which talks about linking 2.4... with slight modification you can use the instruction
http://blog.cuvilib.com/2011/07/01/how-to-run-opencl-in-microsoft-vs-2008-using-amd-app-sdk/
If you are looking only MatrixMultiplication sample, AMD APP SDK bundles some samples along with pack you can find them in (Windows)
C:\USERS\%USER%\My Documents\AMD APP\ Samples
and in Linux under
/opt/AMD APP SDK/Samples
HTH

Resources