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

Johan Engelen via digitalmars-d-ldc digitalmars-d-ldc at puremagic.com
Sat Jul 23 08:57:01 PDT 2016


On Saturday, 23 July 2016 at 15:45:13 UTC, Andrew wrote:
> 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

Huh?
Perhaps a different compiler is used when building ldc-profile-rt 
?
Can you have a look at the commandline to build GCDAProfiling.c?


More information about the digitalmars-d-ldc mailing list