Skip to content
This repository has been archived by the owner on Dec 20, 2024. It is now read-only.

Commit

Permalink
manually set desired compiler defaults for target gcc on armhf
Browse files Browse the repository at this point in the history
The way that Yocto works when compiling is to build "default" compilers
for the target architecture, then to apply the "tunes" (FPU settings,
SIMD extensions, etc) by replacing $CC with a very long invocation that
includes all of the stuff you set up in your machine/architecture
recipes.

Unfortunately this means that if you ask Yocto to build a compiler for
you, and then take it outside of the Yocto build environment, the
compiler doesn't inherently default to any of the same tunes which
were used at the time of building the platform/SDK.

On ARM this is particularly bad because it means the Flatpak SDK has
effectively been building binaries with a different ABI to the platform,
including soft rather than hard float, no VFP, no thumb, etc. This
has caused build failures as pretty much everyone (whether armel or armhf)
assumes VFP is available, and is very likely to cause app crashes at
runtime in apps that use floating point due to not preserving the
right registers in the calling convention.

For our ARM v7 platform, manually set the configure options for gcc
so that the selected/intended ABI/tunes are set for the compiler inside
the SDK, rather than only at the time we compile the SDK itself.

(This is an instance of
https://bugzilla.yoctoproject.org/show_bug.cgi?id=139 upstream in Yocto
- also known as "nobody who uses Yocto uses the compiler inside the
image".)

#8
  • Loading branch information
ramcq authored and alexlarsson committed Sep 28, 2017
1 parent 8d68feb commit 90c6418
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions meta-freedesktop/recipes-devtools/gcc/gcc_6.2.bbappend
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
EXTRA_OECONF_append_qemuarmv7a = "--with-mode=thumb --with-fpu=vfpv3-d16 --with-arch=armv7-a --with-float=hard"

do_install_append () {
ln -sf ${TARGET_PREFIX}gcov ${D}${bindir}/gcov
ln -sf ${TARGET_PREFIX}gcov-tool ${D}${bindir}/gcov-tool
Expand Down

0 comments on commit 90c6418

Please sign in to comment.