(self)
| 1093 | super().__init__(**kwargs) |
| 1094 | |
| 1095 | def get_libcall_files(self): |
| 1096 | # Combining static linking with LTO is tricky under LLVM. The codegen that |
| 1097 | # happens during LTO can generate references to new symbols that didn't exist |
| 1098 | # in the linker inputs themselves. |
| 1099 | # These symbols are called libcalls in LLVM and are the result of intrinsics |
| 1100 | # and builtins at the LLVM level. These libcalls cannot themselves be part |
| 1101 | # of LTO because once the linker is running the LTO phase new bitcode objects |
| 1102 | # cannot be added to link. Another way of putting it: by the time LTO happens |
| 1103 | # the decision about which bitcode symbols to compile has already been made. |
| 1104 | # See: https://bugs.llvm.org/show_bug.cgi?id=44353. |
| 1105 | # To solve this we force certain parts of libc to never be compiled as LTO/bitcode. |
| 1106 | # Note that this also includes things that may be depended on by those |
| 1107 | # functions - fmin uses signbit, for example, so signbit must be here (so if |
| 1108 | # fmin is added by codegen, it will have all it needs). |
| 1109 | math_files = [ |
| 1110 | 'fmin.c', 'fminf.c', 'fminl.c', |
| 1111 | 'fmax.c', 'fmaxf.c', 'fmaxl.c', |
| 1112 | 'fmod.c', 'fmodf.c', 'fmodl.c', |
| 1113 | 'logf.c', 'logf_data.c', |
| 1114 | 'log2f.c', 'log2f_data.c', |
| 1115 | 'log10.c', 'log10f.c', |
| 1116 | 'exp.c', 'exp_data.c', |
| 1117 | 'exp2.c', |
| 1118 | 'exp2f.c', 'exp2f_data.c', |
| 1119 | 'exp10.c', 'exp10f.c', |
| 1120 | 'ldexp.c', 'ldexpf.c', 'ldexpl.c', |
| 1121 | 'scalbn.c', '__fpclassifyl.c', |
| 1122 | '__signbitl.c', '__signbitf.c', '__signbit.c', |
| 1123 | '__math_divzero.c', '__math_divzerof.c', |
| 1124 | '__math_oflow.c', '__math_oflowf.c', |
| 1125 | '__math_uflow.c', '__math_uflowf.c', |
| 1126 | '__math_invalid.c', '__math_invalidf.c', '__math_invalidl.c', |
| 1127 | 'pow.c', 'pow_data.c', 'log.c', 'log_data.c', 'log2.c', 'log2_data.c', |
| 1128 | 'scalbnf.c', |
| 1129 | ] |
| 1130 | math_files = files_in_path(path='system/lib/libc/musl/src/math', filenames=math_files) |
| 1131 | |
| 1132 | exit_files = files_in_path( |
| 1133 | path='system/lib/libc/musl/src/exit', |
| 1134 | filenames=['atexit.c']) |
| 1135 | |
| 1136 | other_files = files_in_path( |
| 1137 | path='system/lib/libc', |
| 1138 | filenames=['emscripten_memcpy.c', 'emscripten_memset.c', |
| 1139 | 'emscripten_memcpy_bulkmem.S', 'emscripten_memset_bulkmem.S', |
| 1140 | 'emscripten_scan_stack.c', |
| 1141 | 'emscripten_get_heap_size.c', # needed by malloc |
| 1142 | 'emscripten_memmove.c']) |
| 1143 | # Calls to iprintf can be generated during codegen. Ideally we wouldn't |
| 1144 | # compile these with -O2 like we do the rest of compiler-rt since its |
| 1145 | # probably not performance sensitive. However we don't currently have |
| 1146 | # a way to set per-file compiler flags. And hopefully we should be able |
| 1147 | # move all this stuff back into libc once we it LTO compatible. |
| 1148 | iprintf_files = files_in_path( |
| 1149 | path='system/lib/libc/musl/src/stdio', |
| 1150 | filenames=['__towrite.c', '__overflow.c', 'fwrite.c', 'fputs.c', |
| 1151 | 'getc.c', |
| 1152 | 'fputc.c', |
no test coverage detected