app-office/libreoffice: Brute-force compiler settings (clang/gcc)

Bug: https://bugs.gentoo.org/739134
Package-Manager: Portage-3.0.9, Repoman-3.0.2
Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org>
This commit is contained in:
Andreas K. Hüttel
2020-11-22 01:27:36 +02:00
parent 676a5134c0
commit f9e9a8666c
3 changed files with 30 additions and 48 deletions
@@ -393,41 +393,35 @@ src_configure() {
local google_default_client_secret="vgKG0NNv7GoDpbtoFNLxCUXu"
# Show flags set at the beginning
einfo "Current CFLAGS: ${CFLAGS}"
einfo "Current LDFLAGS: ${LDFLAGS}"
einfo "Preset CFLAGS: ${CFLAGS}"
einfo "Preset LDFLAGS: ${LDFLAGS}"
local have_switched_compiler=
if use clang && ! tc-is-clang ; then
if use clang ; then
# Force clang
einfo "Enforcing the use of clang due to USE=clang ..."
have_switched_compiler=yes
AR=llvm-ar
CC=${CHOST}-clang
CXX=${CHOST}-clang++
NM=llvm-nm
RANLIB=llvm-ranlib
elif ! use clang && ! tc-is-gcc ; then
LDFLAGS+=" -fuse-ld=lld"
strip-unsupported-flags
else
# Force gcc
have_switched_compiler=yes
einfo "Enforcing the use of gcc due to USE=-clang ..."
AR=gcc-ar
CC=${CHOST}-gcc
CXX=${CHOST}-g++
NM=gcc-nm
RANLIB=gcc-ranlib
strip-unsupported-flags
fi
export CLANG_CC=${CC}
export CLANG_CXX=${CXX}
if [[ -n "${have_switched_compiler}" ]] ; then
# Because we switched active compiler we have to ensure
# that no unsupported flags are set
strip-unsupported-flags
fi
# Show flags set at the beginning
einfo " Used CFLAGS: ${CFLAGS}"
einfo " Used LDFLAGS: ${LDFLAGS}"
# Show flags set at the end
einfo " Used CFLAGS: ${CFLAGS}"
einfo " Used LDFLAGS: ${LDFLAGS}"
# Ensure we use correct toolchain
tc-export CC CXX LD AR NM OBJDUMP RANLIB PKG_CONFIG
@@ -389,41 +389,35 @@ src_configure() {
local google_default_client_secret="vgKG0NNv7GoDpbtoFNLxCUXu"
# Show flags set at the beginning
einfo "Current CFLAGS: ${CFLAGS}"
einfo "Current LDFLAGS: ${LDFLAGS}"
einfo "Preset CFLAGS: ${CFLAGS}"
einfo "Preset LDFLAGS: ${LDFLAGS}"
local have_switched_compiler=
if use clang && ! tc-is-clang ; then
if use clang ; then
# Force clang
einfo "Enforcing the use of clang due to USE=clang ..."
have_switched_compiler=yes
AR=llvm-ar
CC=${CHOST}-clang
CXX=${CHOST}-clang++
NM=llvm-nm
RANLIB=llvm-ranlib
elif ! use clang && ! tc-is-gcc ; then
LDFLAGS+=" -fuse-ld=lld"
strip-unsupported-flags
else
# Force gcc
have_switched_compiler=yes
einfo "Enforcing the use of gcc due to USE=-clang ..."
AR=gcc-ar
CC=${CHOST}-gcc
CXX=${CHOST}-g++
NM=gcc-nm
RANLIB=gcc-ranlib
strip-unsupported-flags
fi
export CLANG_CC=${CC}
export CLANG_CXX=${CXX}
if [[ -n "${have_switched_compiler}" ]] ; then
# Because we switched active compiler we have to ensure
# that no unsupported flags are set
strip-unsupported-flags
fi
# Show flags set at the beginning
einfo " Used CFLAGS: ${CFLAGS}"
einfo " Used LDFLAGS: ${LDFLAGS}"
# Show flags set at the end
einfo " Used CFLAGS: ${CFLAGS}"
einfo " Used LDFLAGS: ${LDFLAGS}"
# Ensure we use correct toolchain
tc-export CC CXX LD AR NM OBJDUMP RANLIB PKG_CONFIG
+10 -16
View File
@@ -389,41 +389,35 @@ src_configure() {
local google_default_client_secret="vgKG0NNv7GoDpbtoFNLxCUXu"
# Show flags set at the beginning
einfo "Current CFLAGS: ${CFLAGS}"
einfo "Current LDFLAGS: ${LDFLAGS}"
einfo "Preset CFLAGS: ${CFLAGS}"
einfo "Preset LDFLAGS: ${LDFLAGS}"
local have_switched_compiler=
if use clang && ! tc-is-clang ; then
if use clang ; then
# Force clang
einfo "Enforcing the use of clang due to USE=clang ..."
have_switched_compiler=yes
AR=llvm-ar
CC=${CHOST}-clang
CXX=${CHOST}-clang++
NM=llvm-nm
RANLIB=llvm-ranlib
elif ! use clang && ! tc-is-gcc ; then
LDFLAGS+=" -fuse-ld=lld"
strip-unsupported-flags
else
# Force gcc
have_switched_compiler=yes
einfo "Enforcing the use of gcc due to USE=-clang ..."
AR=gcc-ar
CC=${CHOST}-gcc
CXX=${CHOST}-g++
NM=gcc-nm
RANLIB=gcc-ranlib
strip-unsupported-flags
fi
export LO_CLANG_CC=${CC}
export LO_CLANG_CXX=${CXX}
if [[ -n "${have_switched_compiler}" ]] ; then
# Because we switched active compiler we have to ensure
# that no unsupported flags are set
strip-unsupported-flags
fi
# Show flags set at the beginning
einfo " Used CFLAGS: ${CFLAGS}"
einfo " Used LDFLAGS: ${LDFLAGS}"
# Show flags set at the end
einfo " Used CFLAGS: ${CFLAGS}"
einfo " Used LDFLAGS: ${LDFLAGS}"
# Ensure we use correct toolchain
tc-export CC CXX LD AR NM OBJDUMP RANLIB PKG_CONFIG