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

Nuno Lopes nunoplopes at sapo.pt
Sun Aug 9 14:58:39 PDT 2009


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 




More information about the llvm-commits mailing list