Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 50791 - hardened-gcc is deprecated yet still appears in ebuilds.
Summary: hardened-gcc is deprecated yet still appears in ebuilds.
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Hardened (show other bugs)
Hardware: All All
: High normal (vote)
Assignee: Alexander Gabert (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-05-11 13:17 UTC by Mr. Bones. (RETIRED)
Modified: 2004-06-02 13:27 UTC (History)
4 users (show)

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


Attachments
list of ebuilds (hardened-gcc,2.13 KB, text/plain)
2004-05-11 13:38 UTC, Mr. Bones. (RETIRED)
Details
dosfstools-2.10.ebuild.diff (dosfstools-2.10.ebuild.diff,1.13 KB, patch)
2004-05-13 17:47 UTC, solar (RETIRED)
Details | Diff
dosfstools-2.10.ebuild.diff (2) (dosfstools-2.10.ebuild.diff,1.38 KB, patch)
2004-05-13 18:30 UTC, solar (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Mr. Bones. (RETIRED) gentoo-dev 2004-05-11 13:17:32 UTC
I'll attach list of ebuilds that still reference hardened-gcc.
Comment 1 Mr. Bones. (RETIRED) gentoo-dev 2004-05-11 13:38:01 UTC
Created attachment 31209 [details]
list of ebuilds
Comment 2 Alexander Gabert (RETIRED) gentoo-dev 2004-05-12 01:54:36 UTC
yes, the plan is clear from now on:

replace has_version hardened-gcc && filter-flags with a pure call to the filter-flags logic

so that it does not depend on hardened-gcc any more and the eclass can do the job of emitting the exclude chain arguments to the compiler CFLAGS and LDFLAGS

sinc.

Alex
Comment 3 Alexander Gabert (RETIRED) gentoo-dev 2004-05-13 07:24:16 UTC
all ebuilds have been cleared from occurrences of hardened-gcc and complimentary logic has been added,

sinc.

Alex
Comment 4 Mr. Bones. (RETIRED) gentoo-dev 2004-05-13 11:02:59 UTC
Can you tidy up the commented code in sys-fs/dosfstools please?
Comment 5 solar (RETIRED) gentoo-dev 2004-05-13 11:28:14 UTC
pappy,
The check in dosfstools is incorrect.
Please test these things before you make cvs commits
This is why I had to force sed love on the Makefile before.

The safe thing to probably do here is to force -fno-PIC/-fno-pic into the makefile either as a patch or a sed hack.
------------------------------------------------------

simple dosfstools # emerge dosfstools
Calculating dependencies ...done!
>>> emerge (1 of 1) sys-fs/dosfstools-2.10 to /
>>> Downloading http://open-systems.ufl.edu/mirrors/gentoo/distfiles/dosfstools-2.10.src.tar.gz
--14:23:41--  http://open-systems.ufl.edu/mirrors/gentoo/distfiles/dosfstools-2.10.src.tar.gz
           => `/usr/portage/distfiles/dosfstools-2.10.src.tar.gz'
Resolving open-systems.ufl.edu... 128.227.74.66
Connecting to open-systems.ufl.edu[128.227.74.66]:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 66,759 [application/x-tar]

100%[================================================================================================================>] 66,759        --.--K/s             

14:23:42 (462.46 KB/s) - `/usr/portage/distfiles/dosfstools-2.10.src.tar.gz' saved [66759/66759]

>>> md5 src_uri ;-) dosfstools-2.10.src.tar.gz
>>> Unpacking source...
>>> Unpacking dosfstools-2.10.src.tar.gz to /var/tmp/portage/dosfstools-2.10/work
 * Applying errno.patch...                                                                                                                            [ ok ] * Applying dosfstools-2.10-2.6.headers.patch...                                                                                                      [ ok ]>>> Source unpacked.
make -C mkdosfs all
make[1]: Entering directory `/var/tmp/portage/dosfstools-2.10/work/dosfstools-2.10/mkdosfs'
gcc -O2 -fomit-frame-pointer -Wall  -c mkdosfs.c -o mkdosfs.o
mkdosfs.c: In function `_llseek':
mkdosfs.c:110: error: can't find a register in class `BREG' while reloading `asm'
make[1]: *** [mkdosfs.o] Error 1
make[1]: Leaving directory `/var/tmp/portage/dosfstools-2.10/work/dosfstools-2.10/mkdosfs'
make: *** [all] Error 2

!!! ERROR: sys-fs/dosfstools-2.10 failed.
!!! Function src_compile, Line 36, Exitcode 2
!!! (no error message)
Comment 6 solar (RETIRED) gentoo-dev 2004-05-13 17:47:52 UTC
Created attachment 31379 [details, diff]
dosfstools-2.10.ebuild.diff

pappy this compiles for me. arch x86 is (optional?)
Comment 7 Mr. Bones. (RETIRED) gentoo-dev 2004-05-13 18:00:01 UTC
check your disk ops or I will hunt you down.  sed ... || die
Comment 8 solar (RETIRED) gentoo-dev 2004-05-13 18:30:13 UTC
Created attachment 31384 [details, diff]
dosfstools-2.10.ebuild.diff (2)

this also "compiles" for me with new and improved mr_bones code :)
Comment 9 Mr. Bones. (RETIRED) gentoo-dev 2004-05-13 18:34:32 UTC
yeah, I like it.  someone add this to the ebuild howto. ;-)
Comment 10 Alexander Gabert (RETIRED) gentoo-dev 2004-05-14 01:13:41 UTC
According to the recent discussion on -dev, the system should only and purely depend on the recognition of global CFLAGS by the respective Makefiles.

This means, in the case of dosfstools, that SED logic to manipulate the Makefiles is deprecated.

Does dosfstools contain Makefiles that do not recognize CFLAGS given to it?

But we learned that only the global CFLAGS should be the way for exclusion logic to be introduced.

So i added filter-flags -fPIC and removed the SED logic depending on the existence of hardened-gcc.

In a perfect world, as we live in such a perfect world, this works.
This is what i learned through the discussion on the mailing lists.

Do you really consider me a stupid fool now or someone who does not play nice and according to the rules?

I do not think this needs to become a confrontation or argument about the needed technical changes.  The mailing list wanted it to work this way.

My opinion: if the dosfstools package does not recognize global CFLAGS and act accordingly to our changes to the CFLAGS, the package maintainer should always feel free to correct the Makefile.

Well, the hardened team can even support those efforts.

But it is not my job to deal with broken packages only because i am introducing a default PIE SSP compiler to Gentoo Hardened.

And i doubt that a hardened machine will ever see the dosfstools packages getting compiled on a mission critical dns, mail or web server.

Make your choice, it is yours.

Sincerely,

Alex
Comment 11 Alexander Gabert (RETIRED) gentoo-dev 2004-05-14 02:41:33 UTC
this is a compromise we could suggest to the base-system people for improving the behaviour of dosfstools in respect to hardened gcc compiling:

src_compile() {

    HARDENED_CFLAGS="`test_flag -fno-pic` `test_flag -nopie` `test_flag -fno-stack-protector`"

    # this package does *not* play well with optimisations
    # please dont change to: make OPTFLAGS="${CFLAGS}"
    make OPTFLAGS="${HARDENED_CFLAGS}" || die
}

tell me if you want that to show up in all dosfstools packages, it is similar logic like you can find in GRUB and LILO ebuilds

Alex
Comment 12 Mr. Bones. (RETIRED) gentoo-dev 2004-05-25 12:37:06 UTC
hardened-gcc looks to be gone to me so can this bug be closed?
Comment 13 Mr. Bones. (RETIRED) gentoo-dev 2004-06-02 13:27:30 UTC
Ok, seems like this is cleared up.

One final note:

USE="hardened" emerge gcc obsoletes hardened-gcc

At least, according to Pappy. ;-)

Thanks for taking care of this.