Annotation of dietlibc/dietfeatures.h, revision 1.80
1.4 fefe 1: #ifndef _DIETFEATURES_H
2: #define _DIETFEATURES_H
1.1 cvs 3:
4: /* feel free to comment some of these out to reduce code size */
5:
1.78 leitner 6: /* On i386, BSD socket syscalls have traditionally been implemented via
7: * a multiplexing syscall called "socketcall". But somewhere in the 3.x
8: * cycle, Linux got real syscalls for socket(), accept() etc, and now
9: * it would make sense to use those syscalls instead, if only to make
10: * seccomp sandboxes more platform agnostic. However, if you plan on
11: * running your program on an ancient kernel, you need the socketcall
12: * version instead. */
13: #define WANT_I386_SOCKETCALL
14:
1.13 fefe 15: #define WANT_FLOATING_POINT_IN_PRINTF
16: #define WANT_FLOATING_POINT_IN_SCANF
1.12 fefe 17: #define WANT_CHARACTER_CLASSES_IN_SCANF
1.1 cvs 18: #define WANT_NULL_PRINTF
1.52 sanjiyan 19: /* #define WANT_ERROR_PRINTF */
1.24 fefe 20: #define WANT_LONGLONG_PRINTF
1.42 olaf 21: #define WANT_LONGLONG_SCANF
1.1 cvs 22:
1.20 fefe 23: /* 128 or 2048 bytes buffer size? */
24: /* #define WANT_SMALL_STDIO_BUFS */
25:
1.40 fefe 26: /* want fread to read() directly if size of data is larger than buffer?
27: * This costs a few bytes but is worth it if the application is already
28: * buffering. */
29: #define WANT_FREAD_OPTIMIZATION
30:
1.34 fefe 31: /* this is only for meaningful for ttyname and sysconf_cpus so far */
1.40 fefe 32: #define SLASH_PROC_OK
1.1 cvs 33:
1.65 leitner 34: /* use errno_location instead of errno; NEEDED FOR MULTI-THREADING! */
1.20 fefe 35: #define WANT_THREAD_SAFE
1.1 cvs 36:
1.65 leitner 37: /* support __thread; NEEDED FOR MULTI-THREADING! */
1.64 leitner 38: #define WANT_TLS
39:
1.80 ! leitner 40: /* run constructors/destructors of static objects,
! 41: * and functions with __attribute__((constructor)) */
! 42: #define WANT_CTOR
! 43:
! 44: /* call __register_frame_info so C++ exception handling works */
! 45: #define WANT_EXCEPTIONS
1.1 cvs 46:
1.57 leitner 47: /* GDB support in the dynamic linker */
48: #define WANT_LD_SO_GDB_SUPPORT
49:
1.1 cvs 50: /* do you want smaller or faster string routines? */
1.63 leitner 51: #define WANT_FASTER_STRING_ROUTINES
1.1 cvs 52:
1.77 leitner 53: /* define this to have strncpy and stpncpy zero-fill and not just
54: * zero-terminate the destination string */
1.43 fefe 55: /* #define WANT_FULL_POSIX_COMPAT */
56:
1.47 leitner 57: /* on i386, Linux has an alternate syscall method since 2002/12/16 */
58: /* on my Athlon XP, it is twice as fast, but it's only in kernel 2.5 */
1.53 leitner 59: /* 20040118: enabling this breaks User Mode Linux! It's their fault. */
1.48 leitner 60: #define WANT_SYSENTER
1.47 leitner 61:
1.4 fefe 62: #define WANT_LINKER_WARNINGS
63:
1.7 fefe 64: /* you need to define this if you want to run your programs with large
1.31 fefe 65: * file support on kernel 2.2 or 2.0 */
1.7 fefe 66: #define WANT_LARGEFILE_BACKCOMPAT
67:
1.8 fefe 68: /* do you want localtime(3) to read /etc/localtime?
69: * Needed for daylight saving time etc. */
70: #define WANT_TZFILE_PARSER
1.1 cvs 71:
1.21 fefe 72: /* do you want the DNS routines to parse and use "domain" and "search"
73: * lines from /etc/resolv.conf? Normally not used on boot floppies and
74: * embedded environments. */
75: #define WANT_FULL_RESOLV_CONF
76:
1.45 fefe 77: /* do you want IPv6 transport support in the DNS resolver? */
78: #define WANT_IPV6_DNS
79:
1.27 fefe 80: /* do you want gethostbyname and friends to consult /etc/hosts? */
81: #define WANT_ETC_HOSTS
82:
1.46 fefe 83: /* do you want gethostbyname to understand dotted decimal IP numbers
84: * directly and not try to resolve them? */
85: #define WANT_INET_ADDR_DNS
86:
1.29 fefe 87: /* do you want math functions high precision rather than fast/small? */
88: #define WANT_HIGH_PRECISION_MATH
89:
90: /* do you want support for matherr? */
91: #define WANT_MATHERR
92:
1.30 fefe 93: /* do you want crypt(3) to use MD5 if the salt starts with "$1$"? */
94: #define WANT_CRYPT_MD5
95:
1.77 leitner 96: /* do you want crypt(3) to use SHA256 if the salt starts with "$5$? */
97: #define WANT_CRYPT_SHA256
98:
99: /* do you want crypt(3) to use SHA512 if the salt starts with "$6$? */
100: #define WANT_CRYPT_SHA512
101:
1.32 fefe 102: /* do you want diet to include a safeguard dependency to make linking
1.45 fefe 103: * against glibc fail? This may fail with older binutils. */
1.32 fefe 104: #define WANT_SAFEGUARD
1.38 olaf 105:
1.60 leitner 106: /* This enables zeroconf DNS aka Rendezvous aka Bonjour. */
107: /* This code will try zeroconf DNS if you ask for host.local or if you
108: * ask for an unqualified hostname */
1.59 leitner 109: #define WANT_PLUGPLAY_DNS
1.49 leitner 110:
1.68 leitner 111: /* This enables LLMNR, the MS variant of zeroconf DNS. This only works
112: * if you also enabled WANT_PLUGPLAY_DNS */
113: #define WANT_LLMNR
114:
1.70 leitner 115: /* Uncomment this if you want DNS lookups to fail if /etc/hosts contains
116: * an entry but it's for a different record type */
117: /* #define WANT_HOSTS_GIVEUP_EARLY */
118:
1.67 leitner 119: /* Do you want valgrind support? If enabled, the startup code will
120: * check for valgrind, and if detected, turn off optimized SIMD string
121: * routines that cause false positives in valgrind. This enlarges and
122: * slightly slows down your code! */
123: #define WANT_VALGRIND_SUPPORT
124:
1.54 leitner 125: /* do you want that malloc(0) return a pointer to a "zero-length" object
1.38 olaf 126: * that is realloc-able; means realloc(..,size) gives a NEW object (like a
127: * call to malloc(size)).
128: * WARNING: this violates C99 */
129: /* #define WANT_MALLOC_ZERO */
130:
1.62 leitner 131: /* do you want free to overwrite freed data immediately, in the hope of
132: * catching people accessing pointers after they were freed? This does
133: * a memset with 0x55 as a value. which is not NULL and not -1. Please
134: * note that this is the shotgun method for debugging, what you really
135: * want is valgrind. */
136: /* #define WANT_FREE_OVERWRITE */
137:
1.54 leitner 138: /* This enables a stack gap. Basically, the start code does not run
139: * main but stackgap, which then does alloca(random()) and calls main.
140: * The effect is that buffer overflow exploits will no longer be able to
141: * know the address of the buffer. Cost: 62 bytes code on x86. */
1.56 leitner 142: /* WARNING: this appears to break with some binutils versions. Works
143: * for me with binutils 2.15. The symptom is an error message that
144: * `main' can not be found. */
1.58 leitner 145: /* #define WANT_STACKGAP */
1.32 fefe 146:
1.79 leitner 147: /* For SSP initialization, dietlibc usually uses randomness given by the
148: * kernel in the ELF auxvec. Some very old kernels do not pass this, and
149: * for them dietlibc will open /dev/urandom to get randomness. Undef
150: * this if you don't need that bloat. */
151: // #define WANT_URANDOM_SSP
152:
1.69 leitner 153: /* #define this if you want GNU bloat like program_invocation_short_name
154: * and program_invocation_name to be there. This functionality is not
155: * portable and adds useless bloat to libc. Help stomp out code
156: * depending on this! util-linux, I'm looking at you here! */
157: #define WANT_GNU_STARTUP_BLOAT
158:
1.61 leitner 159: /* Include support for ProPolice/SSP, calls guard_setup */
160: /* ProPolice is part of gcc 4.1 and up, there were patches for earlier
161: * versions. To make use of this, compile your application with
1.64 leitner 162: * -fstack-protector. */
1.66 leitner 163: /* If you compile dietlibc without WANT_SSP and then try to link code
164: * compiled with -fstack-protector against it, the binary will segfault
165: * when calling that code. */
1.61 leitner 166: #if (__GNUC__>4) || ((__GNUC__==4) && (__GNUC_MINOR__>=1))
167: #define WANT_SSP
168: #endif
169:
170:
171:
1.1 cvs 172: /* stop uncommenting here ;-) */
1.72 sanjiyan 173:
174: /* Several 'syscalls' on x86_64 need vdso set... */
175: #if defined(__x86_64__) && ! defined(WANT_STACKGAP)
176: #define WANT_STACKGAP
177: #endif
178:
1.70 leitner 179: #if defined(WANT_SSP) || defined(WANT_STACKGAP) || defined(WANT_TLS)
1.61 leitner 180: #define CALL_IN_STARTCODE stackgap
1.77 leitner 181: #define CALL_IN_STARTCODE_PIE stackgap_pie
1.61 leitner 182: #else
183: #define CALL_IN_STARTCODE main
184: #endif
185:
1.1 cvs 186: #ifndef WANT_FASTER_STRING_ROUTINES
187: #define WANT_SMALL_STRING_ROUTINES
1.4 fefe 188: #endif
189:
1.33 olaf 190: #ifdef __DYN_LIB
1.39 olaf 191: /* with shared libraries you MUST have a dynamic aware startcode */
1.80 ! leitner 192: #ifndef WANT_CTOR
! 193: #define WANT_CTOR
1.35 olaf 194: #endif
1.79 leitner 195: /* safeguard crashes with shared objects ... */
1.35 olaf 196: #ifdef WANT_SAFEGUARD
197: #undef WANT_SAFEGUARD
1.33 olaf 198: #endif
199: #endif
200:
1.73 leitner 201: #if defined(__x86_64__) && defined(__ILP32__)
202: #undef WANT_LARGEFILE_BACKCOMPAT
203: #endif
204:
1.1 cvs 205: #endif
LinuxTV legacy CVS <linuxtv.org/cvs>