I have some source files that previously have been compiled for X86 architecture. Now I need to compile them for ARM architecture. When I try to use something like
g++ -c -x c++ foo.h
gcc -c -x c foo.h
it only gives me few instructions. I believe it doesn't link my header file to other included files. I only get "Disassembly of section .comment:". Please note it does prompt me for other files, for example if foo includes foo1.h and foo2.h, if I don't include foo1 and foo2 headers in the same directory the compiler doesn't work.
Another thing which I don't understand is that both gcc and g++ produce the same assembly code, maybe because they only generate the comment section they look the same.
A little bit more details about my problem: I'm using a USB-I2C converter board. The board provides only support for x86/x64 architecture. I managed to access the source file and to get the driver setup. Now I need to test everything together. In order to do so I need to be able to compile a sample code. When I want to do so, it calls on static libraries that need to be in .a extension. I need to create my own library.a file. In order to do so, I have found the source c files (.h header). Now I need to link them together during compilation and make object files, and eventually archive them together in a .a file. Thank you for your help.
Edit (update):
A quick summary of what I have achieved so far: - I was able to find a driver from a github repo. - I was able to make the module - I also compiled a new fresh kernel from a raspbian source code (I'm doing this for a Raspberry PI3):
uname -a
Linux raspberrypi 4.9.35-v7+ #1 SMP Tue Jul 4 22:40:25 BST 2017 armv7l GNU/Linux
I was able to load the module properly:
lsmod Module Size Used by spi_diolan_u2c 3247 0 i2c_diolan_u2c 3373 0 diolan_u2c_core 4268 2 i2c_diolan_u2c,spi_diolan_u2c
lsusb Bus 001 Device 010: ID a257:2014
dmesg [ 126.758990] i2c_diolan_u2c: loading out-of-tree module taints kernel. [ 126.759241] i2c_diolan_u2c: Unknown symbol diolan_u2c_transfer (err 0) [ 130.651475] i2c_diolan_u2c: Unknown symbol diolan_u2c_transfer (err 0) [ 154.671532] usbcore: registered new interface driver diolan-u2c-core [ 5915.799739] usb 1-1.2: USB disconnect, device number 4 [10591.295014] usb 1-1.2: new full-speed USB device number 6 using dwc_otg [10591.425984] usb 1-1.2: New USB device found, idVendor=a257, idProduct=2014 [10591.425997] usb 1-1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=0 [10591.426005] usb 1-1.2: Product: Diolan DLN1 [10591.426012] usb 1-1.2: Manufacturer: Diolan
What I'm not sure: If the kernel space is properly mapped to physical hardware (if the loaded module can get ahold of my diolan-board)!!! progress: based on my research, I think a hot-plug protocol would take care of that, but not sure! confusion: why the lsusb still only shows the device ID. I know the manufacturer and kernel driver can determine what info to be shown, but only showing ID doesn't seem right to me
What I want to do now: I would like to write a simple c source or python code to interact with my device. Basically I don't know how I can make connection between user space and kernel space. The manufacturer has provided some source code examples, libraries, etc. . However, I have given up on using them because they are for another architecture , based on qt, and I find it near impossible to find replacement for libraries they use in their static libraries ( I figured those libraries by restoring their .a archived file provided for x86)
I just need to know exactly what the next step should be for me to move on towards getting the board working with the PI. Thank you :)