[Mono-dev] [PATCH]: Avoid --with-static_mono=no problems on Linux/Sparc

Zoltan Varga vargaz at gmail.com
Tue Apr 4 18:54:44 EDT 2006


Hey,

This one is now checked in.

    Zoltan

On 4/5/06, David S. Miller <davem at davemloft.net> wrote:
> From: "Zoltan Varga" <vargaz at gmail.com>
> Date: Wed, 5 Apr 2006 00:28:25 +0200
>
> >   The patch no longer applies cleanly to gcconfig.h in mono SVN.
>
> Here's an updated version:
>
> 2006-04-04  David S. Miller  <davem at sunset.davemloft.net>
>
>         * include/private/gcconfig.h (LINUX and SPARC): Do not
>         use _etest and GC_SysVGetDataStart() to figure out DATASTART.
>         Instead use either SEARCH_FOR_DATA_START or __environ, based
>         upin GLIBC version.
>
> --- include/private/gcconfig.h.~1~      2006-04-04 14:14:58.000000000 -0700
> +++ include/private/gcconfig.h  2006-04-04 15:31:57.000000000 -0700
> @@ -990,16 +990,24 @@
>  #     else
>            Linux Sparc/a.out not supported
>  #     endif
> -      extern int _end[];
> -      extern int _etext[];
> -#     define DATAEND (_end)
>  #     define SVR4
> -      extern ptr_t GC_SysVGetDataStart();
> -#     ifdef __arch64__
> -#      define DATASTART GC_SysVGetDataStart(0x100000, _etext)
> +#     include <features.h>
> +#     if defined(__GLIBC__) && __GLIBC__ >= 2
> +#       define SEARCH_FOR_DATA_START
>  #     else
> -#       define DATASTART GC_SysVGetDataStart(0x10000, _etext)
> +          extern char **__environ;
> +#         define DATASTART ((ptr_t)(&__environ))
> +                     /* hideous kludge: __environ is the first */
> +                     /* word in crt0.o, and delimits the start */
> +                     /* of the data segment, no matter which   */
> +                     /* ld options were passed through.        */
> +                     /* We could use _etext instead, but that  */
> +                     /* would include .rodata, which may       */
> +                     /* contain large read-only data tables    */
> +                     /* that we'd rather not scan.             */
>  #     endif
> +      extern int _end[];
> +#     define DATAEND (_end)
>  #     define LINUX_STACKBOTTOM
>  #   endif
>  #   ifdef OPENBSD
>



More information about the Mono-devel-list mailing list