[llvm-commits] [compiler-rt] r78538 - in/compiler-rt/trunk/lib: enable_execute_stack.c endianness.h

Edward O'Callaghan eocallaghan at auroraux.org
Sun Aug 9 15:22:54 PDT 2009


> The idea is to avoid the runtime overhead, so I still believe it should be

Hmm, OK valid point although how much overhead is it really?

> done at config time. Anyway, do you really thing it may return -1?

I have no idea, I did say I was not sure for _SC_PAGESIZE.

BTW, Do you know where getpagesize() is from, never seen that before?

Cheers,
Edward.

2009/8/9 Nuno Lopes <nunoplopes at sapo.pt>:
> Hi,
>
>> > -        const uintptr_t pageSize = getpagesize();
>> > +        const uintptr_t pageSize = sysconf(_SC_PAGESIZE);
>>
>> Perhaps drop the Apple pre-processor checks and instead rely on the
>> sysconf() result or default to 4096 if we get a -1 returned, seems
>> much cleaner?
>
> The idea is to avoid the runtime overhead, so I still believe it should be
> done at config time. Anyway, do you really thing it may return -1?
>
> Nuno
>
>
>
>> 2009/8/9 Nuno Lopes
>> Author: nlopes
>> Date: Sun Aug 9 13:59:21 2009
>> New Revision: 78538
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=78538&view=rev
>> Log:
>> fix build on linux
>>
>> Modified:
>> compiler-rt/trunk/lib/enable_execute_stack.c
>> compiler-rt/trunk/lib/endianness.h
>>
>> Modified: compiler-rt/trunk/lib/enable_execute_stack.c
>> URL:
>> http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/enable_execute_stack.c?rev=78538&r1=78537&r2=78538&view=diff
>>
>> ==============================================================================
>> --- compiler-rt/trunk/lib/enable_execute_stack.c (original)
>> +++ compiler-rt/trunk/lib/enable_execute_stack.c Sun Aug 9 13:59:21 2009
>> @@ -30,7 +30,7 @@
>> const uintptr_t pageSize = 4096;
>> #else
>> /* FIXME: We should have a configure check for this. */
>> - const uintptr_t pageSize = getpagesize();
>> + const uintptr_t pageSize = sysconf(_SC_PAGESIZE);
>> #endif
>> const uintptr_t pageAlignMask = ~(pageSize-1);
>> uintptr_t p = (uintptr_t)addr;
>>
>> Modified: compiler-rt/trunk/lib/endianness.h
>> URL:
>> http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/endianness.h?rev=78538&r1=78537&r2=78538&view=diff
>>
>> ==============================================================================
>> --- compiler-rt/trunk/lib/endianness.h (original)
>> +++ compiler-rt/trunk/lib/endianness.h Sun Aug 9 13:59:21 2009
>> @@ -72,7 +72,7 @@
>>
>> /* .. */
>>
>> -#if defined(__Linux__)
>> +#if defined(__linux__)
>> #include <endian.h>
>>
>> #if __BYTE_ORDER == __BIG_ENDIAN
>>
>>
>> _______________________________________________
>> llvm-commits mailing list
>> llvm-commits at cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>>
>
>
>
> --
> --
> Edward O'Callaghan
> http://www.auroraux.org/
> eocallaghan at auroraux dot org
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>



-- 
-- 
Edward O'Callaghan
http://www.auroraux.org/
eocallaghan at auroraux dot org




More information about the llvm-commits mailing list