1define SOURCE_HELLO 2#include <stdio.h> 3int main(void) 4{ 5 return puts(\"hi\"); 6} 7endef 8 9ifndef NO_DWARF 10define SOURCE_DWARF 11#include <dwarf.h> 12#include <elfutils/libdw.h> 13#include <elfutils/version.h> 14#ifndef _ELFUTILS_PREREQ 15#error 16#endif 17 18int main(void) 19{ 20 Dwarf *dbg = dwarf_begin(0, DWARF_C_READ); 21 return (long)dbg; 22} 23endef 24endif 25 26define SOURCE_LIBELF 27#include <libelf.h> 28 29int main(void) 30{ 31 Elf *elf = elf_begin(0, ELF_C_READ, 0); 32 return (long)elf; 33} 34endef 35 36define SOURCE_GLIBC 37#include <gnu/libc-version.h> 38 39int main(void) 40{ 41 const char *version = gnu_get_libc_version(); 42 return (long)version; 43} 44endef 45 46define SOURCE_BIONIC 47#include <android/api-level.h> 48 49int main(void) 50{ 51 return __ANDROID_API__; 52} 53endef 54 55define SOURCE_ELF_MMAP 56#include <libelf.h> 57int main(void) 58{ 59 Elf *elf = elf_begin(0, ELF_C_READ_MMAP, 0); 60 return (long)elf; 61} 62endef 63 64ifndef NO_SLANG 65define SOURCE_SLANG 66#include <slang.h> 67 68int main(void) 69{ 70 return SLsmg_init_smg(); 71} 72endef 73endif 74 75ifndef NO_GTK2 76define SOURCE_GTK2 77#pragma GCC diagnostic ignored \"-Wstrict-prototypes\" 78#include <gtk/gtk.h> 79#pragma GCC diagnostic error \"-Wstrict-prototypes\" 80 81int main(int argc, char *argv[]) 82{ 83 gtk_init(&argc, &argv); 84 85 return 0; 86} 87endef 88 89define SOURCE_GTK2_INFOBAR 90#pragma GCC diagnostic ignored \"-Wstrict-prototypes\" 91#include <gtk/gtk.h> 92#pragma GCC diagnostic error \"-Wstrict-prototypes\" 93 94int main(void) 95{ 96 gtk_info_bar_new(); 97 98 return 0; 99} 100endef 101endif 102 103ifndef NO_LIBPERL 104define SOURCE_PERL_EMBED 105#include <EXTERN.h> 106#include <perl.h> 107 108int main(void) 109{ 110perl_alloc(); 111return 0; 112} 113endef 114endif 115 116ifndef NO_LIBPYTHON 117define SOURCE_PYTHON_VERSION 118#include <Python.h> 119#if PY_VERSION_HEX >= 0x03000000 120 #error 121#endif 122int main(void) 123{ 124 return 0; 125} 126endef 127define SOURCE_PYTHON_EMBED 128#include <Python.h> 129int main(void) 130{ 131 Py_Initialize(); 132 return 0; 133} 134endef 135endif 136 137define SOURCE_BFD 138#include <bfd.h> 139 140int main(void) 141{ 142 bfd_demangle(0, 0, 0); 143 return 0; 144} 145endef 146 147define SOURCE_CPLUS_DEMANGLE 148extern char *cplus_demangle(const char *, int); 149 150int main(void) 151{ 152 cplus_demangle(0, 0); 153 return 0; 154} 155endef 156 157define SOURCE_STRLCPY 158#include <stdlib.h> 159extern size_t strlcpy(char *dest, const char *src, size_t size); 160 161int main(void) 162{ 163 strlcpy(NULL, NULL, 0); 164 return 0; 165} 166endef 167 168ifndef NO_LIBUNWIND 169define SOURCE_LIBUNWIND 170#include <libunwind.h> 171#include <stdlib.h> 172 173extern int UNW_OBJ(dwarf_search_unwind_table) (unw_addr_space_t as, 174 unw_word_t ip, 175 unw_dyn_info_t *di, 176 unw_proc_info_t *pi, 177 int need_unwind_info, void *arg); 178 179 180#define dwarf_search_unwind_table UNW_OBJ(dwarf_search_unwind_table) 181 182int main(void) 183{ 184 unw_addr_space_t addr_space; 185 addr_space = unw_create_addr_space(NULL, 0); 186 unw_init_remote(NULL, addr_space, NULL); 187 dwarf_search_unwind_table(addr_space, 0, NULL, NULL, 0, NULL); 188 return 0; 189} 190endef 191endif 192 193ifndef NO_BACKTRACE 194define SOURCE_BACKTRACE 195#include <execinfo.h> 196#include <stdio.h> 197 198int main(void) 199{ 200 backtrace(NULL, 0); 201 backtrace_symbols(NULL, 0); 202 return 0; 203} 204endef 205endif 206 207ifndef NO_LIBAUDIT 208define SOURCE_LIBAUDIT 209#include <libaudit.h> 210 211int main(void) 212{ 213 return audit_open(); 214} 215endef 216endif 217 218define SOURCE_ON_EXIT 219#include <stdio.h> 220 221int main(void) 222{ 223 return on_exit(NULL, NULL); 224} 225endef 226 227define SOURCE_LIBNUMA 228#include <numa.h> 229#include <numaif.h> 230 231int main(void) 232{ 233 numa_available(); 234 return 0; 235} 236endef 237