Summary: | mozcoreconf-2 eclass should "--enable-optimize=-O*" with "-O*" from CFLAGS if "custom-optimizations" is enabled for firefox or other mozilla ebuilds | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | cmuelle8 <cmue81> |
Component: | Eclasses | Assignee: | Mozilla Gentoo Team <mozilla> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | nrndda |
Priority: | Normal | Keywords: | PATCH |
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Bug Depends on: | |||
Bug Blocks: | 462608, 464758, 464882 | ||
Attachments: |
mozcoreconf-2.custom-opts.patch
mozcoreconf-2.eclass.set-host-triple.custom-optimize.patch mozcoreconf-2.eclass.patch |
Description
cmuelle8
2013-03-20 14:19:34 UTC
(In reply to comment #0) > Since custom-cflags is an expert option anyway, mozcoreconf-2.eclass should > not be in the way of people trying out experimental stuff. Furthermore, consider the use flag help for both, custom-optimizations and custom-cflags. It discourages their use, underlining their experimental character. If those flags are enabled the eclass should try it's best to stay out of the users way and only filter out a minimum set in *FLAGS. Greetings Created attachment 342808 [details]
mozcoreconf-2.custom-opts.patch
Also, on x86, custom-optimization is currently not usable:
elif [[ ${ARCH} == x86 ]]; then
mozconfig_annotate "less then -O2 causes a segfault on x86" --enable-optimize=-O2
elif use custom-optimization || [[ ${ARCH} =~ (alpha|ia64) ]]; then
the second elif is never reached, since the first matches always on that arch.
An updated, overhauled patch is attached. It works here, but please retest before applying.
Thx
Created attachment 344004 [details] mozcoreconf-2.eclass.set-host-triple.custom-optimize.patch move config.guess patch from bug #462608 into the eclass - we do not need to "guess" the host on Gentoo systems, just use CHOST of make.conf or (wrt paludis' cave) bashrc - see bug #462608 cmt #8 for details Created attachment 345420 [details, diff] mozcoreconf-2.eclass.patch "Specifying the host without specifying the build /should be avoided/, as configure may (and once did) assume that the host you specify is also the build, which may not be true." source: http://gcc.gnu.org/onlinedocs/gccint/Configure-Terms.html Some research into this lead to an update of the attached patch. I subsequently propose to remove --target= --build= from the mozilla /ebuilds/ and fit them into the eclass, as they are essential to every mozilla build. This keeps setting --host to avoid mis-detection of cross-compilation in some cases (as was done previously). I've put a thorough comment within the eclass for fast reference. #################################### # # BUILD / HOST / TARGET setup # # http://gcc.gnu.org/onlinedocs/gccint/Configure-Terms.html says # If [c]host and [c]target are the same, but [c]build is different, # you are using a cross-compiler to build a native for [chost]. # the machine you are building on (--build), CBUILD # the machine that you are building for (--host), CHOST # the machine that GCC will produce code for (--target), CTARGET # # # Mozilla's configure terms differ to this for historic reasons, i.e. # ./configure --host=${CBUILD} --build=${CHOST} --target=${CTARGET} # The meaning of build and host is swapped. # # ./configure defaults for most mozilla software are # to guess --host, i.e. CBUILD in gcc terminology # and to set --build := --target := --host # # Guessing CBUILD (here: --host) is error-prone. # make.conf hardcodes CHOST on most Gentoo installs. # We use CHOST as a fallback to CTARGET here. # # If CTARGET is not set, configure might miss a native build, # when (config.guessed CBUILD) != (hardcoded CHOST). Passing # CBUILD (here: --host) prevents this, bug #462608 comment #8. # # # http://www.gentoo.org/proj/en/base/embedded/cross-development.xml # asserts $CHOST == $CTARGET, just binaries here, no toolchains # mozconfig_annotate "" --build=${CHOST} # mozconfig_annotate "" --build=${CTARGET:-${CHOST}} # should both do the same if ENVs are set according to the guide # #################################### Thanks for your efforts. However, it should be noted that mozilla's use of --build and --host and --target does *not* match that of autotools' standards. mozcoreconf-v4 manages this as best it can (and has been confirmed to work on crossdev, too). I will add the ability to set -O4 when custom-optimization is set, however all of the other filters will remain as-is. commit 0b5d23ceefd8697aa668943a54a21ef4e0309be5 Author: Ian Stakenvicius <axs@gentoo.org> Date: Mon Jul 25 14:50:27 2016 -0400 mozcoreconf-v4.eclass: allow -O4 when custom-optimization flag is set End-users want to experiment with clang and -O4, so let them. Bug: http://bugs.gentoo.org/462488 |