1 |
Hi, |
2 |
|
3 |
On Tuesday 09 November 2010 09:19:54 François Bissey wrote: |
4 |
> > Hi, |
5 |
> > |
6 |
> > my next migration victim will be mpir, the friendly clone of gmp. The |
7 |
> > current ebuild is the same in sage-on-gentoo and science. It has this |
8 |
> > assembler stuff in it that I don't understand. Who did this? What is |
9 |
> > the latest here, can we remove the fat TODO-banner (or DO it?). |
10 |
> > |
11 |
> > Any other hints/objections? (Yes, I know that there is a bump |
12 |
> > waiting...) |
13 |
> |
14 |
> Hi Thomas, |
15 |
> |
16 |
> Christopher did it. mpir like gmp suffer from executable stacks. |
17 |
|
18 |
I followed the instructions listed in number 6 of the following page: |
19 |
http://www.gentoo.org/proj/en/hardened/gnu-stack.xml . However, the fix is |
20 |
incomplete (some architectures still have executable stacks) and I had some |
21 |
problems with BASH: |
22 |
|
23 |
for i in $(find . -type f -name '*.asm') ; do |
24 |
echo $i >/dev/null |
25 |
cat >> $i <<-EOF |
26 |
#if defined(__linux__) && defined(__ELF__) |
27 |
.section .note.GNU-stack,"",%progbits |
28 |
#endif |
29 |
EOF |
30 |
done |
31 |
|
32 |
If I remove the line with "echo" (which *should* be completely useless), the |
33 |
cat command does not patch files - WHY ?! Also, mpir seemed to have dropped |
34 |
yasm beginning with mpir-2.1 (?), so I think at least one loop in mpir's |
35 |
ebuild is superfluous. |
36 |
|
37 |
> There are talk on sage-devel which is very close to mpir upstream |
38 |
> to take a different approach: using an m4 macro and a linker flag |
39 |
> to remove them -Wl,-z,noexecstack. |
40 |
|
41 |
This seems to be a better idea. |
42 |
|
43 |
> The motivation to fix this is fedora 14 which doesn't allow executable |
44 |
> stacks by default. |
45 |
> I think the warning could be removed for now but the ebuild will probably |
46 |
> need a little TLC in the near future. |
47 |
> |
48 |
> Francois |
49 |
|
50 |
Christopher |