From c75d0fe631aba49d79db991c7102ab3ff57ef974 Mon Sep 17 00:00:00 2001 From: Pau Espin Pedrol Date: Wed, 21 Apr 2021 14:49:02 +0200 Subject: [PATCH] Introduce libosmocore_git.bbappend to fix TLS bug Related: OS#5079 --- recipes-sysmobts/libosmocore/libosmocore_git.bbappend | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 recipes-sysmobts/libosmocore/libosmocore_git.bbappend diff --git a/recipes-sysmobts/libosmocore/libosmocore_git.bbappend b/recipes-sysmobts/libosmocore/libosmocore_git.bbappend new file mode 100644 index 0000000..b5933aa --- /dev/null +++ b/recipes-sysmobts/libosmocore/libosmocore_git.bbappend @@ -0,0 +1,10 @@ +# OS#4062, OS#5079: When building with sysmobts toolchain we hit a TLS compiler +# bug (osmo-bts-symo calling osmo_str_tolower() which uses "static __thread char +# capsbuf"). As a result, the only option would be to use -O0 when building +# libosmocore. In order to avoid that, we take advantage of the fact that no +# libosmocore multi-thread process is expected to run there and simply drop all +# the "__thread" references when building for sysmobts. That's done as a +# machine-specific bbappend in meta-sysmocom-bsp. +do_compile_prepend() { + grep -r -l "__thread" "${S}/src/" "${S}/include/" | xargs sed -i "s/__thread//g" +}