Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 465238 - sys-apps/elfix-0.8.1[-ptpax] fails to compile with dev-libs/libelf
Summary: sys-apps/elfix-0.8.1[-ptpax] fails to compile with dev-libs/libelf
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Hardened (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: The Gentoo Linux Hardened Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-04-09 11:28 UTC by Maxim Kammerer
Modified: 2014-07-29 19:08 UTC (History)
0 users

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 Maxim Kammerer 2013-04-09 11:28:47 UTC
make[2]: Entering directory `/var/tmp/portage/sys-apps/elfix-0.8.1/work/elfix-0.8.1/src'
i686-pc-linux-gnu-gcc -DHAVE_CONFIG_H -I. -I..     -Os -march=pentium3 -mtune=core2 -mfpmath=sse -fomit-frame-pointer -pipe -UPTPAX -DNEED_PAX_DECLS -DXTPAX -c fix-gnustack.c
fix-gnustack.c: In function ‘main’:
fix-gnustack.c:102:27: error: ‘ELF_C_RDWR_MMAP’ undeclared (first use in this function)
fix-gnustack.c:102:27: note: each undeclared identifier is reported only once for each function it appears in
make[2]: *** [fix-gnustack.o] Error 1

ELF_C_RDWR_MMAP is only defined by elfutils, but shouldn't that be ignored anyway with USE=-ptpax?
Comment 1 Anthony Basile gentoo-dev 2013-04-09 11:37:25 UTC
Yep, known issue. Thanks for opening the bug.  As you said, there is no ELF_C_RDWR_MMAP in libelf and I can't drop it down to just ELF_C_RDWR.

The problem here is that elfix is supposed to be a suite of binaries to fix elfs on a hardened system.  So while paxctl-ng doesn't touch any elf stuff with USE="-ptpax", fix-gnustack still does and must.

I've got some choices: 1) get ELF_C_RDWR_MMAP into libelf, 2) see if I can get away with ELF_C_RDWR in fix-gnustack, 3) only build fix-gnustack if elfuitls is available.
Comment 2 Maxim Kammerer 2013-04-09 11:50:19 UTC
Well, you know better, but (2) and (3) look the easiest, although (3) looks like it will cause some kind of automagic dependency.
Comment 3 Anthony Basile gentoo-dev 2013-04-09 15:31:11 UTC
(In reply to comment #2)
> Well, you know better, but (2) and (3) look the easiest, although (3) looks
> like it will cause some kind of automagic dependency.

Of course that would have to be avoided.
Comment 4 Maxim Kammerer 2013-04-12 07:24:25 UTC
After experimenting with elfix a bit, I suggest disabling fix-gnustack for USE=-ptpax. If the user doesn't need support for changing ELF header flags, then having fix-gnustack around doesn't make much sense.

I would also separate pypaxctl, revdep-pax, migrate-pax and the Python plugin into something like USE=tools, since these tools are arguably needed only on a development system.
Comment 5 Maxim Kammerer 2013-05-18 13:46:54 UTC
Hi, any news?
Comment 6 Anthony Basile gentoo-dev 2013-05-18 14:32:09 UTC
(In reply to comment #5)
> Hi, any news?

Thanks for the ping.  I hadn't forgotten but until the semester ended, I could not get to any xattr pax stuff.
Comment 7 Anthony Basile gentoo-dev 2013-05-20 22:49:42 UTC
Please test elfix-0.8.2
Comment 8 Maxim Kammerer 2013-05-21 10:29:19 UTC
I upgraded elfix+pypax to 0.8.2 without issues, paxctl-ng works fine, fix-gnustack is not installed.
Comment 9 Anthony Basile gentoo-dev 2013-05-21 10:36:40 UTC
(In reply to comment #8)
> I upgraded elfix+pypax to 0.8.2 without issues, paxctl-ng works fine,
> fix-gnustack is not installed.

Correct.  There are problems with ELF_C_RDWR{,_MMAP} in libelf.  I'm looking into it now.
Comment 10 Anthony Basile gentoo-dev 2013-05-21 14:44:11 UTC
(In reply to comment #9)
> (In reply to comment #8)
> > I upgraded elfix+pypax to 0.8.2 without issues, paxctl-ng works fine,
> > fix-gnustack is not installed.
> 
> Correct.  There are problems with ELF_C_RDWR{,_MMAP} in libelf.  I'm looking
> into it now.


Okay bug #470882 opened to see this through.