Cross compile Cuberite for Raspberry Pi
#11
This thread deserved a stick. Here you go.
[Image: Stick.png?version=2e27e22cfa3a789e14fb71cda00aa4b3]
Reply
Thanks given by:
#12
Thank youBig Grin
Will look to update this thread, because of the name change and a few others small thingsTongue
Reply
Thanks given by:
#13
I think this is now obsolete, or?
Reply
Thanks given by:
#14
Somewhat. It just needs a little updating - the ToLua++ executable is no longer needed. It still has a great step-by-step detailed guide for installing the crosscompiling tools, which is a great help.
Reply
Thanks given by:
#15
Yes tolua++ it no longer needed, but now it's required to have lua installed.
Reply
Thanks given by:
#16
Updated the tutorial:
  • Added the packages that needs to be installed and why
  • Use x64 cross compiler 
  • Formated the commands / output with shcode - looks better
Reply
Thanks given by: xoft
#17
Would this work for oDroid-C2 as well? What changes would I need to make to compile this for/deploy this on my oDroid-C2?
Reply
Thanks given by:
#18
A similar method works but it requires a different set of libraries and configuration files.
Reply
Thanks given by:
#19
Updated the tutorial:
  • No need to get the raspberry pi tools from github, there are now the packages gcc-arm-linux-gnueabihf and g++-arm-linux-gnueabihf that contains the cross compiler
  • Updated the example output of fdisk -l
  • Updated the content for pi.cmake
Reply
Thanks given by:
#20
Since Raspberry Pi isn't really the most powerful piece of hardware, you might want to play around with compiler optimization flags. Adding:

"-march=armv8-a+crc -mtune=cortex-a53 -O2 -pipe -mfpu=neon-fp-armv8" for RPi3 64-bit
"-O2 -pipe -mcpu=cortex-a7 -mfpu=neon-vfpv4" for RPi2/3 32-bit
"-march=armv8-a+crc -mtune=cortex-a72 -O2 -pipe" for RPi4 64-bit

to CFLAGS/CXXFLAGS should increase performance at least slightly. These sets of flags come from Gentoo wiki or other Gentoo-on-Pi projects.


-ftree-vec
torize shouldn't also hurt for any of these


-pipe pretty much just speeds up the build

-march/-mtune/-mcpu/-mfpu will cook the code specifically for a given platform so as to squeeze all the juice off of it

-O2 is an optimization level that shouldn't break anything, more brave of you could try -O3 (I haven't noticed major problems directly connected with it)
-flto enables link time optimizations, which could be an another source of performance gains, but I haven't tested whether that works yet.

If building the project with these flags doesn't introduce any errors, perhaps they could be incorporated in official builds, but that'd increase the number of images built, and I'm not sure whether CI and/or devs would be comfortable with that.



EDIT: btw, I'm using latest GCC9 to build, so I'm not sure whether all of these options are present in older compiler revisions (I've seen mentions of gcc4 somewhere on project's github)
Reply
Thanks given by: xoft




Users browsing this thread: 12 Guest(s)