This project is mirrored from Pull mirroring failed .
Repository mirroring has been paused due to too many failed attempts. It can be resumed by a project maintainer or owner.
Last successful update .
  1. 16 Jun, 2020 1 commit
    • herman ten brugge's avatar
      Add bound checking to arm, arm64 and riscv64 · 0b8ee736
      herman ten brugge authored
      Checked on:
      - i386/x86_64 (linux/windows)
      - arm/arm64 (rapberry pi)
      - riscv64 (simulator)
      Not tested for arm softfloat because raspberry pi does not support it.
        add arm-asm.c to arm64_FILES
        add riscv64-asm.c (new file) to riscv64_FILES
        add fetch_and_add_arm.o(new file) to ARM_O
        add fetch_and_add_arm64.o(new file) to ARM64_O
        add fetch_and_add_riscv64.o(new file) to RISCV64_O
        add $(BCHECK_O) to OBJ-arm/OBJ-arm64/OBJ-riscv64
        Enable CONFIG_TCC_BCHECK for arm32/arm64/riscv64
        Add arm-asm.c, riscv64-asm.c
        for arm use memmove4 instead of memcpy4
        for arm use memmove8 instead of memcpy8
        put_extern_sym2: for arm check memcpy/memmove/memset/memmove4/memmove8
                         only use alloca for i386/x86_64
        for arm use memmove4 instead of memcpy4
        for arm use memmove8 instead of memcpy8
        fix builtin_frame_address/builtin_return_address for arm/riscv64
        Add riscv64 support
        fix rt_getcontext/rt_get_caller_pc for arm
        tcc_load_dll: Print filename for bad architecture
        add arm-asm.c/riscv64-asm.c
        Add arm, arm64, riscv64 support for bound checking
        add __bound___aeabi_memcpy/__bound___aeabi_memmove
            __bound___aeabi_memset for arm
        call fetch_and_add_arm/fetch_and_add_arm64/fetch_and_add_riscv64
        __bound_init: Fix type for start/end/ad
        __bound_malloc/__bound_memalign/__bound_realloc/__bound_calloc: Use size + 1
        add bound checking code like i386/x86_64
        assign_regs: only malloc if nb_args != 0
        gen_opi/gen_opf: Fix reload problems
        relocate_plt: Fix address calculating
        add bound checking code like i386/x86_64
        load/store: remove VT_BOUNDED from sv->r
        arm64_hfa_aux/arm64_hfa_aux: Fix array code
        gfunc_prolog: only malloc if n != 0
        code_reloc/gotplt_entry_type/relocate: add R_AARCH64_LDST64_ABS_LO12_NC
        relocate: Use addXXle instead of writeXXle
        add bound checking code like i386/x86_64
        relocate: Use addXXle instead of writeXXle
        gen_bounds_epilog: Fix code (unrelated)
        add $(BTESTS) for arm/arm64/riscv64
        Use 85 only on i386/x86_64 because of asm code
        Use 113 only on i386/x86_64 because of DLL code
        Add 112/114/115/116 for arm/arm64/riscv64
        Fix FILTER (failed on riscv64)
        Only use alloca for i386/x86_64
  2. 05 Jun, 2020 1 commit
    • Michael Matz's avatar
      Fix type compatiblity of enums and ints · 9eef3399
      Michael Matz authored
      an enum must be compatible with one or more integer type,
      so adjust the test accordingly.  That means the following
      redeclarations should work:
        enum e6 { E1 = -1, E0 };
        void f3(enum e6);
        void f3(int);        // should work as int and e6 are compatible
      while the following should not:
        void f4(enum e6 e);
        void f4(unsigned e); // should error as unsigned and e6 are incompatible
  3. 04 Jun, 2020 1 commit
    • Michael Matz's avatar
      pp: Move errors about stray backslashes · 068d5b3d
      Michael Matz authored
      they were emitted too early, in particular also in macro
      substitution which might turn out to not be stray in case it's
      further stringified.  Check in next() instead.  Add two testcases
      that an error is still emitted for obvious top-level baskslashes,
      and that stringifying such a thing works.
  4. 02 Jun, 2020 1 commit
  5. 01 Jun, 2020 2 commits
  6. 27 May, 2020 1 commit
  7. 25 May, 2020 1 commit
    • herman ten brugge's avatar
      Add sigsetjmp/siglongjmp bound checking support · 3b617fdc
      herman ten brugge authored
      - Add sigsetjmp/__sigsetjmp/siglongjmp
      - redirect sigsetjmp/siglongjmp to bcheck.c code
      - gcall_or_jmp: Set func_bound_add_epilog also when sigsetjmp is called
      - gen_bounds_epilog: Only call __bound_local_new when needed (unrelated)
      - Add __bound_siglongjmp
      - __bound_setjmp/__bound_long_jump: Check no_checking
      - Optimize __bound_local_delete (unrelated)
      Modify testcase:
      - 114_bound_signal
  8. 24 May, 2020 2 commits
    • herman ten brugge's avatar
      Fix gcc10 warnings · 045632de
      herman ten brugge authored
      - load/gen_opf: set v1.sym to NULL
      - Add -gstabs -fno-omit-frame-pointer -Wno-unused-function -Wno-unused-variable
      - tcc_backtrace: Prevent __builtin_frame_address warning
      - struct_layout: Set t.t to VT_BYTE
      - default_debug: Use octal instead of -1 to make size_t work
      - tal_realloc_impl: Only memcpy when p set
      - gen_bounds_epilog: Do not save/restore rcx (not caller/callee saved)
                           This also made stack not aligned to 16 bytes.
    • herman ten brugge's avatar
      Add setjmp/longjmp bound checking support · b5b92c7d
      herman ten brugge authored
      - Add __bound_setjmp/setjmp/_setjmp/longjmp
      - redirect setjmp/longjmp to bcheck.c code
      - Change func_bound_alloca_used into func_bound_add_epilog
      - Set func_bound_add_epilog also when setjmp is called
      - Add __bound_setjmp/__bound_longjmp
      - __bound_local_delete: remove setjmp if used in function
      - __bound_exit: clear setjmp list and print statistic
      - make malloc_redir more readable (unrelated)
      New testcases:
      - 115_bound_setjmp
      - 116_bound_setjmp2
  9. 13 May, 2020 2 commits
    • grischka's avatar
      tccgen.c: merge more function attributes · 4429cef9
      grischka authored
      Merge function attributes with those given given for the
      prototype, also handle post-decl appearance such as
          void func() __attribute__((noreturn))
      Also, some test fixes (unrelated).
    • grischka's avatar
      make SILENT=yes · 7bb5454e
      grischka authored
      This allows to run make more silently.
      Also, turns off debug info for binaries by default,
      but adds a switch to get it back easily
          ./configure --debug
  10. 11 May, 2020 4 commits
  11. 05 May, 2020 2 commits
  12. 04 May, 2020 1 commit
  13. 03 May, 2020 1 commit
    • herman ten brugge's avatar
      Add symbolic debug support · 3e731e3a
      herman ten brugge authored
      This allows debugging with variables/structs/unions/enums/bitfields.
      Add new functions:
      - tcc_debug_stabs: store stabs debug info
      - tcc_debug_stabn: store stabn debug info
      - tcc_get_debug_info: generate stabs debug info
      - tcc_debug_finish: store debug info in debug section
      - tcc_add_debug_info: Add function debug info
      Update functions:
      - tcc_debug_end: free debug hash
      - tcc_debug_funcstart: Generate correct function debug info
      - tcc_debug_funcend: Finish debug info
      - put_extern_sym2: Generate debug info for symbols
      - pop_local_syms: Add debug info
      - prev_scope: Add local symbols
  14. 16 Apr, 2020 3 commits
    • Michael Matz's avatar
      riscv64: fcvt.d.s doesn't need a rounding mode · fb1fb821
      Michael Matz authored
      it doesn't round so the RM field can be zero.  According to some
      sourcs it should be set to zero by software in these cases, and
      the binutils disassembler doesn't like us setting it to 7.
      This shouldn't matter in practice, but who knows.
    • Michael Matz's avatar
      musl: disable boundcheck tests · 2f943902
      Michael Matz authored
      for now that doesn't work with musl libc.
    • Michael Matz's avatar
      stdarg: always have the __builtin_va_* available · 245f6a0d
      Michael Matz authored
      This makes available the __builtin_va_list type and __builtin variants
      of va_start, va_arg, va_copy and va_end.  We do this via a header file
      that's prepended to all compilations always (except if merely
      preprocessing): tcc_predefs.h.  That header could also be used
      for predefining other builtins in the future.
      We don't need the define hacks for musl anymore with this.
      Also fix x86_64 gfunc_prologue to reserve enoug space for the
      full va_list structure, not just 16 bytes.
  15. 15 Apr, 2020 6 commits
    • Michael Matz's avatar
      Fix stdarg on x86-64 · 8c6143d8
      Michael Matz authored
      this partly reverts 1803762e to fix stdarg on x86-64 again.  I've tried
      to retain the apple specific changes from that commit.
      Also include stdarg.h first in tcc.h, maybe that helps as well.
    • Robert Hoelzl's avatar
      Make tcclib1.a compile on macOS again · 1803762e
      Robert Hoelzl authored
      When compiling on macOS (at least in version 10.12) the TCC compiler failed
      to compile libtcc1.a. Three problems were solved:
       - The predefined macro "__APPLE__" is now available, as it is tested in the
         libc darwin header files
       - the libtcc1 Makefile defined _ANSI_SOURCE, although it used signals
       - stdargs.h defined va_list differently from the darwin libc.
         If the darwin standard library was included BEFORE stdargs this caused
       - the darwin libc generated a warning if GCC < 4 was used
       - additional defines are predefined now to make darwin libc headers compile.
    • Michael Matz's avatar
      Factor out common type combination · 38ab621b
      Michael Matz authored
      as there's overlap between handling types for binary and ternay
      operations.  Factor this into a single routine (combine_types).
      This uses the structure that gen_op was following, and expr_cond
      was using as well in the past, which I find easier to reconvene
      with the standard language.  But it reuses the new functions for
      diagnostics to improve (a little) on what GCC or clang produce :)
    • Michael Matz's avatar
      Expect c99 support in tcctest.c · c085645f
      Michael Matz authored
      the support for the macro GCC_MAJOR is gone since 2017, and it's
      fairly doubtful that anyone serious is using gcc 2.95.
      Also adds a test for the ternary ops typing rules: 'x?bool:bool' has
      to promote to int.
    • Michael Matz's avatar
      Move type_incompatibility_error earlier · 00fbf655
      Michael Matz authored
      also move type_incompatibility_warning and type_to_str.
    • Michael Matz's avatar
      Fix interaction of (local) labels and stmt exprs · 096c93c0
      Michael Matz authored
      as per testcase.  We must not reset token.sym_label twice with
      kept symbols.  This is no problem for non-label symbols because those
      aren't generated on demand when mentioning them.
  16. 12 Apr, 2020 2 commits
    • grischka's avatar
      win32: long double as distinct C-type · 6696da2f
      grischka authored
      On windows. there is no long double really IOW it is the
      same as double.  However setting the VT_LONG flag in
      combination with VT_DOUBLE allows to keep track of the
      original type for the purpose of '_Generic() or more
      accurate type warnings.
    • grischka's avatar
      win32/include/math.h: rint/trunc: pop fp stack · d0195863
      grischka authored
      ... in order to avoid fp stack overflow (see test below).
      #include <math.h>
      #include <stdio.h>
      int main()
         printf("%f %f %f %f\n", trunc(1.2), rint(1.2), trunc(1.2), rint(1.2));
         printf("%f %f %f %f\n", trunc(1.2), rint(1.2), trunc(1.2), rint(1.2));
         printf("%f %f %f %f\n", trunc(1.2), rint(1.2), trunc(1.2), rintl(1.2));
      Also in rintl:
      - 'long double' is not a ten-byte float on windows.
  17. 11 Apr, 2020 1 commit
    • Tyge's avatar
      Finalizing math.h fixes: · 024214af
      Tyge authored
      - Updated msvcrt.def with symbols from 64bit version of dll - it contains the float math functions missing in the 32bit dll.
      - Made sure this patch only apply to to WIN32 and WIN64. For WIN32 float functions calls the double variants, on 64bit they are called natively.
  18. 08 Apr, 2020 1 commit
    • Tyge's avatar
      Minimum changes to make all float variants of math.h functions work, · df67d861
      Tyge authored
      by calling the double functions and removing unsupported __asm implementations using "=t".
      This patch also enables the double version of logb(double).
      Note: None of the 'long double' variants works though - could easily be fixed
      by aliasing the double equvalents for completeness/compability.
  19. 22 Mar, 2020 3 commits
  20. 21 Mar, 2020 1 commit
  21. 14 Mar, 2020 1 commit
  22. 04 Mar, 2020 2 commits