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: RESOLVED FIXED
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 Walter
Modified: 2020-02-28 13:38 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 Walter
Details
emerge --info (info.txt,6.41 KB, text/plain)
2013-04-19 18:53 UTC, Markus Walter
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Markus Walter 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 Walter 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).
Comment 8 Larry the Git Cow gentoo-dev 2020-02-28 13:38:17 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4bbb8b0f1cb8b3c8a42775c5077e610ad7f4f558

commit 4bbb8b0f1cb8b3c8a42775c5077e610ad7f4f558
Author:     Michael Orlitzky <mjo@gentoo.org>
AuthorDate: 2020-02-28 13:34:04 +0000
Commit:     Michael Orlitzky <mjo@gentoo.org>
CommitDate: 2020-02-28 13:36:47 +0000

    sci-mathematics/gmp-ecm: new EAPI=7 revision.
    
    The dependencies and build system of gmp-ecm have been improved over
    the years, and much of the cruft in the ebuild could simply be
    deleted. This commit adds an -r2, based on François Bissey's ebuild in
    the sage-on-gentoo overlay, to modernize things. I've manually verified
    the diff for sanity, and the test suite passes for me on amd64.
    
    Closes: https://bugs.gentoo.org/466498
    Package-Manager: Portage-2.3.84, Repoman-2.3.20
    Signed-off-by: Michael Orlitzky <mjo@gentoo.org>

 sci-mathematics/gmp-ecm/gmp-ecm-7.0.4-r2.ebuild | 36 +++++++++++++++++++++++++
 1 file changed, 36 insertions(+)