Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 546692 - sys-libs/musl: Install sys-libs/fortify-headers for use with sys-devel/gcc
Summary: sys-libs/musl: Install sys-libs/fortify-headers for use with sys-devel/gcc
Status: CONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: Normal enhancement (vote)
Assignee: Anthony Basile
URL: http://git.2f30.org/fortify-headers/
Whiteboard:
Keywords:
Depends on:
Blocks: musl-porting
  Show dependency tree
 
Reported: 2015-04-15 23:22 UTC by Anthony Basile
Modified: 2022-06-18 00:53 UTC (History)
4 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 Anthony Basile gentoo-dev 2015-04-15 23:22:43 UTC
fortify-headers is a stand alone implementation of fortify sources as discussed at http://gcc.gnu.org/ml/gcc-patches/2004-09/msg02055.html.  It is libc agnostic and can be used with musl as alpine linux does.

We can install fortify-headers at /usr/include/fortify if USE=fortify is given.

Reproducible: Always
Comment 1 Felix Janda 2015-04-16 17:23:13 UTC
Since it is standalone, why not package it seperately?
Comment 2 Anthony Basile gentoo-dev 2015-04-18 11:37:11 UTC
(In reply to Felix Janda from comment #1)
> Since it is standalone, why not package it seperately?

I was thinking of it as a separate package on which the musl ebuild depends conditionally with USE=fortify.  However, to make use of it, you need to add the correct -I line and I was thinking of maybe patching the spec files to include that in musl.
Comment 3 Felix Janda 2015-04-18 16:51:05 UTC
I see, sounds sensible.

Just for reference:

http://git.alpinelinux.org/cgit/aports/tree/main/gcc/gcc-4.9-musl-fortify.patch?id=067a4f28825478911bb62be3b8da758d9722753e

is used in alpine to make gcc first search for the fortify headers.
However it depends on other gcc patches they use.
Comment 4 Anthony Basile gentoo-dev 2015-04-19 10:48:27 UTC
(In reply to Felix Janda from comment #3)
> I see, sounds sensible.
> 
> Just for reference:
> 
> http://git.alpinelinux.org/cgit/aports/tree/main/gcc/gcc-4.9-musl-fortify.
> patch?id=067a4f28825478911bb62be3b8da758d9722753e
> 
> is used in alpine to make gcc first search for the fortify headers.
> However it depends on other gcc patches they use.

Hmm .. don't like it.  I'd rather go with spec files where we can just add another spec which can be selected using gcc-config.
Comment 5 Felix Janda 2015-04-19 21:00:30 UTC
The alpine patch was just for reference.

So we could have a fortify.specs à la

%rename cc1 old_cc1

*cc1:
-isystem /usr/include/fortify %(old_cc1)

which would need to be added to GCC_SPECS, say to all variants except vanilla.
Comment 6 Anthony Basile gentoo-dev 2015-05-15 13:51:35 UTC
sys-libs/fortify-headers is not on the gentoo tree.
Comment 7 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2021-11-10 04:26:06 UTC
(In reply to Anthony Basile from comment #6)
> sys-libs/fortify-headers is not on the gentoo tree.

It is now :)

(In reply to Felix Janda from comment #3)
> I see, sounds sensible.
> 
> Just for reference:
> 
> http://git.alpinelinux.org/cgit/aports/tree/main/gcc/gcc-4.9-musl-fortify.
> patch?id=067a4f28825478911bb62be3b8da758d9722753e
> 
> is used in alpine to make gcc first search for the fortify headers.
> However it depends on other gcc patches they use.

Latest patch: https://git.alpinelinux.org/aports/tree/main/gcc/0020-add-fortify-headers-paths.patch.

But yeah, I'd prefer spec if we can too I suppose.
Comment 8 Anthony Basile gentoo-dev 2021-11-10 20:59:52 UTC
(In reply to Sam James from comment #7)
> (In reply to Anthony Basile from comment #6)
> > sys-libs/fortify-headers is not on the gentoo tree.
> 
> It is now :)
> 

I meant to say "sys-libs/fortify-headers is NOW on the gentoo tree."

Sam I didn't look carefully, but do we need the sys-libs/fortify-headers package now?
Comment 9 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2021-11-19 03:24:42 UTC
(In reply to Anthony Basile from comment #8)
> (In reply to Sam James from comment #7)
> > (In reply to Anthony Basile from comment #6)
> > > sys-libs/fortify-headers is not on the gentoo tree.
> > 
> > It is now :)
> > 
> 
> I meant to say "sys-libs/fortify-headers is NOW on the gentoo tree."
> 

Ah ok!

> Sam I didn't look carefully, but do we need the sys-libs/fortify-headers
> package now?

I think we still need it now, musl doesn't want to implement these (https://wiki.musl-libc.org/future-ideas.html), so we just need to figure out how we want to force it in for now.

Specs or a patch. I think a patch is easier for now while we test it out, then move to specs once we're happy?
Comment 10 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-04-27 02:38:54 UTC
In #musl, dalias and some others mentioned issues with the current impl which need fixing.