[llvm-commits] [compiler-rt] r146131 - in /compiler-rt/trunk/SDKs/linux: ./ README.txt usr/ usr/include/ usr/include/endian.h usr/include/limits.h usr/include/stdio.h usr/include/stdlib.h usr/include/string.h usr/include/sys/ usr/include/sys/mman

Daniel Dunbar daniel at zuster.org
Thu Dec 8 13:53:11 PST 2011


r146188, thanks!

 - Daniel

On Thu, Dec 8, 2011 at 9:47 AM, Matt Beaumont-Gay <matthewbg at google.com> wrote:
> On Wed, Dec 7, 2011 at 18:39, Daniel Dunbar <daniel at zuster.org> wrote:
>> Author: ddunbar
>> Date: Wed Dec  7 20:39:23 2011
>> New Revision: 146131
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=146131&view=rev
>> Log:
>> SDKs: Sketch an initial stub SDK for Linux, I believe this suffices for building
>> the main compiler-rt and profile modules, at least on x86.
>>
>> Added:
>>    compiler-rt/trunk/SDKs/linux/
>>    compiler-rt/trunk/SDKs/linux/README.txt
>>    compiler-rt/trunk/SDKs/linux/usr/
>>    compiler-rt/trunk/SDKs/linux/usr/include/
>>    compiler-rt/trunk/SDKs/linux/usr/include/endian.h
>>    compiler-rt/trunk/SDKs/linux/usr/include/limits.h
>>    compiler-rt/trunk/SDKs/linux/usr/include/stdio.h
>>    compiler-rt/trunk/SDKs/linux/usr/include/stdlib.h
>>    compiler-rt/trunk/SDKs/linux/usr/include/string.h
>>    compiler-rt/trunk/SDKs/linux/usr/include/sys/
>>    compiler-rt/trunk/SDKs/linux/usr/include/sys/mman.h
>>    compiler-rt/trunk/SDKs/linux/usr/include/sys/stat.h
>>    compiler-rt/trunk/SDKs/linux/usr/include/sys/types.h
>>    compiler-rt/trunk/SDKs/linux/usr/include/unistd.h
>>
>> Added: compiler-rt/trunk/SDKs/linux/README.txt
>> URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/SDKs/linux/README.txt?rev=146131&view=auto
>> ==============================================================================
>> --- compiler-rt/trunk/SDKs/linux/README.txt (added)
>> +++ compiler-rt/trunk/SDKs/linux/README.txt Wed Dec  7 20:39:23 2011
>> @@ -0,0 +1,2 @@
>> +This is a stub SDK for Linux. Currently, this has only been tested on i386 and
>> +x86_64 using the Clang compiler.
>>
>> Added: compiler-rt/trunk/SDKs/linux/usr/include/endian.h
>> URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/SDKs/linux/usr/include/endian.h?rev=146131&view=auto
>> ==============================================================================
>> --- compiler-rt/trunk/SDKs/linux/usr/include/endian.h (added)
>> +++ compiler-rt/trunk/SDKs/linux/usr/include/endian.h Wed Dec  7 20:39:23 2011
>> @@ -0,0 +1,29 @@
>> +/* ===-- endian.h - stub SDK header for compiler-rt -------------------------===
>> + *
>> + *                     The LLVM Compiler Infrastructure
>> + *
>> + * This file is dual licensed under the MIT and the University of Illinois Open
>> + * Source Licenses. See LICENSE.TXT for details.
>> + *
>> + * ===-----------------------------------------------------------------------===
>> + *
>> + * This is a stub SDK header file. This file is not part of the interface of
>> + * this library nor an official version of the appropriate SDK header. It is
>> + * intended only to stub the features of this header required by compiler-rt.
>> + *
>> + * ===-----------------------------------------------------------------------===
>> + */
>> +
>> +#ifndef __ENDIAN_H__
>> +#define __ENDIAN_H__
>> +
>> +#define __LITTLE_ENDIAN 1234
>> +#define __BIG_ENDIAN 4321
>> +
>> +#if defined(__LITTLE_ENDIAN__) || defined(__ORDER_LITTLE_ENDIAN__)
>> +#define __BYTE_ORDER __LITTLE_ENDIAN
>> +#else
>> +#define __BYTE_ORDER __BIG_ENDIAN
>> +#endif
>> +
>> +#endif /* __ENDIAN_H__ */
>>
>> Added: compiler-rt/trunk/SDKs/linux/usr/include/limits.h
>> URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/SDKs/linux/usr/include/limits.h?rev=146131&view=auto
>> ==============================================================================
>> --- compiler-rt/trunk/SDKs/linux/usr/include/limits.h (added)
>> +++ compiler-rt/trunk/SDKs/linux/usr/include/limits.h Wed Dec  7 20:39:23 2011
>> @@ -0,0 +1,23 @@
>> +/* ===-- limits.h - stub SDK header for compiler-rt -------------------------===
>> + *
>> + *                     The LLVM Compiler Infrastructure
>> + *
>> + * This file is dual licensed under the MIT and the University of Illinois Open
>> + * Source Licenses. See LICENSE.TXT for details.
>> + *
>> + * ===-----------------------------------------------------------------------===
>> + *
>> + * This is a stub SDK header file. This file is not part of the interface of
>> + * this library nor an official version of the appropriate SDK header. It is
>> + * intended only to stub the features of this header required by compiler-rt.
>> + *
>> + * ===-----------------------------------------------------------------------===
>> + */
>> +
>> +#ifndef __LIMITS_H__
>> +#define __LIMITS_H__
>> +
>> +/* This is only here as a landing pad for the include_next from the compiler's
>> +   built-in limits.h. */
>> +
>> +#endif /* __LIMITS_H__ */
>>
>> Added: compiler-rt/trunk/SDKs/linux/usr/include/stdio.h
>> URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/SDKs/linux/usr/include/stdio.h?rev=146131&view=auto
>> ==============================================================================
>> --- compiler-rt/trunk/SDKs/linux/usr/include/stdio.h (added)
>> +++ compiler-rt/trunk/SDKs/linux/usr/include/stdio.h Wed Dec  7 20:39:23 2011
>> @@ -0,0 +1,35 @@
>> +/* ===-- stdio.h - stub SDK header for compiler-rt --------------------------===
>> + *
>> + *                     The LLVM Compiler Infrastructure
>> + *
>> + * This file is dual licensed under the MIT and the University of Illinois Open
>> + * Source Licenses. See LICENSE.TXT for details.
>> + *
>> + * ===-----------------------------------------------------------------------===
>> + *
>> + * This is a stub SDK header file. This file is not part of the interface of
>> + * this library nor an official version of the appropriate SDK header. It is
>> + * intended only to stub the features of this header required by compiler-rt.
>> + *
>> + * ===-----------------------------------------------------------------------===
>> + */
>> +
>> +#ifndef __STDIO_H__
>> +#define __STDIO_H__
>> +
>> +typedef __SIZE_TYPE__ size_t;
>> +
>> +struct _IO_FILE;
>> +typedef struct _IO_FILE FILE;
>> +
>> +extern struct _IO_FILE *stdin;
>> +extern struct _IO_FILE *stdout;
>> +extern struct _IO_FILE *stderr;
>> +
>> +extern int fclose(FILE *);
>> +extern int fflush(FILE *);
>> +extern FILE *fopen(const char * restrict, const char * restrict);
>> +extern int fprintf(FILE * restrict, const char * restrict, ...);
>> +extern size_t fwrite(const void * restrict, size_t, size_t, FILE * restrict);
>> +
>> +#endif /* __STDIO_H__ */
>>
>> Added: compiler-rt/trunk/SDKs/linux/usr/include/stdlib.h
>> URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/SDKs/linux/usr/include/stdlib.h?rev=146131&view=auto
>> ==============================================================================
>> --- compiler-rt/trunk/SDKs/linux/usr/include/stdlib.h (added)
>> +++ compiler-rt/trunk/SDKs/linux/usr/include/stdlib.h Wed Dec  7 20:39:23 2011
>> @@ -0,0 +1,32 @@
>> +/* ===-- stdlib.h - stub SDK header for compiler-rt -------------------------===
>> + *
>> + *                     The LLVM Compiler Infrastructure
>> + *
>> + * This file is dual licensed under the MIT and the University of Illinois Open
>> + * Source Licenses. See LICENSE.TXT for details.
>> + *
>> + * ===-----------------------------------------------------------------------===
>> + *
>> + * This is a stub SDK header file. This file is not part of the interface of
>> + * this library nor an official version of the appropriate SDK header. It is
>> + * intended only to stub the features of this header required by compiler-rt.
>> + *
>> + * ===-----------------------------------------------------------------------===
>> + */
>> +
>> +#ifndef __STDLIB_H__
>> +#define __STDLIB_H__
>> +
>> +#define NULL ((void *)0)
>> +
>> +typedef __SIZE_TYPE__ size_t;
>> +
>> +void abort(void) __attribute__((__nothrow__)) __attribute__((__noreturn__));
>> +void free(void *) __attribute__((__nothrow__));
>> +char *getenv(const char *) __attribute__((__nothrow__))
>> +  __attribute__((__nonnull__(1)));
>> +  __attribute__((__warn_unused_result__));
>> +void *malloc(size_t) __attribute__((__nothrow__)) __attribute((__malloc__))
>> +     __attribute__((__warn_unused_result__));
>> +
>> +#endif /* __STDLIB_H__ */
>>
>> Added: compiler-rt/trunk/SDKs/linux/usr/include/string.h
>> URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/SDKs/linux/usr/include/string.h?rev=146131&view=auto
>> ==============================================================================
>> --- compiler-rt/trunk/SDKs/linux/usr/include/string.h (added)
>> +++ compiler-rt/trunk/SDKs/linux/usr/include/string.h Wed Dec  7 20:39:23 2011
>> @@ -0,0 +1,28 @@
>> +/* ===-- string.h - stub SDK header for compiler-rt -------------------------===
>> + *
>> + *                     The LLVM Compiler Infrastructure
>> + *
>> + * This file is dual licensed under the MIT and the University of Illinois Open
>> + * Source Licenses. See LICENSE.TXT for details.
>> + *
>> + * ===-----------------------------------------------------------------------===
>> + *
>> + * This is a stub SDK header file. This file is not part of the interface of
>> + * this library nor an official version of the appropriate SDK header. It is
>> + * intended only to stub the features of this header required by compiler-rt.
>> + *
>> + * ===-----------------------------------------------------------------------===
>> + */
>> +
>> +#ifndef __STRING_H__
>> +#define __STRING_H__
>> +
>> +typedef __SIZE_TYPE__ size_t;
>> +
>> +char *strcat(char *, const char *);
>> +char *strcpy(char *, const char *);
>> +char *strdup(const char *);
>> +size_t strlen(const char *);
>> +char *strncpy(char *, const char *, size_t);
>> +
>> +#endif /* __STRING_H__ */
>>
>> Added: compiler-rt/trunk/SDKs/linux/usr/include/sys/mman.h
>> URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/SDKs/linux/usr/include/sys/mman.h?rev=146131&view=auto
>> ==============================================================================
>> --- compiler-rt/trunk/SDKs/linux/usr/include/sys/mman.h (added)
>> +++ compiler-rt/trunk/SDKs/linux/usr/include/sys/mman.h Wed Dec  7 20:39:23 2011
>> @@ -0,0 +1,29 @@
>> +/* ===-- limits.h - stub SDK header for compiler-rt -------------------------===
>> + *
>> + *                     The LLVM Compiler Infrastructure
>> + *
>> + * This file is dual licensed under the MIT and the University of Illinois Open
>> + * Source Licenses. See LICENSE.TXT for details.
>> + *
>> + * ===-----------------------------------------------------------------------===
>> + *
>> + * This is a stub SDK header file. This file is not part of the interface of
>> + * this library nor an official version of the appropriate SDK header. It is
>> + * intended only to stub the features of this header required by compiler-rt.
>> + *
>> + * ===-----------------------------------------------------------------------===
>> + */
>> +
>> +#ifndef __SYS_MMAN_H__
>> +#define __SYS_MMAN_H__
>> +
>> +typedef __SIZE_TYPE__ size_t;
>> +
>> +#define PROT_READ 0x1
>> +#define PROT_WRITE 0x1
>
> Err, should be 0x2 I think?
>
>> +#define PROT_EXEC 0x4
>> +
>> +extern int mprotect (void *__addr, size_t __len, int __prot)
>> +  __attribute__((__nothrow__));
>> +
>> +#endif /* __SYS_MMAN_H__ */
>>
>> Added: compiler-rt/trunk/SDKs/linux/usr/include/sys/stat.h
>> URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/SDKs/linux/usr/include/sys/stat.h?rev=146131&view=auto
>> ==============================================================================
>> --- compiler-rt/trunk/SDKs/linux/usr/include/sys/stat.h (added)
>> +++ compiler-rt/trunk/SDKs/linux/usr/include/sys/stat.h Wed Dec  7 20:39:23 2011
>> @@ -0,0 +1,24 @@
>> +/* ===-- stat.h - stub SDK header for compiler-rt ---------------------------===
>> + *
>> + *                     The LLVM Compiler Infrastructure
>> + *
>> + * This file is dual licensed under the MIT and the University of Illinois Open
>> + * Source Licenses. See LICENSE.TXT for details.
>> + *
>> + * ===-----------------------------------------------------------------------===
>> + *
>> + * This is a stub SDK header file. This file is not part of the interface of
>> + * this library nor an official version of the appropriate SDK header. It is
>> + * intended only to stub the features of this header required by compiler-rt.
>> + *
>> + * ===-----------------------------------------------------------------------===
>> + */
>> +
>> +#ifndef __SYS_STAT_H__
>> +#define __SYS_STAT_H__
>> +
>> +typedef unsigned int mode_t;
>> +
>> +int mkdir(const char *, mode_t);
>> +
>> +#endif /* __SYS_STAT_H__ */
>>
>> Added: compiler-rt/trunk/SDKs/linux/usr/include/sys/types.h
>> URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/SDKs/linux/usr/include/sys/types.h?rev=146131&view=auto
>> ==============================================================================
>> --- compiler-rt/trunk/SDKs/linux/usr/include/sys/types.h (added)
>> +++ compiler-rt/trunk/SDKs/linux/usr/include/sys/types.h Wed Dec  7 20:39:23 2011
>> @@ -0,0 +1,20 @@
>> +/* ===-- stat.h - stub SDK header for compiler-rt ---------------------------===
>> + *
>> + *                     The LLVM Compiler Infrastructure
>> + *
>> + * This file is dual licensed under the MIT and the University of Illinois Open
>> + * Source Licenses. See LICENSE.TXT for details.
>> + *
>> + * ===-----------------------------------------------------------------------===
>> + *
>> + * This is a stub SDK header file. This file is not part of the interface of
>> + * this library nor an official version of the appropriate SDK header. It is
>> + * intended only to stub the features of this header required by compiler-rt.
>> + *
>> + * ===-----------------------------------------------------------------------===
>> + */
>> +
>> +#ifndef __SYS_TYPES_H__
>> +#define __SYS_TYPES_H__
>> +
>> +#endif /* __SYS_TYPES_H__ */
>>
>> Added: compiler-rt/trunk/SDKs/linux/usr/include/unistd.h
>> URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/SDKs/linux/usr/include/unistd.h?rev=146131&view=auto
>> ==============================================================================
>> --- compiler-rt/trunk/SDKs/linux/usr/include/unistd.h (added)
>> +++ compiler-rt/trunk/SDKs/linux/usr/include/unistd.h Wed Dec  7 20:39:23 2011
>> @@ -0,0 +1,26 @@
>> +/* ===-- unistd.h - stub SDK header for compiler-rt -------------------------===
>> + *
>> + *                     The LLVM Compiler Infrastructure
>> + *
>> + * This file is dual licensed under the MIT and the University of Illinois Open
>> + * Source Licenses. See LICENSE.TXT for details.
>> + *
>> + * ===-----------------------------------------------------------------------===
>> + *
>> + * This is a stub SDK header file. This file is not part of the interface of
>> + * this library nor an official version of the appropriate SDK header. It is
>> + * intended only to stub the features of this header required by compiler-rt.
>> + *
>> + * ===-----------------------------------------------------------------------===
>> + */
>> +
>> +#ifndef __UNISTD_H__
>> +#define __UNISTD_H__
>> +
>> +enum {
>> +  _SC_PAGESIZE = 30
>> +};
>> +
>> +extern long int sysconf (int __name) __attribute__ ((__nothrow__));
>> +
>> +#endif /* __UNISTD_H__ */
>>
>>
>> _______________________________________________
>> llvm-commits mailing list
>> llvm-commits at cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits




More information about the llvm-commits mailing list