# HG changeset patch # User Aleksej Bobylev # Date 1521633908 -7200 # Node ID 5a63ab7642f2c19eb246f79fa5461a498af8d306 # Parent 7542315e1814d297d2de285e1c1f05afde84e7de cook: add `fix math`; cook.conf: set LDFLAGS provided by `fix ld` by default. diff -r 7542315e1814 -r 5a63ab7642f2 cook --- a/cook Mon Mar 19 22:48:21 2018 +0200 +++ b/cook Wed Mar 21 14:05:08 2018 +0200 @@ -547,6 +547,19 @@ echo "fix libtool: warning: libtool absent, nothing to fix." fi ;; + math) + # fix C++ math issue introduced in Glibc 2.26: + # error: '__builtin_isnan' is not a member of 'std' + # if (std::isnan(N)) { + # ^ + find $src -type f -exec sed -i ' + s|std::signbit|__builtin_signbit|g; + s|std::isnan|__builtin_isnan|g; + s|std::isinf|__builtin_isinf_sign|g; + s|std::isfinite|__builtin_isfinite|g; + s|std::isnormal|__builtin_isnormal|g + ' '{}' \; + ;; esac } @@ -614,8 +627,8 @@ # Export flags and path to be used by make and receipt. DESTDIR="$pkgdir/install" # FIXME: L10n: Is this the right time for 'LC_ALL=C LANG=C'? - export DESTDIR MAKEFLAGS CFLAGS CXXFLAGS CONFIG_SITE LC_ALL=C LANG=C - #LDFLAGS + export DESTDIR MAKEFLAGS CFLAGS CXXFLAGS CONFIG_SITE LC_ALL=C LANG=C \ + LDFLAGS # BUILD_DEPENDS may vary depending on the ARCH case "$ARCH" in @@ -759,7 +772,7 @@ if grep -q ^compile_rules $receipt; then _ 'Executing: %s' 'compile_rules' echo "CFLAGS : $CFLAGS" - #echo "LDFLAGS : $LDFLAGS" + echo "LDFLAGS : $LDFLAGS" [ -d "$src" ] && cd $src patchit diff -r 7542315e1814 -r 5a63ab7642f2 cook.conf --- a/cook.conf Mon Mar 19 22:48:21 2018 +0200 +++ b/cook.conf Wed Mar 21 14:05:08 2018 +0200 @@ -91,6 +91,12 @@ # Binutils 2.22 breaks many packages built without LDFLAGS set correctly. #LDFLAGS="-Wl,--copy-dt-needed-entries -lXt" +# These LDFLAGS will minify runtime dependencies (show by ldd) +# in the most cases when libtool used. +# https://bugzilla.gnome.org/show_bug.cgi?id=655517 +# https://wiki.gentoo.org/wiki/Project:Quality_Assurance/As-needed +export LDFLAGS="-Wl,-Os,--as-needed" + # Default tool prefix for Binutils. TOOLPREFIX="${HOST_SYSTEM}-"