I'm trying to cross-compile a custom kernel module (from this git),which depends on a plugin that is originally compiled within the git (it's in $git/buildtools/gcc-nexmon-plugin/nexmon.c).
Originally, this tree is intended to be built directly on the raspberry pi, but I would like to port this feature to a buildroot system, that is, I don't have gcc/g++ on my raspberry pi, I only cross-compile on my laptop.
My problem is how to properly create nexmon.so (the plugin file) so I can later use it while cross-compiling
The original command line to produce nexmon.so was:
g++ -std=c++11 -Wall -fno-rtti -fPIC -I../gcc-arm-noneabi[...]/plugin/include \ -c -o nexmon.o nexmon.cg++ -shared -o nexmon.so nexmon.o
As you can see they are including some cross-compiler within the tree ("../gcc-arm..").
Now I understand that the plugin SHOULD NOT be cross-compiled. Remember they want us to run this on the raspberry pi, so "g++" is the embedded "g++". On my side, I have to run "g++" of my laptop.
Unfortunately, I can't seem to get it to work on my laptop, here's what I am trying nowadays:
g++ -std=c++11 -Wall -fno-rtti -fPIC -I/usr/include \ -I/usr/lib/gcc/x86_64-linux-gnu/8/plugin/include -o nexmon.o -c nexmon.c
Because I'm currently using g++ 8.3.0-6, and I located the corresponding headers for plugin development. If I run this, I am getting a TON of problems,
- "in included plugin/include/tree.h file: #error Unknown BITS_PER_UNIT"
- "in included plugin/include/cpplib.h file: #error Cannot find a least 32 bit signed integer type"
Which make me think I am missing some flags to properly define my laptop architecture - but I could be wrong.
Here's a complete PasteBin of my errors: output log
I think I do have stuff to build a plugin, because gcc8/plugin/include exist. I tried to install "gcc-multilib, gcc-8-plugin-dev-i686-linux-gnu, gcc-8-plugin-dev-x86-64-linux-gnux32, gcc-8-plugin-dev". I cannot come back to a previous gcc (like 4.8, 5, 6, 7) because all my debian upgrades removed them, they are not used anymore
Any help would be highly appreciated, no one has been able to help me so far and I ran out of ideas. This point is totally blocking to my project.