Permalink
Switch branches/tags
Commits on Aug 22, 2018
  1. Fix runtime test suite with mcs (#10219)

    NattyNarwhal authored and akoeplinger committed Aug 22, 2018
    mcs doesn't have a -langversion:7.3 yet but -langversion:latest implies 7.3 (at the moment).
Commits on Aug 21, 2018
  1. IsDebuggerPresent for AIX (#9995)

    NattyNarwhal authored and monojenkins committed Aug 21, 2018
    IsDebuggerPresent for AIX
    
    checks self for the "process is traced" flag
  2. Use argv for cli_launcher on OSes that don't return full path for pro…

    NattyNarwhal authored and monojenkins committed Aug 21, 2018
    …cess names; fix mono_w32process_get_path on Free/NetBSD (#9860)
    
    Use argv for cli_launcher on OSes that don't return full path for process names; fix mono_w32process_get_path on Free/NetBSD
    
    Should fix process-leak test on AIX, maybe more. Also tested that it fixes the
    same behaviour on FreeBSD. Other OSes may be affected; consult and test with the
    files `w32process-unix-*.c`.
    
    From comments:
    
    ```c
    /*
     * XXX: verify if other OSes need it; many platforms seem to have it so that
     * mono_w32process_get_path -> mono_w32process_get_name, and the name is not
     * necessarily a path instead of just the program name
     */
    
    /*
     * mono_w32process_get_path on these can only return a name, not a path;
     * which may not be good for us if the mono command name isn't on $PATH,
     * like in CI scenarios. chances are argv based is fine if we inherited
     * the environment variables.
     */
    ```
Commits on Aug 20, 2018
  1. Truncate MachineName (and UserDomainName) at first period (#9843)

    NattyNarwhal authored and akoeplinger committed Aug 20, 2018
    * Truncate MachineName (and UserDomainName) at first period
    
    Unix machines often put their FQDN as the host name, and domain
    name is used for things such as yp. As such, truncate the FQDN to
    just the hostname, as other Unix utilities seem to do.
    
    Matches the .NET Core and .NET Framework behaviour, and MS seems to
    require this for a future project. Fixes #9839.
    
    * Add a unit test for bug
    
    * Formatting tweaks
  2. [System.Runtime.InteropServices] Detect Arm/Arm64 in RuntimeInformati…

    NattyNarwhal authored and akoeplinger committed Aug 20, 2018
    …on (#10088)
    
    * For ProcessArchitecture, use the DllMap arch of the runtime.
    
    * For OSArchitecture, make an educated guess combining ProcessArchitecture and Environment.Is64BitOperatingSystem.
    
    * For non-Intel/ARM architectures, (supported by Mono and not on the chopping block are PPC32/64, z, and WebAssembly) please dogpile onto dotnet/corefx#30706.
Commits on Aug 14, 2018
  1. Fix mono_string_from_blob for big endian systems (#10072)

    NattyNarwhal authored and akoeplinger committed Aug 14, 2018
    (Commit attributed to @kumpera because he wrote this quick fix, thanks!)
    
    Fixes #10070
Commits on Aug 12, 2018
  1. Fix iconv in eglib, remove GNU libiconv-ism

    NattyNarwhal committed Aug 12, 2018
    iconv in eglib was broken due to a broken define. Also fix linking
    of iconv when iconv isn't in libc.
    
    Also remove the usage of a GNU libcharset specific function and rely
    on a standard POSIX function that outputs the same value on every
    modern Unixoid I've tried it on. (Ubuntu/macOS/i/FreeBSD)
    
    This comment explains a lot of things for the latter:
    
    ```c
    /*
     * This function used used to use the "locale_charset" call in
     * libiconv's libcharset library. However, this isn't always
     * available on some systems, including ones with GNU libc. So,
     * instead use a function that's a standard part of POSIX2008.
     *
     * nl_langinfo is in POSIX2008 and should be on any sane modern
     * Unix. With a UTF-8 locale, it should return "UTF-8" - this
     * has been verified with Ubuntu 18.04, FreeBSD 11, and i 7.3.
     *
     * The motivation for using locale_charset was likely due to
     * the cruftiness of Unices back in ~2001; where you had to
     * manually query environment variables, and the values were
     * inconsistent between each other. Nowadays, if Linux, macOS,
     * AIX/PASE, and FreeBSD can all return the same values for a
     * UTF-8 locale, we can just use the value directly.
     *
     * It should be noted that by default, this function will give
     * values for the "C" locale, unless `setlocale (LC_ALL, "")`
     * is ran to init locales - driver.c in mini does this for us.
     */
    ```
Commits on Aug 10, 2018
  1. autotools fixes for AIX, FreeBSD and some stuff for Haiku (#9967)

    NattyNarwhal authored and akoeplinger committed Aug 10, 2018
    * Fix build on AIX
    
    	* crash reporting requires dladdr, a function AIX (at least
    	  the version on CI) lacks
    
    	* fix build with a powerpc64-*-(aix|os400)* triplet as IBM
    	  wishes to do
    
    * Fix some stuff for Haiku
    
    Some stuff requires CoreFX PAL changes that haven't been merged and
    thus one or two more items for configure to detect.
    
    	* sigaltstack is broken for haiku
    
    	* getifaddrs is available and PAL would like it, so fix it
    
    * Fix detection of flock64
    
    This erroneously detected flock64 on platforms that lacked it.
    Fixes the build of CoreFX PAL on FreeBSD and Haiku.
    
    * Fix flock64 define
    
    * Fix define for flock64 in PAL block
    
    * Remove nonsense comment that only applied to an older unreleased version of the patch
Commits on Aug 6, 2018
Commits on Aug 1, 2018
  1. Really fix CoreR[FT] version of System.Decimal for big endian (#9828)

    NattyNarwhal authored and marek-safar committed Aug 1, 2018
    The version imported and attempted to patch didn't work fully. This
    preserves the .NET representation while converting if directives to
    runtime checks, which CoreCLR inlines.
    
    Testing was done poking some values in the REPL and running some
    test suites (System.Json, System.Decimal) that broke as a result.
    mcs should also properly handle constants; again, the "bits" inside
    are consistent with amd64, and just converted as needed.
    
    Unless I fucked up, should fix #9772.
Commits on Jul 30, 2018
Commits on Jul 5, 2018
  1. Fix invalid preprocessor check for BE that broke System.Decimal (#9429)

    NattyNarwhal authored and akoeplinger committed Jul 5, 2018
    This bug has been lurking for four years, being introduced in commit
    5b2bb8c. BYTE_ORDER != G_BYTE_ORDER.
    
    Not throughly tested, but System.Decimal from csharp seems to return
    sane results again. (related: is z or AIX CI available for PR checks?
    if not, what test suite is System.Decimal under?)
    
    Also remove my shoddy workaround from a few months ago, it got the
    BCL building, but was incorrect.
Commits on Jul 4, 2018
Commits on Jun 22, 2018
  1. System.Diagnostics.Process improvements for AIX (#9180)

    NattyNarwhal authored and akoeplinger committed Jun 22, 2018
    * Fix Process.ProcessName on AIX
    
    AIX has a procfs with raw structures congruent with Solaris. For i,
    which lacks procfs, fall back to a libc call.
    
    This doesn't solve the Process weirdness that bungs up the test
    suite, but I hope it's a start.
    
    * Bye bye, annoying AIX setschedparam warning
    
    AIX (but weirdly, not i) complains every time you do this. Squelch
    the warning on AIX and avoid line noise.
    
    * Remove more assumptions of /proc on AIX
    
    	* should probably always use getprocs64 for w32process,
    	  but looks like we could just use proclib on the fallback?
    
    	* there's some more cases relating to resource usage stat,
    	  will have to investigate those cases further
    
    * Basic process modules support on AIX (but not i)
    
    Not aware of a PASE compatible API, but this will work on AIX. Not
    sure about .ModuleName versus .FileName, but it seems to fill it in...
Commits on Jun 19, 2018
  1. Add AIX CI badge (#9224)

    NattyNarwhal authored and akoeplinger committed Jun 19, 2018
    attempt at "the build is broken" development. it's marked (cs) like the others.
Commits on Jun 11, 2018
Commits on Jun 1, 2018
  1. Make the sendfile with 6 args check use AC_TRY_LINK

    NattyNarwhal authored and marek-safar committed May 31, 2018
    This lets the linker catch any missing symbols, and fixes a problem
    I had building AIX with CoreFX PAL. Fixes #8979, though there may
    be more cases like this.
    
    dotnet/corefx#30012 is blocking on this.
Commits on May 19, 2018
  1. Small cleanups for mini-ppc.h (#8764)

    NattyNarwhal authored and vargaz committed May 19, 2018
    * mini-ppc-os.h doesn't exist. If the OS lacks a define,
    	  give an error instead of a broken include.
    
    	* Remove redundant Mac OS case.
    
    	* Move AIX define for sigaction above cross-compile case,
    	  so it won't get lost in the noise there.
Commits on May 11, 2018
  1. Support setting thread names on Haiku (#8672)

    NattyNarwhal authored and akoeplinger committed May 11, 2018
    Makes it easier to know what thread does what when trying to debug
    these issues I've been having with things like finalizer threads.
Commits on Mar 28, 2018
  1. Use __PASE__ for things i needs that AIX doesn't (#7858)

    NattyNarwhal authored and luhenry committed Mar 28, 2018
    IBM's new toolchain for i defines __PASE__, and if cross-compiling
    from AIX, we can pass `CPPFLAGS="-D__PASE__"` to `./configure` as
    needed.
Commits on Mar 10, 2018
  1. Build system tweaks for AIX (#7542)

    NattyNarwhal authored and akoeplinger committed Mar 10, 2018
    * use this version of libintl because that's what GNU uses
    
    	* tweak BTLS CFLAGs to make it work and be coonsistent
Commits on Mar 5, 2018
  1. PPC support for BoringTLS

    NattyNarwhal authored and lewurm committed Mar 4, 2018
    Doesn't seem to be completely working: AIX triggers the trampoline
    bug in the ctor for contexts, and Linux inits fine but seems to be
    using SSLv3?
Commits on Feb 27, 2018
  1. Update the random checking code in autoconf to this decade (#7250)

    NattyNarwhal authored and akoeplinger committed Feb 27, 2018
    * OpenBSD hasn't have /dev/srandom anymore. See:
    	  https://mastodon.social/@_xhr_/99389358375291806
    
    	* Crichton hasn't touched Mono since 2004, per logs. I
    	  doubt they're who to consult about this issue anymore, if
    	  someone somehow does.
  2. Always enable explicit null checks for AIX (#7300)

    NattyNarwhal authored and marek-safar committed Feb 27, 2018
    * Always enable explicit null checks for AIX
    
    AIX has a "null page" that allows reads (but not W|X) to occur on
    *0; allegedly legacy crap for old stupid C programs that poorly
    managed string handling. Because of this, we can't catch SIGSEGVs
    to give out NREs with - we have to do null checks ourselves. As
    such, turn this debug option on all the time; it's seemingly what
    other managed runtimes have done, at least according to with what
    one contact says.
    
    * Make explicit null checking definable by architecture headers
    
    Turns out other OSes do this too; so best to keep it generic.
    
    To the poor souls on HP-UX and IRIX, good luck!
    
    * Make arch-specific explicit null checks a backend option instead
    
    Don't put ifdefs into JIT code except in that init_backend func;
    also make ifdef name consistent with the debug flag name
Commits on Feb 23, 2018
  1. Fix mono_arch_setup_async_callback and add mono_arch_setup_resume_sig…

    NattyNarwhal authored and vargaz committed Feb 23, 2018
    …handler_ctx on PPC (#7159)
    
    * Fix *setup_async_callback and add *resume_sighandler_ctx on PPC
    
    mono_arch_setup_async_callback didn't work on systems that use
    function pointers. For consistency with other backends with
    exception support, also add mono_arch_setup_resume_sighandler_ctx,
    which we can use to support mono_arch_setup_async_callback, like
    those other backends.
    
    Also enable async callbacks on AIX, then enable
    *resume_sighandler_ctx on PPC Linux (untested) and AIX. With this,
    I can now ^C in the REPL with AIX and have it work; whereas before
    it bombed out, with or without async callbacks enabled or disabled.
    
    * Don't configure func descriptors twice, set args reg with user data
    
    	* No sense configuring configuring function descriptors if
    	  the restore sigcontext call already set them up. (If Mac
    	  OS supports is verified and added to the ifdef maze, it'd
    	  be safe to remove this whole ifdef, and let the call in
    	  `exceptions-ppc` handle it all, as all supported OSes
    	  would have that call...)
    
    	* Set user_data in an arguments register, like what amd64
    	  and z do.
    
    These don't seem to cause any regressions, like the first patch.
    
    * Remove unnecessary case for PPC
    
    * mono_ppc_set_func_into_sigctx is unused now, remove it
    
    * Everyone has MONO_ARCH_HAVE_SETUP_RESUME_FROM_SIGNAL_HANDLER_CTX on PPC now
    
    * Everyone has MONO_ARCH_HAVE_SIGCTX_TO_MONOCTX on PPC too
Commits on Feb 20, 2018
  1. Assorted fixes for AIX and i (#6934)

    NattyNarwhal authored and luhenry committed Feb 20, 2018
    * Assorted fixes for AIX and i
    
    	* Fix a bug I introduced when changing the MonoArray vector
    	  type; array lengths wouldn't match up to what they
    	  actually were on AIX/i.
    
    	* Use a custom mkdtemp implementation on Unices without
    	  mkdtemp - and ones that do but don't necessarily have it,
    	  like i 7.1, which lacks mkdtemp in its libc. We can't
    	  determine this at runtime, so AIX will have to suffer
    	  with i.
    
    	* Enhance PowerPC hwcap on AIX to detect features like
    	  Linux does.
    
    	* Don't use clock_getres on AIX, because i 7.1 doesn't have
    	  that syscall - it's in libc, but it'll bomb out with a
    	  SIGILL; the way unimplemented opcodes are handled on i.
    
    * Don't use PROT_NONE for hazard pointer alloc when on AIX
    
    AIX and i 7.2 are OK with doing this, but i 7.1 is not and will
    SIGSEGV because we violate access privleges; not even mprotect will
    change this. As such, change to r/w protection for AIX/i.
    
    * Fix Environment.OSVersion on AIX/i
    
    Before, it would report "Unix 1.0.0.0" due to the fact AIX only
    puts the minor version number where other Unices would put the
    whole version in uname. Set up an ifdef for AIX and deal with this
    semantic difference with a sprintf.
    
    * Disable mffgpr on AIX
    
    Reports of it not working on i 7.1 on POWER7; tester reports
    disabling this in hwcap makes it run. This requires further
    investigation.
    
    * Fix threadpool errno delivering bogus values with _THREAD_SAFE
    
    We didn't set this, and we need it so that errno is thread-local on
    AIX/i. Oops!
    
    * Make suggested changed to AIX branch
    
    	* use sizeof (utsname) for sanity's sake
    
    	* use a variable for hazard table protection
    
    	* match defines for CPPFLAGS -> libmono_cflags
Commits on Feb 5, 2018
  1. Support IBM AIX on POWER (#6677)

    NattyNarwhal authored and lewurm committed Feb 5, 2018
    * Get autotools scripts for Mono and Boehm to recognize i
    
    PASE is most similar to AIX, and perhaps I assume other commercial
    Unices, as well as PowerPC Linux, so grab variables from them as
    needed.
    
    With this, we get glib failing to build due to missing mkdtemp.
    
    * Use better cpp definition to grab more of what we want
    
    * Fix random and 64-bit file offset support
    
    * Set TARGET on IBM i on POWER
    
    * Add hack to gfile-unix.c to work around flawed AIX header
    
    From comment:
    
    /* HACK: the preprocessor will not give us mkdtemp no matter
       what and Mono (for good reason) does
       "-Werror-implicit-function-declaration" so we error out;
       instead declare mkdtemp here; the linker will find mkdtemp
       anwyays. libuv has had similar issues, but they just ignore
       the compiler warning instead of failing on it.
    
       See: github.com/libuv/libuv/pull/740 */
    
    * Work around missing definition on AIX/PASE
    
    * Fix conflicting definition from due too AIX headers
    
    * Initial work to get JIT working on AIX
    
    * uncertain about NIP; is IAR the right register? need review from
      PPC asm people
    
    * needs calling convention work; AIX does NOT use ELF
    
    * Fix lack of casting on sigcontext macros, fix errnos for AIX
    
    * AIX doesn't distinguish between ENOTEMPTY and EEXIST without a
      define. Handle this case with a conditional cpp directive..
    
    * When ctx is a void pointer, dereferencing as a struct will fail.
      Handle this case with a cast.
    
    * Handle regular AIX as well as PASE
    
    * Implement stack boundaries check for AIX, volume info func
    
    * vol info should be like other Unix, just needs to bridge ifdef
    
    * highly uncertain for the bounds checking, needs further review
    
    * Fix typo in mono/utils/mono-threads-aix.c
    
    * In boehm-gc.c, don't use pthread_getattr_np on AIX even if available
    
    It's not available on IBM i, and even if available, toolchains for AIX
    may "helpfully" swap out system headers with variants that remove
    functions like pthread_getattr_np.
    
    * Don't use "-export-dynamic" on non-GNU ld
    
    IBM ld considers "-e" to be a flag for setting the entry point.
    Detect non-GNU ld, and offer equivalents when possible.
    
    The makefile in mini had to be changed as a result due to
    hardcoded flags.
    
    * Use pthread-stop-world.c on AIX
    
    Remove an ifdef that gated this off to AIX. It seems the old AIX
    specific files shouldn't be used, and that the changelog for libgc
    says pthread should work fine on AIX instead; yet it was blocked.
    Restore this, as it compiles and seems to let mono-boehm link fine.
    
    * AIX workarounds for some of support dir
    
    * fstab on AIX is there, but defines a struct more like other
      platforms' checklist struct.
    
    * AIX, like macOS and some BSDs, doesn't define some serial types.
    
    * psignal is another victim of GNU; even then it isn't in PASE
      headers anyways
    
    * More support workarounds for AIX headers
    
    * Replacement function body for syslog2 on vsyslog-less platforms
    
    AIX lacks vsyslog; detect in autoconf and act appropriately.
    
    * Final support hacks for AIX
    
    * Fix problematic stack management on AIX
    
    this gets us past ifdefs, after much handwringing
    
    * get the right end of the stack; r1/stack pointer is on the wrong
      end and ustk is just plain broken
    
    * AIX doesn't seem to like the semantics of the mmap call valloc
      does here; either we're allocating into an area we shouldn't be
      or we're not passing the right flags. Until then, learn to live
      without the stack guard?
    
    * Disable Boehm GC on AIX
    
    Focus on getting SGen working, and avoid legacy debugging nonsense
    
    * Remove AIX ifdef-undef and replace with s/hz/uhz
    
    * Don't use sigaltstack on AIX due to bugginess with guard sections
    
    The valloc call on AIX has issues after issuing mprotect; don't do
    do it. I believe it fails because we aren't issuing the right
    flags on AIX, or because we're allocating inside of an already
    allocated area.
    
    * Perform a 64-bit build on AIX
    
    We still crash at the same place, but probably for the best that
    we switch to 64-bit. (Maybe we could make it configurable?)
    
    * Fix func descriptor ifdef, add initial (likely wrong) defs for AIX
    
    * AIX doesn't define __powerpc64__ or __ppc64__ when compiling as
      64-bit. Use an alternate ifdef, and shuffle around that ifdef
      anyways, as it could lead to wrong results on other platforms
      too.
    
    * AIX likely needs special definitions, especially on 32-bit. The
      calling convention is closest to PPC64BE Linux, but not exactly.
    
    * Fix stack size on AIX
    
    Ruby dealt with this before: ruby/ruby@a2594be
    
    * Set up initial PPC hwcap for AIX, fix ftnptr ifdefs, tweak AIX defs
    
    * Fix hwcap to use better values on PPC AIX
    
    Still needs more adjustment though
    
    * Fix alignment issue on AIX, tweak mini-ppc values just a bit more
    
    * On AIX, doubles are always aligned by 4 if they're in structs.
      Since we need to have them aligned by 8 on 64-bit, this is bad,
      so change the type on AIX.
    
    * We can use this definition on AIX
    
    Now we can bootstrap Mono!
    
    * Shuffle MonoArray ifdef per suggestion of @vargaz
    
    * Fix System.Decimal division on big endian systems
    
    Before, we got non-sensical overflow on things like
    `(Decimal)Int32.MaxValue / 1000`; now they get the same value,
    comparing this POWER6 running AIX to my server's output running
    OpenBSD/amd64.
    
    * Fix dynamically linked build of Mono on AIX
    
    nm wasn't seeing 64-bit symbools as it defaults to 32-bit mode,
    also never try to use GNU nm
    
    * Fix PPC64 define in mono-config
    
    Interestingly, there was an AIX define already present, and that
    definition is present in AIX's passed includes, so continue to use
    it.
    
    * Don't use __thread even if detected on AIX
    
    tl;dr: The assembler gets angry with __thread and minimal-toc, and
    changing options to replace minimal-toc causes linker issues; this
    TLS option isn't important anyways if we have pthread instead,
    like before when we were using Perzl's old GCC without __thread.
    
    * Get lib.a(lib.o) type archives working with P/Invoke for AIX
    
    AIX libraries are very, very strange compared to other Unices.
    
    I'm not entirely sure if this is correct or optimal; it may need
    to special case further. For now, it's enough to get gacutil
    up and running.
    
    Some resources I found useful for this charade:
    <http://stromberg.dnsalias.org/~dstromberg/AIX-shared-libs.html>
    
    Also set libc and libintl to their proper values.
    
    * Scheduling priority hack for i
    
    PASE doesn't accept anything other than SCHED_OTHER, and the funcs
    for getting min/max don't work either. AIX suffers, but only a
    little bit.
    
    * Final polish on request
    
    Remove Boehm changes if we don't use Boehm, tweak some defines,
    remove some externs, tweak autoconf file
    
    * Be aware of ERESTART, on OSes that use it
    
    Instead of EINTR/EAGAIN, AIX uses ERESTART. Handle this, so things
    like xsp are less chatty when performing async IO.
Commits on Dec 22, 2017
  1. Unbreak XMM register handling on platforms without MonoContextSimdReg (

    NattyNarwhal authored and luhenry committed Dec 22, 2017
    …#6219)
    
    * Unbreak XMM register handling on platforms without MonoContextSimdReg
    
    Platforms like Haiku (and glibc-less Linux, but that was unbroken a few
    weeks ago) don't have this implemented on Mono. (yet?) Restore old
    behaviour behind an #ifdef (same one as on mono-context.h) - perhaps it
    could be a nicer ifdef, but I'm keeping this consistent for now.
    
    * Attempt at a universal ifdef for MonoContextSimdReg presence
    
    Suggestion of @kumpera. I've put #ifdefs in the obvious places, and
    verified that the commit ensures we're still in the same position as
    before.
    
    * Fix non-MonoContextSimdReg calls in tramp-amd64.c
    
    Follow advice of @joncham wrt the type and function to use instead.
Commits on Dec 6, 2017
  1. Compile on amd64 Haiku (#4473)

    NattyNarwhal authored and luhenry committed Dec 6, 2017
    * Compile on amd64 Haiku
    
    Use sigcontext (somewhat like win32, or x86) on Haiku amd64.
    
    On amd64, Haiku doesn't have issues with marshalling 64-bit values,
    but it currently does have issues with SGen either causing a stall
    or a core dump. As such, while it can compile the stdlib (further
    than x86 got), it's still a work in progress.
    
    * Use set_real_time_clock for sys-time.c on Haiku
    
    * Get mono-boehm compiling on Haiku again
    
    It still doesn't work. Initialization will call GC_mark_from, which
    will cause a segmentation fault as it decrements pointers. (Mono
    will enter an infinite loop in mono_get_hazardous_pointer as a result.)
    
    For now, mono-sgen will continue to be used by default.
Commits on Feb 27, 2017
  1. Haiku hrev50954 makes this ifdef unnecessary

    NattyNarwhal committed Feb 16, 2017
  2. Fix eglibc configure script on Haiku

    NattyNarwhal committed Feb 14, 2017
    Now properly recognizes -ltextencoding
  3. Improve build and configure

    NattyNarwhal committed Feb 14, 2017
    * detect sys/errno.h
    
    * Fix errenous LIBS in haiku
    
    * use HAVE_MINCORE
  4. Polish on configure script

    NattyNarwhal committed Feb 14, 2017
    * Set boehm to disabled
    
    * Set threading to use pthreads, not __thread
      (causes static TLS issues)
    
    * Add the library needs for locale
      (FIXME: does this apply to eglib?)
  5. Get Mono running further on Haiku by fixing proclib/threads

    NattyNarwhal committed Feb 13, 2017
    * proclib: Adapted Andreas' code to the refactored proclib.
      Allocates ahead of time.
    
    * threads: pthread_setschedparam is semantically different on Haiku,
      because it returns positive numbers on success. Handle this
      difference.
    
    With these changes, Mono can now get to the point Roslyn runs, and
    fails immediately due to lack of stack walking.