Red Hat Bugzilla – Bug 450551
OCaml binaries give rpmlint warning about executable-stack
Last modified: 2009-11-18 08:09:32 EST
ocaml-gettext-devel.x86_64: W: executable-stack /usr/bin/ocaml-gettext
The binary declares the stack as executable. Executable stack is usually an
error as it is only needed if the code contains GCC trampolines or similar
constructs which uses code on the stack. One common source for needlessly
executable stack cases are object files built from assembler files which don't
define a proper .note.GNU-stack section.
This seems to happen with any binary built with ocamlopt on Rawhide. It
seems like a new restriction introduced by rpmlint rather than anything
that has changed about OCaml / Rawhide.
I'm going to ask upstream if they know if executable stacks are necessary
and/or could add the GNU note to disable them if that's possible.
I find that this has already been discussed upstream:
Useful Gentoo page on the subject:
Upstream asked Gentoo to come up with a solution, but as far as I'm aware they didn't,
so I'll investigate making a patch for the ocamlopt compiler to resolve this.
Created attachment 308730 [details]
Candidate patch for 3.11-dev12.
I successfully generated a binary with a non-executable stack. Now I need to
backport this patch to 3.10.2 (for Rawhide) so I can check that it makes
OK, verified this fixes the warning in 3.10.2 as well.
Rebuilt with this patch in Rawhide (ocaml-3.10.2-4).
> I posted a patch which should fix the issue that ocamlopt generates
> binaries with executable stacks:
> However this patch affects every assembly target, far more than I
> could possibly test. Could people using OCaml on non-Linux platforms
> have a look at the patch, or even test it for me?
I'm pretty sure this patch is Linux-specific. My fear is that it
might be specific to particular versions of binutils and/or particular
Linux distributions... I smell a portability nightmare!
Note that in 3.11, the "configure" script will have options to specify
how to call the assembler (for ocamlopt-generated assembly code and
for the hand-written asm files in the runtime system). So it might be
sufficient to configure the Gentoo packages with e.g.
configure -as "as --noexecstack" -aspp "gcc -c -Wa,--noexecstack"
This could be one of the rare cases where addressing the issue at the
level of the packages is safer than by changing the source distribution.
- Xavier Leroy
In the meantime, package builds that use OCaml can modify their ELF files by
doing "execstack -c"; then the programs will run without an executable stack.
Upstream have actually added a part of my patch in (what
will become) OCaml 3.11.
This bug appears to have been reported against 'rawhide' during the Fedora 10 development cycle.
Changing version to '10'.
More information and reason for this action is here:
This message is a reminder that Fedora 10 is nearing its end of life.
Approximately 30 (thirty) days from now Fedora will stop maintaining
and issuing updates for Fedora 10. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as WONTFIX if it remains open with a Fedora
'version' of '10'.
Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version'
to a later Fedora version prior to Fedora 10's end of life.
Bug Reporter: Thank you for reporting this issue and we are sorry that
we may not be able to fix it before Fedora 10 is end of life. If you
would still like to see this bug fixed and are able to reproduce it
against a later version of Fedora please change the 'version' of this
bug to the applicable version. If you are unable to change the version,
please add a comment here and someone will do it for you.
Although we aim to fix as many bugs as possible during every release's
lifetime, sometimes those efforts are overtaken by events. Often a
more recent Fedora release includes newer upstream software that fixes
bugs or makes them obsolete.
The process we are following is described here:
Closing - this is upstream & in recent Fedora.