Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 178535 - >=x11-libs/qt-4.3.0_rc1: Suggested enabling configure script option "-reduce-relocations" in ebuilds
Summary: >=x11-libs/qt-4.3.0_rc1: Suggested enabling configure script option "-reduce-...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All All
: Lowest enhancement (vote)
Assignee: Qt Bug Alias
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-05-14 17:11 UTC by Arfrever Frehtes Taifersar Arahesis (RETIRED)
Modified: 2007-06-20 20:33 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Arfrever Frehtes Taifersar Arahesis (RETIRED) gentoo-dev 2007-05-14 17:11:29 UTC
Qt versions >=4.3 have configure script with introduced new option "-reduce-relocations". It reduces relocations in the libraries through safe extra linker optimizations. I suggest adding this option to >=qt-4.3.0_rc1.ebuild. Upstream wouldn't add such an option if it was unsafe.



Some fragments of configure script:
CFG_REDUCE_RELOCATIONS=no

...

    reduce-relocations)
        if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
            CFG_REDUCE_RELOCATIONS="$VAL"
        else
            UNKNOWN_OPT=yes
        fi
        ;;

...

if [ "$CFG_REDUCE_RELOCATIONS" != "no" ]; then
    if "$unixtests/bsymbolic_functions.test" "$TEST_COMPILER" "$OPT_VERBOSE"; then
        CFG_REDUCE_RELOCATIONS=no
    else
        CFG_REDUCE_RELOCATIONS=yes
    fi
fi



The content of unixtests/bsymbolic_functions.test:
#!/bin/sh

BSYMBOLIC_FUNCTIONS_SUPPORT=no
COMPILER=$1
VERBOSE=$2

cat >>bsymbolic_functions.c << EOF
int main() { return 0; }
EOF

"$COMPILER" -o libtest.so -shared -Wl,-Bsymbolic-functions -fPIC bsymbolic_functions.c >/dev/null 2>&1 && BSYMBOLIC_FUNCTIONS_SUPPORT=yes
rm -f bsymbolic_functions.c libtest.so

# done
if [ "$BSYMBOLIC_FUNCTIONS_SUPPORT" != "yes" ]; then
    [ "$VERBOSE" = "yes" ] && echo "Symbolic function binding disabled."
    exit 0
else
    [ "$VERBOSE" = "yes" ] && echo "Symbolic function binding enabled."
    exit 1
fi



As you can see it is safe to add this option to ebuild, because, if a user uses archaic linker, symbolic function binding will be disabled. In other cases it will be enabled and it won't cause any errors.
Comment 1 Caleb Tennis (RETIRED) gentoo-dev 2007-05-22 14:56:56 UTC
I think this is okay.  The only problem I can think of is what if you emerge this, but then downgrade binutils?  Will that pose a problem?
Comment 2 Arfrever Frehtes Taifersar Arahesis (RETIRED) gentoo-dev 2007-05-24 14:15:13 UTC
(In reply to comment #1)
> The only problem I can think of is what if you emerge this, but then downgrade
> binutils?  Will that pose a problem?

No, because -Bsymbolic-functions only affects the internals of shared libraries. It binds global functions references locally (Locally means inside the code of given library). This option doesn't affect executables. Also even GCC developers decided to enable -Bsymbolic-functions defaultly when building libstdc++.so and other libraries with ld supporting it:
 http://gcc.gnu.org/ml/gcc/2007-01/msg00342.html
 http://gcc.gnu.org/ml/gcc/2007-01/msg00463.html
Comment 3 Caleb Tennis (RETIRED) gentoo-dev 2007-06-20 20:33:47 UTC
added to 4.3.0.  Thanks!