Skip to content

Commit

Permalink
Add provisions for bootstrap compiler
Browse files Browse the repository at this point in the history
  • Loading branch information
Victorious3 committed Nov 24, 2023
1 parent b31d748 commit c33aea2
Show file tree
Hide file tree
Showing 13 changed files with 763 additions and 2,884 deletions.
9 changes: 8 additions & 1 deletion include/cstd.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*
/*clang.
%EXCLUDE __acos __asin __atan __atan2 __cos __sin __tan __cosh __sinh __tanh __acosh __asinh __atanh __exp __frexp __ldexp __log __log10 __modf __expm1 __log1p __logb __exp2 __log2 __pow __sqrt __hypot __cbrt __ceil __fabs __floor __fmod __drem __significand __copysign __nan __j0 __j1 __jn __y0 __y1 __yn __erf __erfc __lgamma __tgamma __gamma __lgamma_r __rint __nextafter __nexttoward __remainder __scalbn __ilogb __scalbln __nearbyint __round __trunc __remquo __lrint __llrint __lround __llround __fdim __fmax __fmin __fma __scalb __acosf __asinf __atanf __atan2f __cosf __sinf __tanf __coshf __sinhf __tanhf __acoshf __asinhf __atanhf __expf __frexpf __ldexpf __logf __log10f __modff __expm1f __log1pf __logbf __exp2f __log2f __powf __sqrtf __hypotf __cbrtf __ceilf __fabsf __floorf __fmodf __dremf __significandf __copysignf __nanf __j0f __j1f __jnf __y0f __y1f __ynf __erff __erfcf __lgammaf __tgammaf __gammaf __lgammaf_r __rintf __nextafterf __nexttowardf __remainderf __scalbnf __ilogbf __scalblnf __nearbyintf __roundf __truncf __remquof __lrintf __llrintf __lroundf __llroundf __fdimf __fmaxf __fminf __fmaf __scalbf __acosl __asinl __atanl __atan2l __cosl __sinl __tanl __coshl __sinhl __tanhl __acoshl __asinhl __atanhl __expl __frexpl __ldexpl __logl __log10l __modfl __expm1l __log1pl __logbl __exp2l __log2l __powl __sqrtl __hypotl __cbrtl __ceill __fabsl __floorl __fmodl __dreml __significandl __copysignl __nanl __j0l __j1l __jnl __y0l __y1l __ynl __erfl __erfcl __lgammal __tgammal __gammal __lgammal_r __rintl __nextafterl __nexttowardl __remainderl __scalbnl __ilogbl __scalblnl __nearbyintl __roundl __truncl __remquol __lrintl __llrintl __lroundl __llroundl __fdiml __fmaxl __fminl __fmal __scalbl __builtin_va_start __builtin_va_end alloca tmpnam tmpnam_r tempnam sys_errlist sys_nerr mktemp sigstack sigreturn siggetmask sys_siglist _sys_siglist
%EXCLUDE timer_create timer_delete timer_settime timer_gettime timer_getoverrun
%EXCLUDE __builtin_fabsf __builtin_inff __builtin_fabs __builtin_inf __builtin_fabsl __builtin_infl longjmperror
Expand Down Expand Up @@ -35,6 +35,13 @@ Inline functions
%EXCLUDE _vsprintf_s_l fwprintf __ascii_tolower _vfprintf_l __ascii_towupper __threadid _ischartype_l
%EXCLUDE __threadhandle _vsnprintf_l __local_stdio_printf_options _vfwprintf_l swprintf __local_stdio_scanf_options _vswprintf_c_l
%EXCLUDE __bswap_16 __bswap_32 __bswap_64 __uint16_identity __uint32_identity __uint64_identity
MUSL doesn't provide these
%EXCLUDE strtoq strtouq random_r srandom_r initstate_r setstate_r drand48_r erand48_r lrand48_r nrand48_r mrand48_r jrand48_r srand48_r
%EXCLUDE seed48_r lcong48_r on_exit qecvt qfcvt qgcvt ecvt_r fcvt_r qecvt_r qfcvt_r rpmatch __strtok_r timelocal dysize __isinf __finite
%EXCLUDE __isnan __iseqsig __issignaling isinf isnan gamma __isinff __finitef __isnanf __iseqsigf __issignalingf isinff isnanf gammaf
%EXCLUDE __isinfl __finitel __isnanl __iseqsigl __issignalingl isinfl finitel dreml significandl isnanl j0l j1l jnl y0l y1l ynl gammal
%EXCLUDE scalbl __assert_perror_fail __assert ssignal gsignal sigblock sigsetmask _toupper _tolower
*/

#include <stdlib.h>
Expand Down
2 changes: 1 addition & 1 deletion include/gencstd.py
Original file line number Diff line number Diff line change
Expand Up @@ -622,7 +622,7 @@ def extract(node: clang.Cursor):
except ValueError: pass

index = clang.Index.create()
tu = index.parse(folder / f"{name}.h", options =
tu = index.parse(folder / f"{name}.h", args = ["-DMUSL"], options =
clang.TranslationUnit.PARSE_DETAILED_PROCESSING_RECORD
| clang.TranslationUnit.PARSE_SKIP_FUNCTION_BODIES
| clang.TranslationUnit.PARSE_PRECOMPILED_PREAMBLE
Expand Down
7 changes: 7 additions & 0 deletions include/linux.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@
%EXCLUDE shm_open crypt shm_unlink
%EXCLUDE __builtin_bswap32 __builtin_bswap64 profil add_profil unwhiteout UUID_NULL
%EXCLUDE __bswap_16 __bswap_32 __bswap_64 __uint16_identity __uint32_identity __uint64_identity
MUSL Doesn't provide these
%EXCLUDE gsignal sigblock sigsetmask __getpgid ttyslot sethostid strtoq strtouq random_r srandom_r initstate_r
%EXCLUDE setstate_r drand48_r erand48_r lrand48_r nrand48_r mrand48_r jrand48_r srand48_r seed48_r lcong48_r
%EXCLUDE on_exit qecvt qfcvt qgcvt ecvt_r fcvt_r qecvt_r qfcvt_r rpmatch getdirentries ssignal
*/

#ifndef _WIN32
Expand All @@ -29,5 +34,7 @@
#include <fnmatch.h>
#include <dirent.h>
#include <errno.h>
#ifndef MUSL
#include <execinfo.h>
#endif
#endif
8 changes: 4 additions & 4 deletions include/linux/bfd.pr
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,8 @@ export const __llvm__: int = 1
export const __clang__: int = 1
export const __clang_major__: int = 16
export const __clang_minor__: int = 0
export const __clang_patchlevel__: int = 0
export const __clang_version__: [char] = "16.0.0 "
export const __clang_patchlevel__: int = 6
export const __clang_version__: [char] = "16.0.6 (++20231112100455+7cbf1a259152-1~exp1~20231112100542.106)"
export const __GNUC__: int = 4
export const __GNUC_MINOR__: int = 2
export const __GNUC_PATCHLEVEL__: int = 1
Expand All @@ -135,7 +135,7 @@ export const __OPENCL_MEMORY_SCOPE_DEVICE: int = 2
export const __OPENCL_MEMORY_SCOPE_ALL_SVM_DEVICES: int = 3
export const __OPENCL_MEMORY_SCOPE_SUB_GROUP: int = 4
export const __PRAGMA_REDEFINE_EXTNAME: int = 1
export const __VERSION__: [char] = "Clang 16.0.0"
export const __VERSION__: [char] = "Ubuntu Clang 16.0.6 (++20231112100455+7cbf1a259152-1~exp1~20231112100542.106)"
export const __OBJC_BOOL_IS_BOOL: int = 0
export const __CONSTANT_CFSTRINGS__: int = 1
export const __clang_literal_encoding__: [char] = "UTF-8"
Expand Down Expand Up @@ -397,6 +397,7 @@ export const __STDC__: int = 1
export const __STDC_HOSTED__: int = 1
export const __STDC_UTF_16__: int = 1
export const __STDC_UTF_32__: int = 1
export const MUSL: int = 1
export const __GCC_HAVE_DWARF2_CFI_ASM: int = 1
export const _ANSIDECL_H: int = 1
export const __WORDSIZE: int = 64
Expand Down Expand Up @@ -485,7 +486,6 @@ export const __GLIBC_USE_IEC_60559_FUNCS_EXT_C2X: int = 0
export const __GLIBC_USE_IEC_60559_TYPES_EXT: int = 0
export const _BITS_WCHAR_H: int = 1
export const _BITS_STDINT_UINTN_H: int = 1
export const __GNUC_VA_LIST: int = 1
export const _SYS_STAT_H: int = 1
export const _BITS_STAT_H: int = 1
export const _STAT_VER_KERNEL: int = 0
Expand Down
Loading

0 comments on commit c33aea2

Please sign in to comment.