Workaround toolchain bug on x86 with -Os and --as-needed, see bug #503500.
authorDavide Pesavento <pesa@gentoo.org>
Mon, 23 Mar 2015 02:15:14 +0000 (02:15 +0000)
committerDavide Pesavento <pesa@gentoo.org>
Mon, 23 Mar 2015 02:15:14 +0000 (02:15 +0000)
eclass/ChangeLog
eclass/qt4-build-multilib.eclass
eclass/qt4-build.eclass

index c181c02bd0c390d513991bc982f9f7d0f4e136d9..c0eec7fcdc96d6c9719ecea842776f5c21246665 100644 (file)
@@ -1,6 +1,10 @@
 # ChangeLog for eclass directory
 # Copyright 1999-2015 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.1572 2015/03/22 13:41:16 mgorny Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.1573 2015/03/23 02:15:14 pesa Exp $
+
+  23 Mar 2015; Davide Pesavento <pesa@gentoo.org> qt4-build.eclass,
+  qt4-build-multilib.eclass:
+  Workaround toolchain bug on x86 with -Os and --as-needed, see bug #503500.
 
   22 Mar 2015; Michał Górny <mgorny@gentoo.org> python-single-r1.eclass:
   Extend EAPI=4 whitelist to cover crossdev gdb.
index e8d9ffa0157e6ac8491246ba20bf69e3471386f1..48ad42dc4984b2a4048249cbff73340c7354321f 100644 (file)
@@ -1,6 +1,6 @@
 # Copyright 1999-2015 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/qt4-build-multilib.eclass,v 1.7 2015/03/15 01:25:19 pesa Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/qt4-build-multilib.eclass,v 1.8 2015/03/23 02:15:14 pesa Exp $
 
 # @ECLASS: qt4-build-multilib.eclass
 # @MAINTAINER:
@@ -167,17 +167,25 @@ qt4-build-multilib_src_prepare() {
                fi
        fi
 
+       if [[ ${PN} == qtcore ]]; then
+               # Bug 373061
+               # qmake bus errors with -O2 or -O3 but -O1 works
+               if [[ ${CHOST} == *86*-apple-darwin* ]]; then
+                       replace-flags -O[23] -O1
+               fi
+
+               # Bug 503500
+               # undefined reference with -Os and --as-needed
+               if use x86 || use_if_iuse abi_x86_32; then
+                       replace-flags -Os -O2
+               fi
+       fi
+
        # Bug 261632
        if use ppc64; then
                append-flags -mminimal-toc
        fi
 
-       # Bug 373061
-       # qmake bus errors with -O2 or -O3 but -O1 works
-       if [[ ${CHOST} == *86*-apple-darwin* ]]; then
-               replace-flags -O[23] -O1
-       fi
-
        # Bug 417105
        # graphite on gcc 4.7 causes miscompilations
        if [[ $(gcc-version) == "4.7" ]]; then
index 6e6008a72a48cea52680149616e2a4c84a0b7bf8..4d20a6572acf9f4719b3179922ae025fb2b40416 100644 (file)
@@ -1,6 +1,6 @@
 # Copyright 1999-2015 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/qt4-build.eclass,v 1.161 2015/03/15 01:25:19 pesa Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/qt4-build.eclass,v 1.162 2015/03/23 02:15:14 pesa Exp $
 
 # @ECLASS: qt4-build.eclass
 # @MAINTAINER:
@@ -172,10 +172,18 @@ qt4-build_src_prepare() {
                skip_qmake_build
                skip_project_generation
                symlink_binaries_to_buildtree
-       fi
+       else
+               # Bug 373061
+               # qmake bus errors with -O2 or -O3 but -O1 works
+               if [[ ${CHOST} == *86*-apple-darwin* ]]; then
+                       replace-flags -O[23] -O1
+               fi
 
-       if use_if_iuse c++0x; then
-               append-cxxflags -std=c++0x
+               # Bug 503500
+               # undefined reference with -Os and --as-needed
+               if use x86; then
+                       replace-flags -Os -O2
+               fi
        fi
 
        # Bug 261632
@@ -183,18 +191,16 @@ qt4-build_src_prepare() {
                append-flags -mminimal-toc
        fi
 
-       # Bug 373061
-       # qmake bus errors with -O2 or -O3 but -O1 works
-       if [[ ${CHOST} == *86*-apple-darwin* ]]; then
-               replace-flags -O[23] -O1
-       fi
-
        # Bug 417105
        # graphite on gcc 4.7 causes miscompilations
        if [[ $(gcc-version) == "4.7" ]]; then
                filter-flags -fgraphite-identity
        fi
 
+       if use_if_iuse c++0x; then
+               append-cxxflags -std=c++0x
+       fi
+
        # Respect CC, CXX, {C,CXX,LD}FLAGS in .qmake.cache
        sed -e "/^SYSTEM_VARIABLES=/i \
                CC='$(tc-getCC)'\n\