[oe-commits] [openembedded-core] 12/21: musl: use a more specific fix for ARM thumb + frame pointers

git at git.openembedded.org git at git.openembedded.org
Mon Oct 16 22:53:17 UTC 2017


This is an automated email from the git hooks/post-receive script.

rpurdie pushed a commit to branch master
in repository openembedded-core.

commit d7580cd7792982fd9e98086e4edc490635e9adca
Author: Andre McCurdy <armccurdy at gmail.com>
AuthorDate: Mon Oct 9 09:00:35 2017 -0700

    musl: use a more specific fix for ARM thumb + frame pointers
    
    When compiling for Thumb or Thumb2, frame pointers _must_ be disabled
    since the Thumb frame pointer in r7 clashes with musl's use of inline
    asm to make syscalls (where r7 is used for the syscall NR).
    
    In most cases, frame pointers will be disabled automatically due to
    the optimisation level, but appending an explicit -fomit-frame-pointer
    to CFLAGS handles cases where optimisation is set to -O0 or frame
    pointers have been enabled by -fno-omit-frame-pointer earlier in
    CFLAGS, etc.
    
    Note that this limitation applies both to gcc and clang, the only
    difference between the two being that where gcc aborts with an error
    about reusing r7, clang apparently silently generates broken code:
    
      https://bugs.llvm.org/show_bug.cgi?id=34165
    
    Signed-off-by: Andre McCurdy <armccurdy at gmail.com>
    Signed-off-by: Ross Burton <ross.burton at intel.com>
---
 meta/recipes-core/musl/musl_git.bb | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/meta/recipes-core/musl/musl_git.bb b/meta/recipes-core/musl/musl_git.bb
index 8b6a2e3..bd7573e 100644
--- a/meta/recipes-core/musl/musl_git.bb
+++ b/meta/recipes-core/musl/musl_git.bb
@@ -28,7 +28,13 @@ export CROSS_COMPILE="${TARGET_PREFIX}"
 
 LDFLAGS += "-Wl,-soname,libc.so"
 
-ARM_INSTRUCTION_SET_toolchain-clang = "arm"
+# When compiling for Thumb or Thumb2, frame pointers _must_ be disabled since the
+# Thumb frame pointer in r7 clashes with musl's use of inline asm to make syscalls
+# (where r7 is used for the syscall NR). In most cases, frame pointers will be
+# disabled automatically due to the optimisation level, but append an explicit
+# -fomit-frame-pointer to handle cases where optimisation is set to -O0 or frame
+# pointers have been enabled by -fno-omit-frame-pointer earlier in CFLAGS, etc.
+CFLAGS_append_arm = " ${@bb.utils.contains('TUNE_CCARGS', '-mthumb', '-fomit-frame-pointer', '', d)}"
 
 CONFIGUREOPTS = " \
     --prefix=${prefix} \

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list