Cross compile Cuberite for Raspberry Pi
#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


Messages In This Thread
RE: Cross compile Cuberite for Raspberry Pi - by konradybcio - 12-29-2019, 04:13 AM



Users browsing this thread: 6 Guest(s)