mirror of
https://github.com/flatcar/scripts.git
synced 2025-08-13 16:06:59 +02:00
eclass/toolchain-funcs: Sync with Gentoo
It's from Gentoo commit edac7f3ace362f7fcffb119989aa6f5b6880f07b.
This commit is contained in:
parent
92b9546fd1
commit
b7fe8d3d35
@ -355,16 +355,16 @@ tc-export_build_env() {
|
||||
# Some build envs will initialize vars like:
|
||||
# : ${BUILD_LDFLAGS:-${LDFLAGS}}
|
||||
# So make sure all variables are non-empty. #526734
|
||||
: ${BUILD_CFLAGS:=-O1 -pipe}
|
||||
: ${BUILD_CXXFLAGS:=-O1 -pipe}
|
||||
: ${BUILD_CPPFLAGS:= }
|
||||
: ${BUILD_LDFLAGS:= }
|
||||
: "${BUILD_CFLAGS:=-O1 -pipe}"
|
||||
: "${BUILD_CXXFLAGS:=-O1 -pipe}"
|
||||
: "${BUILD_CPPFLAGS:= }"
|
||||
: "${BUILD_LDFLAGS:= }"
|
||||
else
|
||||
# https://bugs.gentoo.org/654424
|
||||
: ${BUILD_CFLAGS:=${CFLAGS}}
|
||||
: ${BUILD_CXXFLAGS:=${CXXFLAGS}}
|
||||
: ${BUILD_CPPFLAGS:=${CPPFLAGS}}
|
||||
: ${BUILD_LDFLAGS:=${LDFLAGS}}
|
||||
: "${BUILD_CFLAGS:=${CFLAGS}}"
|
||||
: "${BUILD_CXXFLAGS:=${CXXFLAGS}}"
|
||||
: "${BUILD_CPPFLAGS:=${CPPFLAGS}}"
|
||||
: "${BUILD_LDFLAGS:=${LDFLAGS}}"
|
||||
fi
|
||||
export BUILD_{C,CXX,CPP,LD}FLAGS
|
||||
|
||||
@ -654,7 +654,7 @@ tc-has-tls() {
|
||||
-l) ;;
|
||||
-*) die "Usage: tc-has-tls [-c|-l] [toolchain prefix]";;
|
||||
esac
|
||||
: ${flags:=-fPIC -shared -Wl,-z,defs}
|
||||
: "${flags:=-fPIC -shared -Wl,-z,defs}"
|
||||
[[ $1 == -* ]] && shift
|
||||
$(tc-getCC "$@") ${flags} "${base}.c" -o "${base}" >&/dev/null
|
||||
local ret=$?
|
||||
|
Loading…
Reference in New Issue
Block a user