Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 59506 (cflags)

Summary: [TRACKER] packages that do not respect CFLAGS and CXXFLAGS
Product: Quality Assurance Reporter: Ciaran McCreesh <ciaran.mccreesh>
Component: TrackersAssignee: Gentoo Quality Assurance Team <qa>
Status: CONFIRMED ---    
Severity: normal CC: bertrand, esigra, fmccor, j6yNRdsH5Fc3, jakov.petrina, lssndrbarbieri, n-roeser, tcunha
Priority: High Keywords: Tracker
Version: unspecified   
Hardware: All   
OS: Linux   
See Also: https://bugs.gentoo.org/show_bug.cgi?id=677600
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on: 241044, 261375, 270860, 310437, 316095, 378645, 385995, 408519, 411471, 429498, 430816, 431054, 451446, 496354, 496368, 615748, 634724, 639462, 646012, 652172, 662552, 685982, 716730, 720888, 722694, 722698, 723742, 723938, 724162, 724280, 724950, 724954, 725452, 725994, 726276, 726388, 726570, 726858, 727052, 727440, 727492, 727962, 727974, 728048, 728084, 729452, 729898, 731214, 731216, 733696, 735062, 736132, 737046, 737048, 737198, 738860, 738898, 739098, 740246, 740284, 741106, 741634, 742836, 742839, 748438, 751436, 751439, 751616, 751622, 755449, 761700, 765382, 773985, 777645, 778536, 786243, 788943, 791019, 796827, 796887, 797493, 804450, 806442, 809779, 810323, 810721, 817770, 828529, 829853, 831693, 832814, 842006, 849533, 852707, 855941, 863251, 873655, 878057, 884129, 887257, 889058, 889610, 889794, 890983, 896242, 898296, 900933, 907741, 908481, 911887, 914286, 916577, 920455, 921365, 921382, 924203, 925673, 925928, 926805, 929248, 930131, 930583, 51593, 58956, 59280, 59507, 59508, 59509, 59510, 59511, 59513, 59514, 59537, 59709, 67070, 69678, 86874, 112432, 143661, 176240, 190534, 220739, 238106, 241052, 385951, 428070, 438046, 439094, 448862, 453456, 458486, 496358, 511098, 526194, 530928, 562164, 583148, 587820, 591888, 619436, 619674, 620532, 622576, 635680, 639468, 646756, 674918, 687412, 719166, 719174, 719184, 719186, 722082, 722178, 722192, 722358, 722360, 722384, 722394, 722396, 722398, 722400, 722648, 722812, 722814, 722816, 722818, 722820, 722824, 723072, 723748, 723936, 723956, 724060, 724066, 724068, 724070, 724072, 724074, 724076, 724160, 724282, 724284, 724286, 724808, 724810, 724812, 724814, 724818, 724864, 724942, 724944, 725048, 725050, 725052, 725054, 725056, 725058, 725060, 725062, 725064, 725066, 725070, 725072, 725074, 725076, 725078, 725080, 725082, 725084, 725086, 725088, 725092, 725222, 725224, 725228, 725232, 725238, 725542, 725546, 725548, 725552, 725556, 725558, 725998, 726002, 726004, 726010, 726054, 726270, 726278, 726370, 726376, 726382, 726386, 726484, 726632, 726670, 726854, 726856, 726890, 726892, 726910, 726912, 727048, 727076, 727096, 727194, 727196, 727198, 727200, 727202, 727204, 727212, 727276, 727494, 727558, 727772, 727776, 727778, 727782, 727958, 727970, 728024, 728036, 728038, 728040, 728042, 728050, 728082, 728144, 728146, 728158, 728322, 729450, 729572, 730010, 730012, 730056, 730136, 730204, 730528, 731212, 731744, 731944, 732350, 732694, 732878, 733604, 734044, 734236, 734264, 734350, 734908, 735708, 735712, 736493, 736838, 736884, 736940, 737058, 737060, 737300, 737420, 737574, 738818, 739046, 739194, 739216, 739218, 739288, 739290, 739336, 739370, 739372, 739526, 739972, 740324, 740500, 740652, 740706, 741190, 741638, 742437, 742602, 742608, 742776, 742809, 742953, 744046, 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, 751442, 751460, 751625, 751658, 753059, 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, 781923, 781992, 785250, 788715, 789363, 791016, 791169, 796410, 797724, 798498, 799245, 802615, 802798, 802852, 804462, 808960, 809119, 812707, 814311, 815127, 815637, 815697, 815700, 818670, 820068, 821715, 822231, 824202, 824938, 825410, 826354, 827236, 828058, 829871, 829905, 829908, 830405, 830499, 830717, 831405, 831997, 832322, 832503, 832612, 836271, 836657, 837278, 840011, 850109, 852776, 853979, 854555, 857501, 857510, 858242, 861821, 865377, 865643, 866161, 867424, 868540, 870586, 878863, 880309, 880717, 882141, 882653, 889364, 889464, 889748, 890632, 894440, 894494, 894692, 895974, 902505, 902531, 902537, 902795, 903043, 903563, 904155, 904156, 904661, 905991, 907056, 910534, 911312, 911692, 911822, 911855, 911857, 911858, 911859, 911884, 912194, 913417, 913916, 914267, 914269, 914375, 919975, 920637, 924039, 924169, 925261, 927322, 927723, 928672    
Bug Blocks:    

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(+)