Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 466498 - sci-mathematics/gmp-ecm-6.4.4-r1 fails tests and probably runtime on hardened
Summary: sci-mathematics/gmp-ecm-6.4.4-r1 fails tests and probably runtime on hardened
Status: UNCONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Hardened (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Patrick Lauer
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-04-19 18:52 UTC by Markus Oehme
Modified: 2017-10-27 07:01 UTC (History)
2 users (show)

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


Attachments
build log (sci-mathematics:gmp-ecm-6.4.4-r1:20130419-184703.log,56.72 KB, text/plain)
2013-04-19 18:52 UTC, Markus Oehme
Details
emerge --info (info.txt,6.41 KB, text/plain)
2013-04-19 18:53 UTC, Markus Oehme
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Markus Oehme 2013-04-19 18:52:50 UTC
Created attachment 346038 [details]
build log

On my hardened ~amd64 system I tried to merge gmp-ecm. This resulted in the following error after starting the test suite.

make[1]: Leaving directory `/var/tmp/portage/sci-mathematics/gmp-ecm-6.4.4-r1/work/ecm-6.4.4'
./test.pp1 ./ecm
/var/tmp/portage/sci-mathematics/gmp-ecm-6.4.4-r1/work/ecm-6.4.4/.libs/ecm: error while loading shared libraries: libecm.so.0: cannot enable executable stack as shared object requires: Permission denied
############### ERROR ###############
Expected return code 8 but got 127
make: *** [check] Error 1
Comment 1 Markus Oehme 2013-04-19 18:53:04 UTC
Created attachment 346040 [details]
emerge --info
Comment 2 François Bissey 2013-04-23 02:49:46 UTC
There is an "append-ldflags "-Wl,-z,noexecstack" in the ebuild to take care of this problem. Unfortunately it doesn't seem to work. I cannot that this flag is used at all during linking.
Comment 3 François Bissey 2013-04-23 03:12:46 UTC
OK appending the LDFLAGS during src_install is not working because it is not picked up by emake. Calling "emake LDFLAGS="${LDFLAGS}"" instead of plain emake will work. But it is even better to move the append-flags call into src_configure where LDFLAGS will be picked up by configure.
Comment 4 Xiami 2016-08-01 09:00:38 UTC
(In reply to Francois Bissey from comment #3)
> OK appending the LDFLAGS during src_install is not working because it is not
> picked up by emake. Calling "emake LDFLAGS="${LDFLAGS}"" instead of plain
> emake will work. But it is even better to move the append-flags call into
> src_configure where LDFLAGS will be picked up by configure.

move append-ldflags "-Wl,-z,noexecstack" from src_compile to src_configure (before econf) works. Thank you!
Comment 5 François Bissey 2016-08-01 09:19:10 UTC
Well that was a blast from the past. I have a newer ebuild in the sage-on-gentoo overlay. Including gmp-emc-7.0 now.
It is quite complicated to get upstream to fix this nicely. The assembly files are generated and we want to insert the proper assembly statement only in key architectures. It is quite subtle.
Comment 6 Xiami 2016-10-25 03:10:49 UTC
Got it. It's indeed a bit hard to handle such type programs.

I have both overlay version and official static-linked version now.

So... we can close this bug ?
Comment 7 François Bissey 2016-10-25 03:42:39 UTC
Well, it is kind of definitely fixed upstream in 7.0.4. They add the flag on linux during configure. I would have favored the assembly to be fixed but that was the easiest way. 7.0.4 is available in the sage-on-gentoo overlay but currently in package.mask because sage doesn't work yet with that version (interface change).