mirror of
https://github.com/flatcar/scripts.git
synced 2025-08-13 07:56:57 +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:
|
# Some build envs will initialize vars like:
|
||||||
# : ${BUILD_LDFLAGS:-${LDFLAGS}}
|
# : ${BUILD_LDFLAGS:-${LDFLAGS}}
|
||||||
# So make sure all variables are non-empty. #526734
|
# So make sure all variables are non-empty. #526734
|
||||||
: ${BUILD_CFLAGS:=-O1 -pipe}
|
: "${BUILD_CFLAGS:=-O1 -pipe}"
|
||||||
: ${BUILD_CXXFLAGS:=-O1 -pipe}
|
: "${BUILD_CXXFLAGS:=-O1 -pipe}"
|
||||||
: ${BUILD_CPPFLAGS:= }
|
: "${BUILD_CPPFLAGS:= }"
|
||||||
: ${BUILD_LDFLAGS:= }
|
: "${BUILD_LDFLAGS:= }"
|
||||||
else
|
else
|
||||||
# https://bugs.gentoo.org/654424
|
# https://bugs.gentoo.org/654424
|
||||||
: ${BUILD_CFLAGS:=${CFLAGS}}
|
: "${BUILD_CFLAGS:=${CFLAGS}}"
|
||||||
: ${BUILD_CXXFLAGS:=${CXXFLAGS}}
|
: "${BUILD_CXXFLAGS:=${CXXFLAGS}}"
|
||||||
: ${BUILD_CPPFLAGS:=${CPPFLAGS}}
|
: "${BUILD_CPPFLAGS:=${CPPFLAGS}}"
|
||||||
: ${BUILD_LDFLAGS:=${LDFLAGS}}
|
: "${BUILD_LDFLAGS:=${LDFLAGS}}"
|
||||||
fi
|
fi
|
||||||
export BUILD_{C,CXX,CPP,LD}FLAGS
|
export BUILD_{C,CXX,CPP,LD}FLAGS
|
||||||
|
|
||||||
@ -654,7 +654,7 @@ tc-has-tls() {
|
|||||||
-l) ;;
|
-l) ;;
|
||||||
-*) die "Usage: tc-has-tls [-c|-l] [toolchain prefix]";;
|
-*) die "Usage: tc-has-tls [-c|-l] [toolchain prefix]";;
|
||||||
esac
|
esac
|
||||||
: ${flags:=-fPIC -shared -Wl,-z,defs}
|
: "${flags:=-fPIC -shared -Wl,-z,defs}"
|
||||||
[[ $1 == -* ]] && shift
|
[[ $1 == -* ]] && shift
|
||||||
$(tc-getCC "$@") ${flags} "${base}.c" -o "${base}" >&/dev/null
|
$(tc-getCC "$@") ${flags} "${base}.c" -o "${base}" >&/dev/null
|
||||||
local ret=$?
|
local ret=$?
|
||||||
|
Loading…
Reference in New Issue
Block a user