Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 59506 (cflags) - [TRACKER] packages that do not respect CFLAGS and CXXFLAGS
Summary: [TRACKER] packages that do not respect CFLAGS and CXXFLAGS
Status: CONFIRMED
Alias: cflags
Product: Quality Assurance
Classification: Unclassified
Component: Trackers (show other bugs)
Hardware: All Linux
: High normal
Assignee: Gentoo Quality Assurance Team
URL:
Whiteboard:
Keywords: Tracker
: 319559 (view as bug list)
Depends on: 241044 perlxsflags 270860 310437 316095 378645 385995 408519 411471 428070 429498 430816 431054 448862 451446 453456 458486 496354 496368 583148 615748 634724 635680 639462 639468 646012 652172 662552 685982 716730 719166 720888 722400 722648 722694 722698 723742 723936 723938 723956 724060 724066 724162 724280 724282 724808 724818 724950 724954 725048 725224 725452 725994 726010 726276 726388 726570 726856 726858 726890 726892 727052 727096 727212 727440 727492 727958 727962 727974 728048 728084 728144 728322 729452 729898 730528 731214 731216 731744 732878 733696 734044 735062 735708 736132 736838 736884 737046 737048 737060 737198 738818 738860 738898 739046 739098 739290 740246 740284 741106 741190 741634 742809 742836 742839 742953 744046 748438 751436 751439 751442 751616 751622 755449 761700 765382 766851 773985 777645 778536 781923 785250 786243 788943 791016 791019 796410 796827 796887 797493 799245 802615 802852 804450 804462 806442 51593 58956 59280 59507 59508 59509 59510 59511 59513 59514 59537 59709 67070 69678 86874 112432 143661 176240 190534 220739 238106 241052 385951 438046 439094 496358 511098 526194 530928 562164 587820 619436 619674 620532 622576 646756 674918 687412 719174 719184 719186 722082 722178 722192 722358 722360 722384 722394 722396 722398 722812 722814 722816 722818 722820 722824 723072 723748 724068 724070 724072 724074 724076 724160 724284 724286 724810 724812 724814 724864 724942 724944 725050 725052 725054 725056 725058 725060 725062 725064 725066 725070 725072 725074 725076 725078 725080 725082 725084 725086 725088 725092 725222 725228 725232 725238 725542 725546 725548 725552 725556 725558 725998 726002 726004 726054 726270 726278 726370 726376 726382 726386 726484 726632 726670 726854 726910 726912 727048 727076 727194 727196 727198 727200 727202 727204 727276 727494 727558 727772 727776 727778 727782 727970 728024 728036 728038 728040 728042 728050 728082 728146 728158 729450 729572 730010 730012 730056 730136 730204 731212 731944 732350 732694 733604 734236 734264 734350 734908 735712 736493 736940 737058 737300 737420 737574 739194 739216 739218 739288 739336 739370 739372 739526 739972 740324 740500 740652 740706 741638 742437 742602 742608 742776 744931 745399 746638 747430 747889 747892 748435 748735 748738 748741 748744 748747 748750 748753 748756 748759 748765 748768 748771 748777 748780 748783 748786 748792 748795 748798 748801 748804 748807 748810 748813 748816 748819 748822 748825 748828 748831 748834 748837 748840 749056 749059 749062 749065 749071 749074 749077 749083 749086 749089 749092 749095 749098 749101 749104 749107 749110 749113 749116 749119 749177 749180 749183 749186 749189 749192 749195 749198 749201 749204 749213 749216 749219 749222 749225 749228 749231 749234 749237 749294 749513 749732 749738 749744 749939 750323 750392 750497 750503 750521 750794 750797 750800 751280 751460 751625 751658 753608 754291 754867 755209 756049 756697 758044 758140 764503 764815 765403 766084 768318 772176 775014 775761 775764 775767 775770 776307 776859 777792 778458 779319 780336 780546 780723 780726 780735 781641 781992 788715 789363 791169 797724 798498 802798
Blocks:
  Show dependency tree
 
Reported: 2004-08-05 04:56 UTC by Ciaran McCreesh
Modified: 2021-08-05 01:30 UTC (History)
7 users (show)

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 Ciaran McCreesh 2004-08-05 04:56:13 UTC
Metabug for ebuilds which kill user-supplied CFLAGS. This is a Very Bad Thing (TM):

* Killing -march/-mcpu will force kernel emulation for certain opcodes (especially for floating point) on certain processors. This is *really* slow.

* Stripping certain ABI flags will kill linkage. This will lead to either crashes or horrid explosive failure on non-static binaries.

* Stripping certain ABI flags will produce invalid code for certain CPUs. For example, we might end up producing big endian code for little endian CPUs, or code which assumes that the %g0 register is always zero when it isn't.

gentoo-dev post: http://marc.theaimsgroup.com/?l=gentoo-dev&m=109131955117290&w=2

Correct behaviour is to use flag-o-matic's strip-flags. This isn't perfect, but it means that when we have to add in new allowed flags, we only have to do it in one place rather than in several hundred ebuilds.
Comment 1 Ciaran McCreesh 2004-08-05 09:37:58 UTC
Additional reason:

* When killing a user's march/mcpu/mtune and replacing it with a vendor-supplied auto-detected CPU setting, this breaks binaries (GRP and crossbuilding). For example, I might be building generic i686 stages on my athlon-xp.
Comment 2 Matthew Kennedy (RETIRED) gentoo-dev 2004-08-05 21:57:24 UTC
Someone feels dev-lisp/clisp and dev-lisp/mzscheme are problems
because of this.  Quite frankly I dont have the time to determine what
flags and combinations thereof cause build or runtime failures.

You can take a look at dev-lisp/clisp and get an idea of the time
consuming and complicated flag-o-matic logic required to get CLISP
built.  It is a maintenance nightmare.  Even with that logic, I know
people are still encountering problems on architectures I can't test
myself.  

I understand all your reasons.  They look like good ones to me.  I'm
open to suggestions, however if you insist on filtering CFLAGS, then
feel free to do all the work.
Comment 3 Ciaran McCreesh 2004-08-06 05:15:09 UTC
Mike -- how about adding in a strip-optimisation-flags or somesuch to flag-o-matic? It'd have the same kind of behaviour as strip-flags but would also remove optimisations.
Comment 4 Matthieu Sozeau (RETIRED) gentoo-dev 2004-08-18 10:00:17 UTC
The ocaml compiler intentionaly ignores user's CFLAGS !
Comment 5 Ciaran McCreesh 2004-08-18 10:06:50 UTC
Intentionally ignoring CFLAGS is no good. It breaks things.
Comment 6 Martin Holzer (RETIRED) gentoo-dev 2004-08-19 05:31:18 UTC
this is really a great problem
see the hundreds of thousand bugs about wrong mplayer flags.
any good idea how to solve this ?
Comment 7 Daniel Black (RETIRED) gentoo-dev 2004-08-19 07:36:14 UTC
Create some tool that performs QA when ebuilding the product.

There is also scope for other checks such as:
- verify dependancies based on files accessed
- doing a rough check on FHS compliance
- determining files its about to cobber and the packages that provide that
- checking runtime dependancies based on script languages, dynamic libraries etc.

Or if its mainly mplayer - infiltrate the mplayer dev team and commit out all CFLAGS :-)
Comment 8 Ciaran McCreesh 2004-08-19 07:46:23 UTC
I've modified flag-o-matic locally to allow -D__CIARANM_WAS_HERE__ through. I'm now building lots and lots of apps whilst logging the compiles, and later on I'll grep through for possible matches.

I still like the "get required flags" idea.
Comment 9 Ferris McCormick (RETIRED) gentoo-dev 2004-09-24 05:39:57 UTC
Add myself to CC list.
Comment 10 Ferris McCormick (RETIRED) gentoo-dev 2005-03-27 09:08:15 UTC
x11-libx/fox=1.3.6-r2 also ignores CXXFLAGS, substituting 'no-optimization, no-architecture-consideration.'
Comment 11 Ernst Bachmann 2005-07-22 04:54:57 UTC
Just posted a fresh bug #99896, but after finding this report, I'd thought I'd 
add the info here as well. 
 
glibc ebuild filters the "-mno-tls-direct-seg-refs" gcc-3.4.4+ option, which 
makes it impossible to build a NPTL glibc which would run nicely under Xen. 
 
The culprit is the "strip-flags" function in flag-o-matic.eclass, adding 
-mno-tls-direct-seg-refs as known-good flag there locally solves the problem 
for me. 
Comment 12 Ferris McCormick (RETIRED) gentoo-dev 2005-11-13 06:54:53 UTC
It seems that sci-libs/lapack-atlas just went stable on sparc, and I notice that
the build completely ignores my CFLAGS='-O2 -mcpu=ultrasparc -pipe' and substitutes:
-fomit-frame-pointer -O3 -funroll-all-loops
This is a horrible choice for sparc: omit-frame-pointer is unneeded and the
others are probably lost in the fact that this defaults to -mv7 architecture,
guaranteeing the slowest possible execution times.  (The g77 flags are (flag is)
just -O, so the fortran portion is probably a little worse code that the c portion.)
I thought this was taken care of, but maybe only for blas-atlas.
Comment 13 Jakub Moc (RETIRED) gentoo-dev 2007-06-30 21:54:15 UTC
Nothing left here.
Comment 14 Ferris McCormick (RETIRED) gentoo-dev 2007-08-28 14:29:31 UTC
This is a useful tracker, and for sparc at least it is an ongoing problem.  We add to this bug as the need arises.
Comment 15 Mark Loeser (RETIRED) gentoo-dev 2010-09-10 19:27:36 UTC
*** Bug 319559 has been marked as a duplicate of this bug. ***
Comment 16 Martini peres 2012-03-05 12:08:25 UTC
This comment has been removed because it contained spam. -- idl0r
Comment 17 Larry the Git Cow gentoo-dev 2018-09-01 09:01:38 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9acfbf506aef6feb95d6d8c6896bc840fd609f2e

commit 9acfbf506aef6feb95d6d8c6896bc840fd609f2e
Author:     Jeroen Roovers <jer@gentoo.org>
AuthorDate: 2018-09-01 08:52:13 +0000
Commit:     Jeroen Roovers <jer@gentoo.org>
CommitDate: 2018-09-01 09:01:34 +0000

    net-libs/libssh: Set -DWITH_STACK_PROTECTOR=OFF
    
    The build system injects -fstack-protector _after_ CFLAGS, which means
    that when CFLAGS define a stronger SSP, this lowers its protection
    instead of improving it.
    
    Additionally, the test for the compiler flag succeeds on HPPA when it
    shouldn't, causing the build to fail later on:
    
    In file included from src/agent.c:53:0:
    include/libssh/priv.h:169:4: error: #error "Your system must provide a __func__ macro"
    
    Bug: https://bugs.gentoo.org/59506
    Package-Manager: Portage-2.3.48, Repoman-2.3.10

 net-libs/libssh/libssh-0.7.4.ebuild    | 1 +
 net-libs/libssh/libssh-0.7.5-r2.ebuild | 1 +
 net-libs/libssh/libssh-0.8.1.ebuild    | 1 +
 net-libs/libssh/libssh-9999.ebuild     | 1 +
 4 files changed, 4 insertions(+)