Skip to content

Commit

Permalink
base: ostree: as we use static linking fix it with clang
Browse files Browse the repository at this point in the history
glibc is built with gcc and hence encodes some libgcc specific builtins
which are not found when doing static linking with clang using compiler-rt,
so use libgcc to fix floting point emulation undefined reference:

- undefined reference to `__unordtf2'
- undefined reference to `__letf2'

this brings again a3892eb but now only for static linked.

Signed-off-by: Jose Quaresma <jose.quaresma@foundries.io>
  • Loading branch information
quaresmajose authored and ricardosalveti committed Sep 1, 2022
1 parent e3930e0 commit 0abb08c
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions meta-lmp-base/recipes-extended/ostree/ostree_%.bbappend
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,20 @@ SRC_URI:append = " \
file://0004-Add-support-for-systemd-boot-bootloader.patch \
file://update-default-grub-cfg-header.patch \
"

# glibc is built with gcc and hence encodes some libgcc specific builtins which are not found
# when doing static linking with clang using compiler-rt, so use libgcc
# undefined reference to `__unordtf2'
# | tmp-lmp/work/corei7-64-lmp-linux/ostree/2021.6-r0/recipe-sysroot-native/usr/bin/x86_64-lmp-linux/x86_64-lmp-linux-ld: tmp-lmp/work/corei7-64-lmp-linux/ostree/2021.6-r0/recipe-sysroot//usr/lib/libc.a(printf_fp.o): in function `__printf_fp_l':
# | /usr/src/debug/glibc/2.35-r0/git/stdio-common/printf_fp.c:388: undefined reference to `__unordtf2'
# | tmp-lmp/work/corei7-64-lmp-linux/ostree/2021.6-r0/recipe-sysroot-native/usr/bin/x86_64-lmp-linux/x86_64-lmp-linux-ld: /usr/src/debug/glibc/2.35-r0/git/stdio-common/printf_fp.c:388: undefined reference to `__unordtf2'
# | tmp-lmp/work/corei7-64-lmp-linux/ostree/2021.6-r0/recipe-sysroot-native/usr/bin/x86_64-lmp-linux/x86_64-lmp-linux-ld: /usr/src/debug/glibc/2.35-r0/git/stdio-common/printf_fp.c:388: undefined reference to `__letf2'
# | tmp-lmp/work/corei7-64-lmp-linux/ostree/2021.6-r0/recipe-sysroot-native/usr/bin/x86_64-lmp-linux/x86_64-lmp-linux-ld: tmp-lmp/work/corei7-64-lmp-linux/ostree/2021.6-r0/recipe-sysroot//usr/lib/libc.a(printf_fphex.o): in function `__printf_fphex':
# | /usr/src/debug/glibc/2.35-r0/git/stdio-common/../stdio-common/printf_fphex.c:206: undefined reference to `__unordtf2'
# | tmp-lmp/work/corei7-64-lmp-linux/ostree/2021.6-r0/recipe-sysroot-native/usr/bin/x86_64-lmp-linux/x86_64-lmp-linux-ld: /usr/src/debug/glibc/2.35-r0/git/stdio-common/../stdio-common/printf_fphex.c:206: undefined reference to `__unordtf2'
# | tmp-lmp/work/corei7-64-lmp-linux/ostree/2021.6-r0/recipe-sysroot-native/usr/bin/x86_64-lmp-linux/x86_64-lmp-linux-ld: /usr/src/debug/glibc/2.35-r0/git/stdio-common/../stdio-common/printf_fphex.c:206: undefined reference to `__letf2'
# | x86_64-lmp-linux-clang -target x86_64-lmp-linux -m64 -march=nehalem -mtune=generic -mfpmath=sse -msse4.2 -mlittle-endian --dyld-prefix=/usr -Qunused-arguments -fstack-protector-strong -O2 -D_F
COMPILER_RT:pn-ostree:libc-glibc:toolchain-clang:x86 = " \
${@bb.utils.contains('PACKAGECONFIG', 'static', '-rtlib=libgcc --unwindlib=libgcc', '', d)}"
COMPILER_RT:pn-ostree:libc-glibc:toolchain-clang:x86-64 = " \
${@bb.utils.contains('PACKAGECONFIG', 'static', '-rtlib=libgcc --unwindlib=libgcc', '', d)}"

0 comments on commit 0abb08c

Please sign in to comment.