Update Raspbian image?
The default Raspbian image that is present has grown rather old, especially with regard to repositories underlying it. There needs to be an automated mechanism for updating the image.
Do you mean the sysroot that is pulled in from https://github.com/sdhibit/docker-rpi-raspbian ? I believe that image gets built on a raspberry pi, so might be tricky to build in docker.
I've added an apt-get upgrade step to the Dockerfile to upgrade the raspbian packages.
Does that do what you need @aeppert ?
That certainly helps.
Has there been a change in the sysroot though for installing gcc, etc for raspbian? I noticed rpdo, which seems to call the appropriate gcc if I do "rpxc rpdo gcc", however otherwise the sysroot seems to be wrong?
When you say "raspbian image", are you referring to the cross-compile toolchain?
ie. this https://github.com/raspberrypi/tools/tree/master/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64
Correct. I want to be able to use the raspbian cross-compiler toolchain that was installed via "install-raspbian gcc" when I built a new image based on your example.
On Wed, Nov 23, 2016 at 5:18 PM, Stephen Thirlwall <[email protected]
wrote:
When you say "raspbian image", are you referring to the cross-compile toolchain?
ie. this https://github.com/raspberrypi/tools/tree/master/ arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/sdt/docker-raspberry-pi-cross-compiler/issues/21#issuecomment-262643777, or mute the thread https://github.com/notifications/unsubscribe-auth/AAE6UgNv1KGAFJCYNyFANMPgZpN4ZCEeks5rBLuvgaJpZM4K285n .
I made a bunch of changes a while back to make rpxc work properly with full-blown autotools/configure/make projects. I've just realised that's made doing simple things less simple.
If you're just trying to cross-compile some of your own code, here's an example.
- Save this as hw.c
#include <stdio.h>
int main() {
printf("Hello, world!\n");
return 0;
}
-
Compile this with:
rpxc arm-linux-gnueabihf-gcc -o hw hw.c -
Copy hw to your raspberry pi and run it.
This uses the x64-native cross compiler. The install-raspbian command is more intended for installing somelib-dev type packages as build-time dependencies.
You could also create a Makefile like below and then just run rpxc make
CC=${CROSS_COMPILE}gcc
hw: hw.c
$(CC) -o hw hw.c
Ah perfect. So I was on the right path, but wanted to make sure I wasn't over complicating things myself.
On Nov 23, 2016, at 5:53 PM, Stephen Thirlwall [email protected] wrote:
I made a bunch of changes a while back to make rpxc work properly with full-blown autotools/configure/make projects. I've just realised that's made doing simple things less simple.
If you're just trying to cross-compile some of your own code, here's an example.
Save this as hw.c #include <stdio.h> int main() { printf("Hello, world!\n"); return 0; } Compile this with: rpxc arm-linux-gnueabihf-gcc -o hw hw.c
Copy hw to your raspberry pi and run it.
This uses the x64-native cross compiler. The install-raspbian command is more intended for installing somelib-dev type packages as build-time dependencies.
You could also create a Makefile like below and then just run rpxc make
CC=${CROSS_COMPILE}gcc hw: hw.c $(CC) -o hw hw.c — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.
One more note - have you generated Raspbian Debian packages via this docker image and the inclusive raspbian image?
On Nov 23, 2016, at 5:53 PM, Stephen Thirlwall [email protected] wrote:
I made a bunch of changes a while back to make rpxc work properly with full-blown autotools/configure/make projects. I've just realised that's made doing simple things less simple.
If you're just trying to cross-compile some of your own code, here's an example.
Save this as hw.c #include <stdio.h> int main() { printf("Hello, world!\n"); return 0; } Compile this with: rpxc arm-linux-gnueabihf-gcc -o hw hw.c
Copy hw to your raspberry pi and run it.
This uses the x64-native cross compiler. The install-raspbian command is more intended for installing somelib-dev type packages as build-time dependencies.
You could also create a Makefile like below and then just run rpxc make
CC=${CROSS_COMPILE}gcc hw: hw.c $(CC) -o hw hw.c — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.
I haven't.
Cross-compiler is working appropriately. However, I am failing, painfully, to get the newly built image with the requisite Raspbian libraries for what I am trying to build (I modified the rpxc script to point to my new Docker image too). How do I point the cross-compiler to the sysroot inside the docker image? Failing that, I will just have to build them freestanding, which brings me 180degrees back to the way I use to build cross-compilers anyway.
Could you make a gist or something of what you're trying to do?
Just getting back to this after months on another project. Do you have an example exercising the Raspbian packages installed? I absolutely need to link against those and have a host of them installed, including libpcap, as a definitive example I need to link against. My final binary will be hosted on Raspbian and I will end up putting together a .deb for it all.
Both the axel and qtbase examples link against raspbian packages.
https://github.com/sdt/docker-raspberry-pi-cross-compiler/blob/master/example/axel/Dockerfile https://github.com/sdt/docker-raspberry-pi-cross-compiler/blob/master/example/qtbase/Dockerfile
Do you have a repo or gist or something I could look at?