undefined reference to `cnss_get_platform_cap' - android

I am compiling Android Kernel 3.18.
I am getting this error
drivers/built-in.o: In function `enable_extldo':
/home/vinay/customKernel/3.18/kernel_yu_msm8937/drivers/bluetooth/bluetooth-power.c:307: undefined reference to `cnss_get_platform_cap'
/home/vinay/customKernel/3.18/kernel_yu_msm8937/drivers/bluetooth/bluetooth-power.c:307:(.text+0x5c45bc): relocation truncated to fit: R_AARCH64_CALL26 against undefined symbol `cnss_get_platform_cap'
Makefile:951: recipe for target 'vmlinux' failed
make: *** [vmlinux] Error 1
Here is the source code
I am using aarch64-linux-android-4.9 toolchain

I encountered the same problem when I tried to compile a kernel for a MI device.
First you can see the function cnss_get_platform_cap was declared in cnss.h which is located in include/net:
And you open this file you will find this function was declared as a extern one:
So it is only a declaration here, not a implement.
Then we have a dig where the function is, I used find command to find all cnss related driver files and I find this function was implemented in ./net/wireless/cnss/cnss_pci.c
As we can see, the function was here and it will be a exported symbol after compiling.
And you can log your compile process and you will find actually succeed to compile bluetooth-power.c
Just when the makefile link vmlinux it will be a problem. So here we are. I searched the log and I didn't find cnss_pci.c was ever compiled, only cnss_common.c was compiled, let's open the sub-makefile in net/wireless/cnss/
You will find you need to add a item in your defconfig file to compile cnss_pci.c which is 'CONFIG_CNSS_PCI=y'. I add it to my defconfig file in arch/arm64/configs/xxx_defconfig and I solved this.
I just tried to merge a vendor patch into a newer CAF kernel, and there are many many syntax errors even with auto merge.
As for the logic error and bugs, I don't know. A lot of things need to learn.
Hope you find your way out.

Related

Building Android 7 from sources: export_includes and import_includes related error

I encountered the following error when I tried to build Android 7 (QAEP from codeaurora.org):
ninja: error:
'out/target/product/msm8916_64/obj_arm/SHARED_LIBRARIES/
libqct_resampler_intermediates/export_includes', needed by
'out/target/product/msm8916_64/obj_arm/SHARED_LIBRARIES/
libaudioresampler_intermediates/import_in',
missing and no known rule to make it
make: *** [build/core/ninja.mk:149: ninja_wrapper] Error 1
I did a quick find for *qct* and *audioresampler*. The first one returned only a few source files from the vendor wlan driver, but no library (e.g. libqct directory). And the second returned nothing at all.
What does this error mean? Are there missing modules, that are referenced but not included in the manifest?
Any help is appreciated.

Error while compiling libhardware_legacy

Two days ago i read some guides about how to self compile cyanogenmod and i wanted to try on my phone (Galaxy 3 i5800). The phone's CPU architecture is ARMV6 so i downloaded from androidarmv6.github.io the CyanogenMod 10.2 source code and from https://github.com/sdadier/cm10.1_device_samsung_apollo the device folder. At first compilation went pretty good except some "Selected Thumb mode not supported..." errors which i fixed by adding "-marm" CFLAG to involved Android.mk . However now i'm stuck on libhwardware_legacy compilation because i keep getting the error:
target thumb C: libhardware_legacy <= hardware/libhardware_legacy/wifi/wifi.c
hardware/libhardware_legacy/wifi/wifi.c: In function 'update_ctrl_interface':
hardware/libhardware_legacy/wifi/wifi.c:473:5: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
hardware/libhardware_legacy/wifi/wifi.c: In function 'wifi_start_supplicant':
hardware/libhardware_legacy/wifi/wifi.c:835:4: error: expected identifier before 'unsigned'
hardware/libhardware_legacy/wifi/wifi.c:895:20: error: dereferencing pointer to incomplete type
hardware/libhardware_legacy/wifi/wifi.c:912:26: error: dereferencing pointer to incomplete type
I searched on Google what that meant and i found lots of thread about this here on StackOverflow and on some Linux forums but none of them referred to Android, Cyanogen or libhardware_legacy. Is it a problem with my system? There is an error in the code (code here)?
Please give me some suggestion
OK! To fix the issue i removed "const prop_info *pi" and added this instead:
struct prop_info{
unsigned serial;
};
struct prop_info *pi;
but i think that if the system compiles it's not going to boot. However i will try to dump the libhardware_legacy from who compile CM10.1 successfully since the code is the same.
UPDATE: I probably found the main issue. The same error came up again and now there are 7 of them and the problem is that they are in the init so i can't workaround. However i noticed that wifi.c and property_service.c have an header in common sys/_system_properties.h probably the main error is there somewhere. Someone has a solution for this?

mk:1: *** missing separator. android NDK

I am trying to compile some source code but when i run the command
make -f android-9-armv7.mk
I get the following error
android-9-armv7.mk:1: * missing separator. Stop.
This is the contents of the file above:
And I have set the IMAGINE_PATH variable as well, cant seem to figure it out.
link ../imagine/make/shortcut/common-builds/android-9-armv7.mk
Compiling instructions
http://code.google.com/p/emu-ex-plus-alpha/wiki/Compiling
Imagine is locaed at C:/Imagine
I don't know where you've taken the sources, but all the android-9-armv7.mk files from different projects on that git has following content:
../imagine/make/shortcut/common-builds/android-9-armv7.mk
...there is no link keyword, which probably is why you get this error.
Also, please be informed that you're building this on Windows machine while documentation clearly states that it's supported only on Linux and Mac OS X.

Problems with compiling C++ Source for Converting .off Files to XML Readable by Android OpenGL ES

I found a method for importing 3D models to Android's OpenGL on Stackoverflow here:
Is there a way to import a 3D model into Android?
Attempting to follow the instructions I copied the source and tried to compile the program. I got a massive number of errors, here is just a small sample:
/tmp/ccPavSpL.o:OFF-OpenGL_loader.cc:(.text+0xd): undefined reference to `std::basic_string<char,
std::char_traits<char>, std::allocator<char> >::size() const'
I think the problem was I wasn't passing in arguments to the program, so I tried passing arguments like so:
$ gcc OFF-OpenGL_loader.cc circle.off output.xml
(My .off file was in the same directory as the other source files and the output.xml was also in the same file.)
I got these errors
/usr/lib/gcc/i686-pc-cygwin/3.4.4/../../../../i686-pc-cygwin/bin/ld:circle.off: file format not recognized;
treating as linker script
/usr/lib/gcc/i686-pc-cygwin/3.4.4/../../../../i686-pc-cygwin/bin/ld:circle.off:2: syntax error
collect2: ld returned 1 exit status
Anyway so I have a feeling I wasn't supposed to have an output.xml file but when I didn't have one then it gave me a file not found error.
The opensource files were not in actual files so I feel like I should show you all my files and I feel weird uploading someone else's source to a github repo, so here is a rapid share link to the source files:
http://d01.megashares.com/dl/2YylIbE/SourceCodeAnd.offFile.zip
I feel weird sharing files like this^^ but I don't really see any other option. It just contains my .off file and .xml file and the C and C++ files.
Any help would be greatly appreciated, I've spent the past few days stuck on this.
Thanks!
Edit
So I ran it with g++ and with no parameters and these were the results:
$ g++ OFF-OpenGL_loader.cc
/tmp/ccNFneYn.o:OFF-OpenGL_loader.cc:(.text+0x1aa): undefined reference to
`ReadFile::getExtension(char*)'/tmp/ccNFneYn.o:
OFF-OpenGL_loader.cc:(.text+0x2f8): undefined reference to
operator>>(std::basic_ifstream<char, std::
char_traits<char> >&, ReadFile&)'/tmp/ccNFneYn.o:OFF-
OpenGL_loader.cc:(.text+0x6de): undefined reference to `ReadFile::ReadFile()'/tmp/ccNFneYn.o:OFF-
OpenGL_loader.cc:(.text+0x6f9): undefined reference to `ReadFile::~ReadFile()'/usr/lib/gcc/i686-pc-
cygwin/3.4.4/../../../../i686-pc-cygwin/bin/ld:
/tmp/ccNFneYn.o: bad reloc address 0x1c in section
`.gcc_except_table'/usr/lib/gcc/i686-pc-cygwin/3.4.4/.
./../../../i686-pc-cygwin/bin/ld: final link failed:
Invalid operationcollect2: ld returned 1 exit status
What kind of errors am I looking for?
The problem was that when I ran my program in Visual Studio it would both compile and run the program, and because the source required parameters to be run, it would come up with runtime errors.
Then because I didn't know how to pass parameters to programs in visual studio, I tried using Cygwin which gave me errors, probably because it wasn't configured correctly. Not really sure why those errors happened.
So to solve this whole thing I just built my program with Visual Studio, navigated to the .exe file that it creates when it compiles, and then ran that .exe in the command line.
So the moral of the story is: always remember that when you hit that green play button, it both compiles and runs the program. So if your error has to do with the circumstances that you run your program in, you might get errors even if your code is perfectly fine.
Thanks Bo Persson for helping me get that idea!

Android NDK build: File not found Error

Need your guidance, I am writing one app in android with the help of native code which will communicate with CAN (Controller Area Network) port ; for that in my C code i used linux/can.h header file. and i am following "http://mobilepearls.com/labs/ndk-builder-in-eclipse/" this link to build my app. but one i set all thing i got bellow msg in eclipse console box
Compile thumb : can_port <= cansend.c
jni/cansend.c:14:23: fatal error: linux/can.h: No such file or directory
compilation terminated.
make: *** [obj/local/armeabi/objs/can_port/cansend.o] Error 1
One more thing, i am working on windows environment. But i don't think this may be cause.
It is correct that it is not a Windows/Linux problem. The simple problem is that compiler is unable to find the file can.h. Now, for your info, when the compiler starts compiling, it searches for its header files in the folder
C:\(path to NDK folder)\platforms\(android-version)\(arch)\usr\include\linux
Now, if there isn't a can.h there, the compiler will flag an error. So the best way is
Either copy can.h to the above path (not tested)
Modify your Makefile to path to the correct directory where this header file is kept
Hope this helps!

Categories

Resources