Can't manage to build ldc, problem seems to be compiling ldc/runtime/profile-rt/profile-rt-38/GCDAProfiling.c

Andrew via digitalmars-d-ldc digitalmars-d-ldc at puremagic.com
Sat Jul 23 08:45:13 PDT 2016


On Saturday, 23 July 2016 at 15:06:12 UTC, Johan Engelen wrote:
>
> Where is MAP_SHARED defined?
>
> This is a bug in LLVM's compile-rt project, and it'd be good to 
> find a proper fix for it.
> Perhaps it is adding the correct header file, or adding
> #ifndef MAP_FILE
> # define MAP_FILE 0
> #endif

MAP_SHARED is defined in /usr/include/bits/mman.h as well:

#define MAP_SHARED	0x01		/* Share changes.  */

and /usr/include/sys/mman.h has the line:

#include <bits/mman.h>

I tried the following code, cut and pasting the header lines from 
GCDAProfiling.c:

#include <errno.h>
#include <fcntl.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#if defined(_WIN32)
#include "WindowsMMap.h"
#else
#include <sys/mman.h>
#include <sys/file.h>
#endif

int main()
{
   printf("%d,%d\n", MAP_FILE, MAP_SHARED);
   return 0;
}

and it outputted 0,1

I've also tried adding the lines

#ifndef MAP_FILE
# define MAP_FILE 0
#endif

straight after the #include <sys/mman.h> line (reverting the 
previous change) and that compiles fine too.

This isn't the first time this cluster has left me confused. 
Could it be that the problem is on this end, and the cluster has 
been set up in a funny way?

Andrew


More information about the digitalmars-d-ldc mailing list