@@ -1478,27 +1478,33 @@ make_compiler_cflags() {
eval "$4=\"$ldflags\""
eval "$5=\"$features\""
}
make_cflags_and_ldflags() {
# General CFlags for BUILD
CFLAGS_BUILD="$CFLAGS_BUILD"
CFLAGS_BUILD_ENV="$CFLAGS_BUILD"
CFLAGS_BUILD=""
# Special CXXFlags for BUILD
CXXFLAGS_BUILD="$CXXFLAGS_BUILD"
CXXFLAGS_BUILD_ENV="$CXXFLAGS_BUILD"
CXXFLAGS_BUILD=""
# LDFLAGS for BUILD
LDFLAGS_BUILD="$LDFLAGS_BUILD"
LDFLAGS_BUILD_ENV="$LDFLAGS_BUILD"
LDFLAGS_BUILD=""
# FEATURES for BUILD (lto)
FEATURES_BUILD=""
# General CFlags for HOST
CFLAGS="$CFLAGS"
CFLAGS_ENV="$CFLAGS"
CFLAGS=""
# Special CXXFlags for HOST
CXXFLAGS="$CXXFLAGS"
CXXFLAGS_ENV="$CXXFLAGS"
CXXFLAGS=""
# Libs to compile. In fact this is just LDFLAGS
LIBS="-lstdc++"
# LDFLAGS used for HOST
LDFLAGS="$LDFLAGS"
LDFLAGS_ENV="$LDFLAGS"
LDFLAGS=""
# FEATURES for HOST (lto)
FEATURES=""
make_compiler_cflags "$cc_build" "CFLAGS_BUILD" "CXXFLAGS_BUILD" "LDFLAGS_BUILD" "FEATURES_BUILD"
make_compiler_cflags "$cc_host" "CFLAGS" "CXXFLAGS" "LDFLAGS" "FEATURES"
@@ -1910,12 +1916,20 @@ make_cflags_and_ldflags() {
fi
if [ -n "$lto_host" ]; then
LDFLAGS="$LDFLAGS $CFLAGS $CXXFLAGS"
# All flags to be extended via the env
CFLAGS_BUILD="$CFLAGS_BUILD $CFLAGS_BUILD_ENV"
CXXFLAGS_BUILD="$CXXFLAGS_BUILD $CXXFLAGS_BUILD_ENV"
LDFLAGS_BUILD="$LDFLAGS_BUILD $LDFLAGS_BUILD_ENV"
CFLAGS="$CFLAGS $CFLAGS_ENV"
CXXFLAGS="$CXXFLAGS $CXXFLAGS_ENV"
LDFLAGS="$LDFLAGS $LDFLAGS_ENV"
log 1 "using CFLAGS_BUILD... $CFLAGS_BUILD"
log 1 "using CXXFLAGS_BUILD... $CXXFLAGS_BUILD"
log 1 "using LDFLAGS_BUILD... $LDFLAGS_BUILD"
log 1 "using CFLAGS... $CFLAGS"
log 1 "using CXXFLAGS... $CXXFLAGS"
log 1 "using LDFLAGS... $LIBS $LDFLAGS"
Status change: