Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 74754 - mono-1.0.5-r1 fails with NX protections
Summary: mono-1.0.5-r1 fails with NX protections
Status: RESOLVED NEEDINFO
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: x86 Linux
: High normal (vote)
Assignee: dotnet project
URL:
Whiteboard:
Keywords:
: 139885 142973 (view as bug list)
Depends on:
Blocks:
 
Reported: 2004-12-17 08:46 UTC by Mystilleef
Modified: 2007-02-28 05:33 UTC (History)
13 users (show)

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


Attachments
This should make emerging with hardened systems possible. (mono-1.0.6-paxctl.diff,1.05 KB, patch)
2005-03-02 09:46 UTC, Jerzy Kozera
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Mystilleef 2004-12-17 08:46:51 UTC
I using a hardened box. Mono fails to compile with the following error:


 /bin/install -c -m 644 'mcs.exe' '/var/tmp/portage/mono-1.0.5-r1/image//usr/lib/mono/1.0//mcs.exe'
 /bin/install -c -m 644 'mbas.exe' '/var/tmp/portage/mono-1.0.5-r1/image//usr/lib/mono/1.0//mbas.exe'
test -z "/usr/lib/mono/2.0/" || mkdir -p -- . "/var/tmp/portage/mono-1.0.5-r1/image//usr/lib/mono/2.0/"
 /bin/install -c -m 644 'gmcs.exe' '/var/tmp/portage/mono-1.0.5-r1/image//usr/lib/mono/2.0//gmcs.exe'
make[3]: Leaving directory `/tmp/portage/mono-1.0.5-r1/work/mono-1.0.5/runtime'
make[2]: Leaving directory `/tmp/portage/mono-1.0.5-r1/work/mono-1.0.5/runtime'
Making install in net_1_1
make[2]: Entering directory `/tmp/portage/mono-1.0.5-r1/work/mono-1.0.5/runtime/net_1_1'
make[3]: Entering directory `/tmp/portage/mono-1.0.5-r1/work/mono-1.0.5/runtime/net_1_1'
make[3]: Nothing to be done for `install-exec-am'.
test -z "/usr/lib" || mkdir -p -- . "/var/tmp/portage/mono-1.0.5-r1/image//usr/lib"
 /bin/install -c -m 644 'mscorlib.dll' '/var/tmp/portage/mono-1.0.5-r1/image//usr/lib/mscorlib.dll'
MONO_PATH=. ../../mono/mini/mono --config ../../data/config ./../gacutil.exe /i ./Accessibility.dll /f /package 1.0 /gacdir /usr/lib /root /var/tmp/portage/mono-1.0.5-r1/image//usr/lib
/bin/sh: line 1: 10269 Killed                  MONO_PATH=. /bin/sh ../../libtool --mode=execute ../../mono/mini/mono --config ../../data/config ./../gacutil.exe /i ./$i /f /package 1.0 /gacdir /usr/lib /root /var/tmp/portage/mono-1.0.5-r1/image//usr/lib
make[3]: *** [install-data-local] Error 1
make[3]: Leaving directory `/tmp/portage/mono-1.0.5-r1/work/mono-1.0.5/runtime/net_1_1'
make[2]: *** [install-am] Error 2
make[2]: Leaving directory `/tmp/portage/mono-1.0.5-r1/work/mono-1.0.5/runtime/net_1_1'
make[1]: *** [install-recursive] Error 1
make[1]: Leaving directory `/tmp/portage/mono-1.0.5-r1/work/mono-1.0.5/runtime'
make: *** [install-recursive] Error 1

!!! ERROR: dev-dotnet/mono-1.0.5-r1 failed.
!!! Function src_install, Line 63, Exitcode 2
!!! (no error message)
!!! If you need support, post the topmost build error, NOT this status message.



Reproducible: Always
Steps to Reproduce:




Portage 2.0.51-r8 (hardened/x86, gcc-3.4.3, glibc-2.3.4.20041102-r0,
2.6.7-hardened-r17 i686)
=================================================================
System uname: 2.6.7-hardened-r17 i686 AMD Athlon(tm) Processor
Gentoo Base System version 1.6.8
Python:              dev-lang/python-2.3.4 [2.3.4 (#1, Dec 15 2004, 08:16:14)]
ccache version 2.3 [enabled]
dev-lang/python:     2.3.4
sys-devel/autoconf:  2.59-r6, 2.13
sys-devel/automake:  1.8.5-r2, 1.5, 1.4_p6, 1.6.3, 1.7.9, 1.9.3
sys-devel/binutils:  2.15.92.0.2-r2
sys-devel/libtool:   1.5.10-r1
virtual/os-headers:  2.6.8.1-r1
ACCEPT_KEYWORDS="x86 ~x86"
AUTOCLEAN="yes"
CFLAGS="-w -pipe -funit-at-a-time -ftracer      -fbranch-target-load-optimize2 
-frename-registers -fweb -march=athlon -Os -fomit-frame-pointer  -fforce-addr -s
-fPIC -fpic"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3/share/config
/usr/lib/X11/xkb /usr/lib/mozilla/defaults/pref /usr/share/config
/usr/share/texmf/dvipdfm/config/ /usr/share/texmf/dvips/config/
/usr/share/texmf/tex/generic/config/ /usr/share/texmf/tex/platex/config/
/usr/share/texmf/xdvi/ /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d"
CXXFLAGS="-w -pipe -funit-at-a-time -ftracer    -fbranch-target-load-optimize2 
-frename-registers -fweb -march=athlon -Os -fomit-frame-pointer  -fforce-addr -s
-fPIC -fpic"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoaddcvs ccache digest distlocks fixpackages sandbox sfperms strict"
GENTOO_MIRRORS="http://mirror.datapipe.net/gentoo
http://mirror.datapipe.net/gentoo http://open-systems.ufl.edu/mirrors/gentoo"
MAKEOPTS="-j2"
PKGDIR="/usr/portage//packages/x86/"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage /usr/local/bmg-main"
SYNC="rsync://rsync.namerica.gentoo.org/gentoo-portage"
USE="3dnow 3dnowex X alsa avi bindist bonobo cdparanoia cdr crypt curl dlloader
dvd encode erandom esd faad fam flac gif gnome gnutls gstreamer gtk gtk2 hal
hardened howl imagemagick imlib ithreads jpeg libwww live mad mmx mmx2 mng mpeg
ncurses network nls nptl nptlonly oggvorbis opengl oss pam pic pie png quicktime
readline real rtc speex spell ssl svg tcpd tetex theora threads tiff truetype
truetype-fonts unicode usb userlocales wmf x86 xine xml xml2 xv zlib"
Comment 1 Peter Johanson (RETIRED) gentoo-dev 2004-12-17 09:10:16 UTC
iirc, mono + hardened don't currently get along, but i know there was some work on it by someone not so long ago. I'll see what i can dig up.
Comment 2 lain 2005-01-09 17:22:17 UTC
Same here on ~amd64, non-hardened.

Portage 2.0.51-r8 (default-linux/amd64/2004.3, gcc-3.4.3, glibc-2.3.4.20041102-r0, 2.6.10-gentoo-r2 x86_64)
=================================================================
System uname: 2.6.10-gentoo-r2 x86_64 AMD Athlon(tm) 64 Processor 3200+
Gentoo Base System version 1.6.8
Python:              dev-lang/python-2.3.4 [2.3.4 (#1, Jan  8 2005, 01:15:13)]
dev-lang/python:     2.3.4
sys-devel/autoconf:  2.59-r6, 2.13
sys-devel/automake:  1.8.5-r2, 1.5, 1.4_p6, 1.6.3, 1.7.9, 1.9.3
sys-devel/binutils:  2.15.92.0.2-r2
sys-devel/libtool:   1.5.2-r7
virtual/os-headers:  2.6.8.1-r2
ACCEPT_KEYWORDS="amd64 ~amd64"
AUTOCLEAN="yes"
CFLAGS="-O2 -fomit-frame-pointer -fweb -ftracer -ffast-math"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3.3/env /usr/kde/3.3/share/config /usr/kde/3.3/shutdown /usr/kde/3/share/config /usr/lib/X11/xkb /usr/lib/mozilla/defaults/pref /usr/share/config /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d"
CXXFLAGS="-O2 -pipe -fomit-frame-pointer"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoaddcvs autoconfig ccache distlocks sandbox"
GENTOO_MIRRORS="http://distfiles.gentoo.org http://distro.ibiblio.org/pub/Linux/distributions/gentoo"
LDFLAGS=""
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/overlays/lila"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="X a52 aac aalib acpi aim alsa amd64 apache2 audiofile avi bash-completion berkdb bitmap-fonts bmp bonobo bzlib canna cdda cddb cdio cdparanoia cdr cjk crypt cups curl dbus dga dio divx4linux dvd dvdr dvdread esd ethereal exif faac faad fam ffmpeg flac font-server freetype ftp gd gd-external gdbm gif gnome gnutls gpm gstreamer gtk gtk2 gtkhtml gzip hal httpd icq imagemagick imap imlib inifile ipv6 jabber java jikes jpeg lcms libcaca libclamav libwww live lzo mad maildir matroska memlimit mikmod mime mmap mng mozilla moznomail mozsvg mp3 mpeg mpeg2 multilib mysql ncurses network nls nptl nptlonly nvidia oav offensive ogg oggvorbis openal opengl pam pcre perl php pic pie png python quicktime readline real ruby samba sasl scanner sdl sndfile sox speex spell ssl stream svg tcltk tcpd theora tiff truetype truetype-fonts type1-fonts usb utf8 vcd vidix vorbis wmf wxwindows xanim xine xml2 xmms xosd xpm xprint xv xvid xvmc zlib"
Comment 3 Peter Johanson (RETIRED) gentoo-dev 2005-01-10 19:32:51 UTC
Original poster, we already do "strip-flags" in the ebuild, but to be safe, can you please emerge with no CFLAGS set (or at least with saner CFLAGS) to be sure?

Alasdair, can you post the exact error you are getting, just so i'm sure you're getting the same bug? Thanks.
Comment 4 Mystilleef 2005-01-12 23:50:58 UTC
Unfortunately, I just rebuilt my system without hardening it. I can't follow up on this issue any longer.
Comment 5 Peter Johanson (RETIRED) gentoo-dev 2005-01-18 10:48:46 UTC
Ok, thanks Mystilleef for the update. Alasdair?
Comment 6 (disabled) 2005-01-19 04:19:51 UTC
I'm having the same problem as well on amd64, also non-hardened. The error message I'm getting is slightly different:

 /bin/install -c -m 644 'mbas.exe' '/var/tmp/portage/mono-1.0.5-r1/image//usr/lib/mono/1.0//mbas.exe'
test -z "/usr/lib/mono/2.0/" || mkdir -p -- . "/var/tmp/portage/mono-1.0.5-r1/image//usr/lib/mono/2.0/"
 /bin/install -c -m 644 'gmcs.exe' '/var/tmp/portage/mono-1.0.5-r1/image//usr/lib/mono/2.0//gmcs.exe'
make[3]: Leaving directory `/var/tmp/portage/mono-1.0.5-r1/work/mono-1.0.5/runtime'
make[2]: Leaving directory `/var/tmp/portage/mono-1.0.5-r1/work/mono-1.0.5/runtime'
Making install in net_1_1
make[2]: Entering directory `/var/tmp/portage/mono-1.0.5-r1/work/mono-1.0.5/runtime/net_1_1'
make[3]: Entering directory `/var/tmp/portage/mono-1.0.5-r1/work/mono-1.0.5/runtime/net_1_1'
make[3]: Nothing to be done for `install-exec-am'
test -z "/usr/lib/" || mkdir -p -- . "/var/tmp/portage/mono-1.0.5-r1/image//usr/lib"
 /bin/install -c -m 644 'mscorlib.dll' '/var/tmp/portage/mono-1.0.5-r1/image//usr/lib/mscorlib.dll'
MONO_PATH=. ../../mono/interpreter/mint --config ../../data/config ./../gacutil.exe /i ./Accessibility.dll /f /package 1.0 /gacdir /usr/lib /root /var/tmp/portage/mono-1.0.5-r1/image//usr/lib
/bin/sh: line 1: 30709 Segmentation fault      MONO_PATH=. ../../mono/interpreter/mint --config ../../data/config ./../gacutil.exe /i ./Accessibility.dll /f /package 1.0 /gacdir /usr/lib /root /var/tmp/portage/mono-1.0.5-r1/image//usr/lib
make[3]: *** [install-data-local] Error 1
make[3]: Leaving directory `/var/tmp/portage/mono-1.0.5-r1/work/mono-1.0.5/runtime/net_1_1'
make[2]: *** [install-am] Error 2
make[2]: Leaving directory `/var/tmp/portage/mono-1.0.5-r1/work/mono-1.0.5/runtime/net_1_1'
make[1]: *** [install-recursive] Error 1
make[1]: Leaving directory `/var/tmp/portage/mono-1.0.5-r1/work/mono-1.0.5/runtime'
make: *** [install-recursive] Error 1

!!! ERROR: dev-dotnet/mono-1.0.5-r1 failed.
!!! Function src_install, Line 63, Exitcode 2
!!! (no error message)
!!! If you need support, post the topmost build error, NOT this status message.

Note that it failed with 'Segmentation fault' instead of 'Killed'.

Bits of emerge info: (too much to type over, so only the important lines)
Portage 2.0.51-r13 (default-linux/amd64/2004.3, gcc-3.4.3, glibc-2.3.4.20041102-r0, 2.6.10-gentoo-r6 x86_64)
System uname: 2.6.10-gentoo-r5 x86_64 AMD Athlon(tm) 64 Processor 3000+
Gentoo Base System version 1.6.8
Python: dev-lang/python-2.3.4 [2.3.4 (#1, Dec 28 2004, 10:15:23)]
dev-lang/python: 2.3.4
sys-devel/autoconf: 2.59-r6, 2.13
sys-devel/automake: 1.8.5-r2, 1.5, 1.4_p6, 1.6.3, 1.7.9, 1.9.4
sys-devel/binutils: 2.15.92.0.2-r2
sys-devel/libtool: 1.5.10-r2
virtual/os-headers: 2.6.8.1-r3
ACCEPT_KEYWORDS="amd64 ~amd64"
ARCH="amd64"
CFLAGS="-march=athlon64 -O2 -pipe -g"
CHOST="x86_64-pc-linux-gnu"
CXXFLAGS="-march=athlon64 -O2 -pipe -g"
Comment 7 Jens Ansorg 2005-01-20 15:23:22 UTC
me too, amd64.

weird thing is: I do have it already installed, wanted to re-emerge to get sqlite support build in. it fails with the install-data-local error

make[3]: Nothing to be done for `install-exec-am'.
test -z "//usr/lib" || mkdir -p -- . "/var/tmp/portage/mono-1.0.5-r1/image///usr/lib"
 /bin/install -c -m 644 'mscorlib.dll' '/var/tmp/portage/mono-1.0.5-r1/image///usr/lib/mscorlib.dll'
MONO_PATH=. ../../mono/interpreter/mint --config ../../data/config ./../gacutil.exe /i ./Accessibility.dll /f /package 1.0 /gacdir //usr/lib /root /var/tmp/portage/mono-1.0.5-r1/image///usr/lib
make[3]: *** [install-data-local] Error 1


lisaserver jens # emerge info
Portage 2.0.51-r3 (default-linux/amd64/2004.3, gcc-3.4.3, glibc-2.3.4.20040808-r1, 2.6.10-gentoo-r6 x86_64)
=================================================================
System uname: 2.6.10-gentoo-r6 x86_64 AMD Athlon(tm) 64 Processor 3200+
Gentoo Base System version 1.4.16
ccache version 2.3 [enabled]
Autoconf: sys-devel/autoconf-2.59-r5
Automake: sys-devel/automake-1.8.5-r1
Binutils: sys-devel/binutils-2.15.90.0.1.1-r3
Headers:  sys-kernel/linux26-headers-2.6.8.1-r2
Libtools: sys-devel/libtool-1.5.2-r7
ACCEPT_KEYWORDS="amd64"
AUTOCLEAN="yes"
CFLAGS="-march=athlon64 -O2 -pipe -fomit-frame-pointer"
CHOST="x86_64-pc-linux-gnu"
COMPILER=""
CONFIG_PROTECT="/etc /usr/X11R6/lib/X11/xkb /usr/kde/2/share/config /usr/kde/3/share/config /usr/lib/mozilla/defaults/pref /usr/share/config /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d"
CXXFLAGS="-march=athlon64 -O2 -pipe -fomit-frame-pointer"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoaddcvs autoconfig ccache distlocks sandbox"
GENTOO_MIRRORS="ftp://sunsite.informatik.rwth-aachen.de/pub/Linux/gentoo ftp://linux.rz.ruhr-uni-bochum.de/gentoo-mirror/ ftp://ftp.uni-erlangen.de/pub/mirrors/gentoo ftp://ftp.join.uni-muenster.de/pub/linux/distributions/gentoo ftp://ftp.wh2.tu-dresden.de/pub/mirrors/gentoo ftp://ftp-stud.fht-esslingen.de/pub/Mirrors/gentoo/"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="amd64 X aalib acl acpi alsa apache2 berkdb bitmap-fonts breakme cdr cfg crypt cups curl dvd eds emul-linux-x86 esd evo f77 fam font-server fortran gcj gd gif gimpprint gnome gnome2 gnomedb gnutls gpm gstreamer gtk gtk2 gtkhtml hal imagemagick imap imlib ipv6 java jp2 jpeg kerberos ldap libgda libwww lzw lzw-tiff mozilla moznocompose moznoirc moznomail multilib mysql ncurses nntp nptl oggvorbis opengl oss pam perl png ppds python readline samba scanner snmp spell sqlite ssl svg tcpd tif tiff truetype truetype-fonts type1-fonts unicode usb userlocales wmf xml xml2 xpm xrandr xv zlib"
Comment 8 Anders Rune Jensen (RETIRED) gentoo-dev 2005-01-24 07:31:55 UTC
It seems this is a duplicate of #61293?
Comment 9 Brandon Hale (RETIRED) gentoo-dev 2005-01-27 07:02:19 UTC
At comment #8:
The original post appears to deal with PaX killing a mono process during the bootstrap. You other kids with segfaults on AMD64 belong on bug #61293
Comment 10 Brandon Hale (RETIRED) gentoo-dev 2005-01-27 07:03:16 UTC
Original poster, can we get the output of `dmesg | tail` immediately after the build failure?
Comment 11 Peter Johanson (RETIRED) gentoo-dev 2005-02-07 19:24:54 UTC
Ok, marking NEEDINFO for the people on hardened. Original poster, please feel free to re-open when you have more info.

amd64 folks: please follow the other bug mentioned by tseng. Thanks.
Comment 12 Adam Chodorowski 2005-02-09 20:23:10 UTC
I have the same problem (running hardened on x86). However, after investigating build failures and some trail-and-error, I've managed to compile it manually. There are actually two problems with the build:

1. Mono isn't compiled as PIC code, which ofcourse doesn't work at all with
   hardened if you have PaX and notextrelocs enabled. The solution is to pass
   --with-pic to configure (trivial to fix in the ebuild).

2. Mono (just like Java) generates executable code at run-time, so it needs to
   have SEGMEXEC, PAGEEXEC, MPROTECT and (for some odd reason) EMUTRAMP
   disabled. This can be done with "paxctl -psme $executable". The exutables
   in question are "mono" and "lt-mono" "in mono/mini/.libs". The first is
   created during "make", the latter sometime during "make install". I simply
   ran paxctl on the files when the build failed and re-ran the last make,
   but obviously this needs to be included in a makefile patch somehow for
   the ebuild. How to do this with the automake setup is beyond me.
Comment 13 Peter Johanson (RETIRED) gentoo-dev 2005-02-11 10:44:03 UTC
Ok, re-opening this, and giving it a proper subject.

The --with-pic is easy enough, but the second piece involving running the paxctl stuff mid-build is trickier. If i manage to find some copious extra time to give this a shot, I will.

For now, CCing hardened, they can either remove themselves immediately if they feel like it, or take a look at this if they want.

@Adam: Thanks for the useful info.
Comment 14 Anthony Gorecki 2005-03-02 03:02:14 UTC
I've encountered this problem as well, with a slightly different error:


make[1]: Entering directory `/var/tmp/portage/mono-1.0.6/work/mcs-1.0.6/mcs'
../jay/jay -ctv < ../jay/skeleton.cs cs-parser.jay > jay-tmp.out && mv jay-tmp.out cs-parser.cs
../jay/jay: 3 rules never reduced
../jay/jay: 30 shift/reduce conflicts, 1 reduce/reduce conflict.
/var/tmp/portage/mono-1.0.6/work/mono-1.0.6/runtime/mcs   -d:NET_1_1 -d:ONLY_1_1 -g /target:exe /out:mcs.exe cs-parser.cs @mcs.exe.sources

** (/var/tmp/portage/mono-1.0.6/work/mono-1.0.6/runtime/mcs.exe:21134): WARNING **: : mprotect failed: Permission denied

** (/var/tmp/portage/mono-1.0.6/work/mono-1.0.6/runtime/mcs.exe:21134): WARNING **: : mprotect failed: Permission denied

** (/var/tmp/portage/mono-1.0.6/work/mono-1.0.6/runtime/mcs.exe:21134): WARNING **: : mprotect failed: Permission denied

** (/var/tmp/portage/mono-1.0.6/work/mono-1.0.6/runtime/mcs.exe:21134): WARNING **: : mprotect failed: Permission denied
/var/tmp/portage/mono-1.0.6/work/mono-1.0.6/runtime/mcs: line 1: 21134 Killed                  /var/tmp/portage/mono-1.0.6/work/mono-1.0.6/mono/mini/mono /var/tmp/portage/mono-1.0.6/work/mono-1.0.6/runtime/mcs.exe "$@"
make[1]: *** [mcs.exe] Error 137


Portage 2.0.51.18 (default-linux/x86/2004.3, gcc-3.4.3-20050110, glibc-2.3.4.20050125-r0, 2.6.10-hardened-r3 i686)
=================================================================
System uname: 2.6.10-hardened-r3 i686 Pentium III (Coppermine)
Gentoo Base System version 1.6.9
Python:              dev-lang/python-2.3.5 [2.3.5 (#1, Mar  1 2005, 01:25:35)]
dev-lang/python:     2.3.5
sys-devel/autoconf:  2.13, 2.59-r6
sys-devel/automake:  1.9.4, 1.5, 1.8.5-r3, 1.6.3, 1.7.9-r1, 1.4_p6
sys-devel/binutils:  2.15.92.0.2-r4
sys-devel/libtool:   1.5.10-r5
virtual/os-headers:  2.6.8.1-r2
ACCEPT_KEYWORDS="x86 ~x86"
AUTOCLEAN="yes"
CFLAGS="-O3 -march=pentium3 -pipe"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3/share/config /usr/share/config /var/bind /var/qmail/alias /var/qmail/control /var/vpopmail/domains /var/vpopmail/etc"
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d"
CXXFLAGS="-O3 -march=pentium3 -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoaddcvs autoconfig ccache distlocks noinfo prelink sandbox sfperms strict"
GENTOO_MIRRORS="http://distfiles.gentoo.org http://distro.ibiblio.org/pub/Linux/distributions/gentoo"
MAKEOPTS="-j6"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/portage-overlay"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="x86 crypt cups gif hardened ipv6 jpeg nptl nptlonly pam pcre perl pic pie png readline sse sse2 ssl tiff unicode zlib"
Unset:  ASFLAGS, CBUILD, CTARGET, LANG, LC_ALL, LDFLAGS


As mono-1.0.6 won't compile, I'm also prevented from building mono-1.1.4.
Comment 15 solar (RETIRED) gentoo-dev 2005-03-02 06:07:46 UTC
note for hardened users. Mono does not work with any system that has any 
form of NX, and from the sounds of it the upstream has no interest in fixing this 
fundamentally flawed design of mono. removing hardened from the CC: list.
Comment 16 Jerzy Kozera 2005-03-02 09:45:29 UTC
It does work, really - it does. Please don't give up so early when something isn't running on hardened system.

I have 2.6.10-hardened-r3 kernel with PaX enabled and pie/ssp gcc.

All I had to do to make mono compile was simply executing paxctl on mono while compiling.

My attachment contains patch for mono-1.0.6 ebuild which makes emerging with hardened possible. Maybe it's possible to apply it to other versions, although I didn't check that.

I hope that it will help you.
Comment 17 Jerzy Kozera 2005-03-02 09:46:22 UTC
Created attachment 52473 [details, diff]
This should make emerging with hardened systems possible.
Comment 18 Anthony Gorecki 2005-03-02 19:04:23 UTC
Unfortunately, the above patch had no affect on the build process for my error. I'm still investigating other ways to work around the problem.
Comment 19 solar (RETIRED) gentoo-dev 2005-03-10 19:56:03 UTC
The patch from comment #16 is propbably wrong. if mono needs pax flags set it's 
best todo it for the build/runtime via -Wl,-z,noexec(stack|heap)
Comment 20 Morten Mertner 2005-04-07 10:03:45 UTC
I was finally able to emerge 1.1.6 by creating a small script (http://www.mertner.com/mm/mono-install-pax-fix.sh) to set the pax flags while emerging.

The bug report suggested a number of files to chpax/paxctl, however, I needed to do it for other files:
/var/tmp/portage/mono-1.1.6/work/mono-1.1.6/mono/mini/mono
/var/tmp/portage/mono-1.1.6/work/mono-1.1.6/mcs/class/lib/net_1_1_bootstrap/gacutil.exe
Comment 21 schaedpq 2006-04-19 09:49:18 UTC
I just want to add my experiences with mono-1.1.13.2 and a system with hardened toolchain and PAX-enabled kernel. Compiling with the original ebuild from the tree failed, although at a different point as reported above. (If you are interested, I can provide the log)
After including "append-flags -Wl,-z,execheap,-z,execstack" in src_compile() and appending "with-pic=yes" to the configure flags (both being suggested above) the ebuild merged successfully. It does not solve the problem and is just a workaround, but maybe one can use it for now as it does not seem, that upstream would fix their code.
I still have to check, if it works. If not, I report back here.

# emerge --info
Portage 2.1_pre7-r5 (hardened/x86/2.6, gcc-3.4.5, glibc-2.3.5-r2, 2.6.14-hardened-r5 i686)
=================================================================
System uname: 2.6.14-hardened-r5 i686 Pentium III (Coppermine)
Gentoo Base System version 1.6.14
distcc 2.18.3 i686-pc-linux-gnu (protocols 1 and 2) (default port 3632) [disabled]
dev-lang/python:     2.3.5-r2, 2.4.2
sys-apps/sandbox:    1.2.12
sys-devel/autoconf:  2.13, 2.59-r7
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r1
sys-devel/binutils:  2.16.1
sys-devel/libtool:   1.5.22
virtual/os-headers:  2.6.11-r2
ACCEPT_KEYWORDS="x86"
AUTOCLEAN="yes"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-mtune=pentium3 -march=pentium3 -O2 -pipe"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/X11R6/lib/X11/xkb /usr/kde/2/share/config /usr/kde/3.4/env /usr/kde/3.4/share/config /usr/kde/3.4/shutdown /usr/kde/3/share/config /usr/lib/X11/xkb /usr/share/config /usr/share/texmf/dvipdfm/config/ /usr/share/texmf/dvips/config/ /usr/share/texmf/tex/generic/config/ /usr/share/texmf/tex/platex/config/ /usr/share/texmf/xdvi/ /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/eselect/compiler /etc/gconf /etc/revdep-rebuild /etc/terminfo /etc/env.d"
CXXFLAGS="-mtune=pentium3 -march=pentium3 -O2 -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoconfig confcache distlocks metadata-transfer parallel-fetch sandbox sfperms strict"
GENTOO_MIRRORS="http://linux.rz.ruhr-uni-bochum.de/download/gentoo-mirror/ ftp://linux.rz.ruhr-uni-bochum.de/gentoo-mirror/"
LINGUAS="de en"
MAKEOPTS="-j2"
PKGDIR="/usr/portage//packages/x86/"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage/"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://linux.rz.ruhr-uni-bochum.de/gentoo-portage"
USE="X aac acpi alsa avi bash-completion berkdb bitmap-fonts browserplugin bzip2 cardbus chroot crypt css cups curlwrappers dga dlloader dri dvd font-server ftp gif gnuplot gs gtk gtk2 hardened imap jabber jpeg lesstif lzo lzw mbox md5sum mime mmx mmxext mozilla mozsvg mp3 mpeg mplayer ncurses network nls no_wxgtk1 nodrm nptl nsplugin ntlm offensive ogg opengl pam pam_timestamp pcmcia pic png pnp ppds qt readline recode sftplogging smime sockets sse ssl tcpd theora tiff truetype truetype-fonts type1 type1-fonts userlocales vcd vorbis wifi win32codecs x86 xv zlib elibc_glibc kernel_linux linguas_de linguas_en userland_GNU"
Unset:  ASFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LC_ALL, LDFLAGS
Comment 22 Peter Johanson (RETIRED) gentoo-dev 2006-08-06 11:06:16 UTC
*** Bug 142973 has been marked as a duplicate of this bug. ***
Comment 23 Pacho Ramos gentoo-dev 2006-12-07 13:34:20 UTC
Is this bug still valid with mono-1.1.13.8.1?

Thanks for information
Comment 24 Saleem Abdulrasool (RETIRED) gentoo-dev 2006-12-28 10:15:35 UTC
No response from reporter, marking as NEEDINFO
Comment 25 Saleem Abdulrasool (RETIRED) gentoo-dev 2007-01-15 03:21:13 UTC
*** Bug 139885 has been marked as a duplicate of this bug. ***
Comment 26 Jan Marten Simons 2007-02-23 18:30:48 UTC
For mono-1.2.3 on a PaX-enabled kernel (2.6.17-hardened-r1) I see this problem:

mv -f etc/mono/configt etc/mono/config
if test -w ../mcs; then :; else chmod -R +w ../mcs; fi
cd ../mcs && make PROFILES='default net_2_0' CC='i686-pc-linux-gnu-gcc' all-profiles
make[3]: Entering directory `/var/tmp/portage/dev-lang/mono-1.2.3/work/mono-1.2.3/mcs'
make profile-do--default--all profile-do--net_2_0--all
make[4]: Entering directory `/var/tmp/portage/dev-lang/mono-1.2.3/work/mono-1.2.3/mcs'
make PROFILE=basic all
make[5]: Entering directory `/var/tmp/portage/dev-lang/mono-1.2.3/work/mono-1.2.3/mcs'
make[6]: *** [build/deps/basic-profile-check.exe] Killed
make[6]: Entering directory `/var/tmp/portage/dev-lang/mono-1.2.3/work/mono-1.2.3/mcs'
*** The contents of your 'monolite' directory may be out-of-date
*** You may want to try 'make get-monolite-latest'
make[6]: *** [do-profile-check-monolite] Error 1
make[6]: Leaving directory `/var/tmp/portage/dev-lang/mono-1.2.3/work/mono-1.2.3/mcs'
make[5]: *** [do-profile-check] Error 2
make[5]: Leaving directory `/var/tmp/portage/dev-lang/mono-1.2.3/work/mono-1.2.3/mcs'
make[4]: *** [profile-do--basic--all] Error 2
make[4]: Leaving directory `/var/tmp/portage/dev-lang/mono-1.2.3/work/mono-1.2.3/mcs'
make[3]: *** [profiles-do--all] Error 2
make[3]: Leaving directory `/var/tmp/portage/dev-lang/mono-1.2.3/work/mono-1.2.3/mcs'
make[2]: *** [all-local] Error 2
make[2]: Leaving directory `/var/tmp/portage/dev-lang/mono-1.2.3/work/mono-1.2.3/runtime'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/var/tmp/portage/dev-lang/mono-1.2.3/work/mono-1.2.3'
make: *** [all] Error 2

!!! ERROR: dev-lang/mono-1.2.3 failed.

build/deps/basic-profile-check.exe seems to be killed by PaX:

Feb 23 18:12:31 pc42 PAX: terminating task: /var/tmp/portage/dev-lang/mono-1.2.3/work/mono-1.2.3/mono/mini/mono(mono):32733, uid/euid: 250/250, PC: 25857000, SP: 5dfbdbbc
Feb 23 18:12:31 pc42 PAX: bytes at PC: 55 89 e5 53 8b 45 08 0f a2 50 8b 45 10 89 18 8b 45 14 89 08
Feb 23 18:12:31 pc42 PAX: bytes at SP-4: 5dfbdc28 14705dae 00000001 5dfbdbfc 5dfbdbf8 5dfbdbf4 5dfbdbf0 25a69dec 25a6b800 258f73c2 5dfbdbfc 259b8e7f 25a6b800 00000000 2590fd68 00000001 258f73c2 258f73c1 c637f72f 00000001 c637f72f