raspberrypi / tools

1.89k stars 865 forks source link

Upgrade raspberrypi's cross compile tool to gcc 8.3.0? #102

Open jiapei100 opened 5 years ago

jiapei100 commented 5 years ago

Any plan to upgrade raspberrypi's cross compile tool to gcc 8.3.0? Some times, it's seriously slow to compile the source code on raspberry pi directly...

carlonluca commented 5 years ago

If you want I uploaded mine here. It should be 100% compatible with Buster. I have not experienced problems with it yet.

ali1234 commented 5 years ago

@carlonluca unfortunately your toolchain is not compatible with buster: your binutils is not patched for multiarch. Your gcc is, so you get linker errors like this:

/opt/rpi/rpi-gcc-8.3.0/lib/gcc/arm-linux-gnueabihf/8.3.0/../../../../arm-linux-gnueabihf/bin/ld: warning: libpcre.so.3, needed by /home/al/Source/rpi-ramdisk/sysroot/sysroot/usr/lib/arm-linux-gnueabihf/libglib-2.0.so, not found (try using -rpath or -rpath-link)

In order to fix this you need to apply http://bazaar.launchpad.net/~doko/binutils/pkg-2.24-debian/view/head:/patches/129_multiarch_libpath.patch to binutils source tree before building it.

mtekeli commented 5 years ago

Can this be of any use for this?

https://sourceforge.net/p/raspberry-pi-cross-compilers/code/ci/master/tree/

On Wed, 2 Oct 2019, 22:15 Alistair Buxton, notifications@github.com wrote:

@carlonluca https://github.com/carlonluca unfortunately your toolchain is not compatible with buster: your binutils is not patched for multiarch. Your gcc is, so you get linker errors like this:

/opt/rpi/rpi-gcc-8.3.0/lib/gcc/arm-linux-gnueabihf/8.3.0/../../../../arm-linux-gnueabihf/bin/ld: warning: libpcre.so.3, needed by /home/al/Source/rpi-ramdisk/sysroot/sysroot/usr/lib/arm-linux-gnueabihf/ libglib-2.0.so, not found (try using -rpath or -rpath-link)

In order to fix this you need to apply http://bazaar.launchpad.net/~doko/binutils/pkg-2.24-debian/view/head:/patches/129_multiarch_libpath.patch to binutils source tree before building it.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/raspberrypi/tools/issues/102?email_source=notifications&email_token=ACITD3J36MVIJDXGTO3UWI3QMTXODA5CNFSM4IUDVSOKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEAF3RVI#issuecomment-537639125, or mute the thread https://github.com/notifications/unsubscribe-auth/ACITD3KSQ7XHAAAJZFEHI7TQMTXODANCNFSM4IUDVSOA .

ali1234 commented 5 years ago

@mtekeli all the download links for that are broken, but I expect it has the same problem.

carlonluca commented 5 years ago

@ali1234 thanks for the info. I didn't encounter that error with any of my builds. How did you trigger that error?

ali1234 commented 5 years ago

I tried to cross compile libgssdp from git master against a raspbian sysroot.

Pro commented 5 years ago

I created a new repository which contains an updated toolchain with ARMv6 support.

Tested it on a Raspberry PI Zero with Raspbian Buster, and it works perfectly.

See: https://stackoverflow.com/a/58559140/869402

And the repo: https://github.com/Pro/raspi-toolchain

I'm happy for any feedback.

JamesH65 commented 5 years ago

Does it cross compile the kernel correctly and the result run OK? That's usually a good test for a new toolchain.

Pro commented 5 years ago

Does it cross compile the kernel correctly and the result run OK? That's usually a good test for a new toolchain.

I did not test that yet. Honestly, I did not yet try to compile a kernel myself. @JamesH65 do you know any good tutorial or example which shows how to do that? I could try to include this test into Continuous Integration, then we will see :+1:

pelwell commented 5 years ago

The official RPi kernel building guide is here: https://www.raspberrypi.org/documentation/linux/kernel/building.md

martburg commented 5 years ago

the toolchain according to ali1234 succeded to cross-compile qt 5.11.3

mahaju commented 3 years ago

@martburg Could you please share how to make a cross-compiler for qt 5.11.3, in ubuntu please?

carlonluca commented 3 years ago

@mahaju this toolchain here https://thebugfreeblog.blogspot.com/2019/09/raspbian-buster-gcc.html works for every Qt version I tested, up to 5.15.1. I tested for both Linux and Mac OS.