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. 07 Jul, 2021 1 commit
  2. 16 Jan, 2021 1 commit
  3. 13 Jan, 2021 2 commits
  4. 12 Jan, 2021 1 commit
  5. 11 Jan, 2021 1 commit
  6. 06 Jan, 2021 2 commits
  7. 30 Dec, 2020 1 commit
    • herman ten brugge's avatar
      text relocation for netbsd · 0821940e
      herman ten brugge authored
      netbsd does not allow text relocations in text segment.
      - Add data_ro_section
      - Fix typo rela.plt
      - Add data_ro_section
      - Make bounds_section/lbounds_section rw
      - Add GNU_RELRO section for data_ro_section/bounds_section/lbounds_section
      - Fix relocation for __dso_handle in atexit()
      - Use data_ro_section
      - Use R_X86_64_PC32 instead of R_X86_64_64 for bounds checking
      tests/Makefile, tests/tests2/Makefile
      - Enable dll tests for netbsd
  8. 20 Dec, 2020 1 commit
    • herman ten brugge's avatar
      bsd update · 7f898abb
      herman ten brugge authored
      Fix crtbegin/crtend
      Use dlsym on all bsd targets
      Check .eh_frame on all bsd targets
      Disable test3 on FreeBSD and NetBSD and use test1 instead because dlsym not working (WIP)
      Disable dlltest and 113_btdll on NetBSD because text relocations are not allowed
      Disable 115_bound_setjmp on NetBSD because longjmp is renamed into __longjmp14
  9. 18 Dec, 2020 1 commit
    • herman ten brugge's avatar
      lazy binding · 50b4f320
      herman ten brugge authored
      Currently tcc does not use lazy binding. It puts all relocations in the RELX
      section and solve them all at startup.
      This was not working on bsd.
      - New RELPLT_SECTION_FMT for plt relocations
      - New entry relocplt in struct Section
      - put_elf_reloca: put R_JMP_SLOT in relocplt section
      - build_got_entries*: Use two passes because R_JMP_SLOT and R_GLOB_DAT
                            can not be intermixed on some targets (arm, arm64)
      - layout_sections: Calculate correct size relocplt section for DT_ values.
                         Make sure relocplt is last
      - fill_dynamic: Add DT_ values when got is filled
                      move DT_VERSYM because dynamic linker cannot handle it standone
      - Add note section for NetBSD
      - fill got table with pointer to plt section or symbol value in case
      - fix offset first plt entry
      - use correct reloc entry
      - use relofs - sizeof (ElfW_Rel) because the reloc is already done
      - no __libc_freeres on FreeBSD and NetBSD
      - Add -fno-stack-protector for OpenBSD
      - disable 106_pthread/114_bound_signal
  10. 17 Dec, 2020 1 commit
    • grischka's avatar
      replace native platform macros in the compiler · e2e62fcb
      grischka authored
      - The compiler should not use these
      - However tccrun.c & libtcc1.a files should use these
      - use s1->loaded_dlls for loaded dlls instead of dlopens
      - alpine musl: fully supported now and tested
      - ./configure ...
         --config-backtrace=no : disable backtraces
         --config-bcheck=no : disable bcheck
      - tests:dlltest: enable by default
      - tccrun.c : simplify mmaps
      - __builtin_alloca : always use asm-alias (instead of #define)
      - tccpe.c : use write32le
  11. 09 Dec, 2020 1 commit
    • grischka's avatar
      tcc_enter/exit_state(): do not use! · 8ff70555
      grischka authored
      tcc_enter/exit_state() are meant exclusively to protect
      the tcc_compile() and its sub-functions in tccpp.c,
      tccgen.c, tccasm.c and xxx-gen.c.
      Other files that are part of libtcc simply must not use global
      - riscv64/last_hi: move to TCCState
        from 72250bec
      - tccrun.c: Using a fixed address would not work anyway
        ("tcc -run tcc.c -run ..." for example)
        from baacb0f5
      - tests/Makefile: support for a platform doesn't make sense if
        it doesn't pass our basic tests.
        from 591feda1
      - tccgen: cleanup "duplicate member" (only 2 passes,
        avoids additional TokenSym field)
        from 170be79a
  12. 07 Dec, 2020 1 commit
  13. 09 Jul, 2020 2 commits
  14. 06 Jul, 2020 1 commit
    • grischka's avatar
      some cleanups related to recent commits · 72277967
      grischka authored
      - configure/Makefile : cleanup, really use CC_NAME
      - tccasm.c : remove C99 construct that MSVC doesn't compile
      - arm-gen.c, x86_64-gen.c, riscv64-gen.c, tccmacho.c : ditto
      - arm64-gen.c: commit 383acf8e wrote:
        "Instead of a cast, it would be better to pass the exact type."
        It is true that there are better solutions but it is not
        passing the exact type (I think).
      - tcctest.c: revert "fix cast test for clang" 03646ad4
        this obviously wants to test non-portable conversions
      - 114_bound_signal.test: clock_nanosleep is too new for older
        linuxes, just use sleep() instead
  15. 21 Jun, 2020 3 commits
    • Michael Matz's avatar
      macos: Fix memtest · d174af08
      Michael Matz authored
      * free allocated memory
      * fix weak symbols related to -run
      * remove memtest from ignored tests for OSX
    • Michael Matz's avatar
      macos: Fix asm-c-connect-test · fbfe6209
      Michael Matz authored
      via some heavy-handed hackery in the ASM symbol handling in case
      C symbols get a leading underscore (but ASM symbols do not).
      But this is now like clang and GCC on Darwin work: asm symbols are
      undecorated, C symbols get a _ prepended, so to connect both some
      trickery is involved for the ASM symbols that don't have a _ prepended.
      They must be included in the C symbol table (because that's what we use
      to lookup also ASM labels), but they also must not disturb the normal
      C symbol (which don't have the _ prepended), so they need some mangling.
      A bit unsatisfying, but well.  So, add asm-c-connect-test to the working
      ones for Darwin as well.
    • Michael Matz's avatar
      macos: Enable all working tests · 3cf7bec1
      Michael Matz authored
      all except the below work now on MacOS, also as executable test,
      not just with -run:
      * dlltest - we don't support dylib generation (yet)
      * memtest - tccmacho.c contains some leaks
      * asm-c-connect-test - some confusion with underscores still
  16. 17 Jun, 2020 1 commit
  17. 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
  18. 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
  19. 16 Apr, 2020 1 commit
  20. 18 Jan, 2020 1 commit
    • gr's avatar
      tccrun.c: standalone backtraces with -bt[N] or -b · ef42295f
      gr authored
      This makes it possible to get backtraces with executables
      (including DLLs/SOs) like we had it already with -g -run.
      Option -b includes -bt, and -bt includes -g.
      - new file lib/bt-exe.c: used to link rt_printline and the
        exception handler from tccrun.c into executables/DLLs.
      - new file lib/bt-log.c: provides a function that may be
        called from user code to print out a backtrace with a
        message (currently for i386/x86_64 only):
           int (*tcc_backtrace)(const char *fmt, ...);
        As an extra hack, if 'fmt' is prefixed like "^file.c^..."
        then the backtrace will skip calls from within 'file.c'.
      - new file lib/bt-dll.c:  used on win32 to link the backtrace
        and bcheck functions with the main module at runtime
      - bcheck.c: now uses the tcc_backtrace function from above
      - tccgen.c: minor cleanups
      - tccelf.c: stab sections get SHF_ALLOC for easy access.
        Also in relocate_section(): 64bit relocations for stabs
        in DLLs cannot work.  To find DLL addresses, the DLL base
        is added manually in tccrun.c via rc.prog_base instead.
      - tccpe.c: there are some changes to allow merging sections,
        used to merge .finit_array into .data in the first place.
      - tccpp.c: tcc -run now #defines __TCC_RUN__
        also: refactor a line in tal_realloc that was incompatible
        with bcheck
      - tcctest.c: fixed a problem with r12 which tcc cannot preserve
        as well as gcc does.
      - tests2/112_backtrace.c: test the feature and the bcheck test18
        that previously was in boundtest.c
  21. 15 Jan, 2020 1 commit
    • herman ten brugge's avatar
      Update bound checking code. · 38776187
      herman ten brugge authored
      Add __attribute__((constructor)) to __bounds_init.
      - remove tcc_add_bcheck from i386-link.c and x86_64-link.c
      - add simplified tcc_add_bcheck to tccelf.c
      - Update tccrun.c to call constructor/destructor.
      Set dynsym sh_info to number of local symbols in tccelf.c
      Reduce stack size when bounds checking is enabled.
      Added variable TCC_LIBBCHECK for windows support.
      Add signal stack to detect stack overflow.
      Add all & parameters in lbound_section and remove them if not used.
      Close fd in tcc_relocate in tccrun.c
      Fix section type constructor/destructor in tccelf.c
      Add check code in tests/boundtest.c for mem/str functions.
      Remove -ba from documentation.
      Add bounds check signal info in documentation.
      - Fix initial_pool alignment.
      . Fix printf statements.
      . Add prototypes for all external interface functions.
      - Add TCC_BOUNDS_WARN_POINTER_ADD environment variable.
      . Add ctype and errno data.
      - Fix alloca when multithreading is used.
      - Add lock for __bound_checking and __bound_never_fatal.
      - Catch pthread_create and use locks when called.
      - Detect in loaded in shared lib and use locks when found
      - Use spin locks instead of semaphore locks.
      - Make spin locked code as small as possible.
      - Fix mem/str functions checking.
      - Fix overlap checking mem/str functions.
  22. 18 Dec, 2019 1 commit
  23. 17 Dec, 2019 1 commit
  24. 14 Dec, 2019 1 commit
    • grischka's avatar
      bcheck cleanup · 56db092a
      grischka authored
      - revert Makefiles to state before last bcheck additions
        Instead, just load bcheck.o explicitly if that is
        what is wanted.
      - move tcc_add_bcheck() to the <target>-link.c files and
        remove revently added arguments.  This function is to
        support tccelf.c with linking, not for tccgen.c to
        support compilation.
      - remove -ba option:  It said:
        "-ba  Enable better address checking with bounds checker"
        Okay, if it is better then to have it is not an option.
      - remove va_copy. It is C99 and we try to stay C89 in tinycc
        when possible.  For example, MS compilers do not have va_copy.
      - win64: revert any 'fixes' to alloca
        It was correct as it was before, except for bound_checking
        where it was not implemented.  This should now work too.
      - remove parasitic filename:linenum features
        Such feature is already present with rt_printline in
        tccrun.c.  If it doesn't work it can be fixed.
      - revert changes to gen_bounded_ptr_add()
        gen_bounded_ptr_add() was working as it should before
        (mostly).  For the sake of simplicity I switched it to
        CDECL.  Anyway, FASTCALL means SLOWCALL with tinycc.
      In exchange you get one addition which is required for
      bounds_cnecking function arguments.  The important thing
      is to check them *BEFORE* they are loaded into registers.
      New function gbound_args() does that.
      In any case, code instrumentation with the bounds-check
      functions as such now seems to work flawlessly again,
      which means when they are inserted as NOPs, any code that
      tcc can compile, seems to behave just the same as without
      What these functions then do when fully enabled, is a
      differnt story.  I did not touch this.
  25. 13 Dec, 2019 1 commit
    • herman ten brugge's avatar
      Add new bounds checking functions. · 39c0ff31
      herman ten brugge authored
      The following functions are now also bounds checked:
      memcmp, strncpy, strcmp, strncmp, strcat, strchr, strdup.
      Add statistics code for bounds checking functions.
      The statistics can be printed by settings environment variable
      Enabled more tests in test/Makefile.
  26. 12 Dec, 2019 2 commits
  27. 11 Dec, 2019 2 commits
    • herman ten brugge's avatar
    • grischka's avatar
      allow libtcc states to be used concurrently · 72729d8e
      grischka authored
      This allows creation of TCCStates and operation with API
      calls independently from each other, even from threads.
      Frontend (option parsing/libtcc.c) and backend (linker/tccelf.c)
      now depend only on the TCCState (s1) argument.
      Compilation per se (tccpp.c, tccgen.c) is still using
      globals for convenience.  There is only one entry point
      to this section which is tcc_compile() which is protected
      by a semaphore.
      There are some hacks involved to avoid too many changes,
      as well as some changes in order to avoid too many hacks ;)
      The test libtcc_test_mt.c shows the feature.  Except this
      new file the patch adds 87 lines overall.
  28. 10 Dec, 2019 1 commit
  29. 14 Mar, 2019 1 commit
  30. 10 Mar, 2018 1 commit
  31. 13 Dec, 2017 1 commit
    • grischka's avatar
      final update for 0.9.27 · d348a9a5
      grischka authored
      - fix ldouble asm hack
      - fix a VLA problem on Win64 (also x86_64-gen.c)
      - patch_type(): make sure that no symbol ever changes
        from global to static
      - tcc -vv: print libtcc1.a path also on win32
      tccpe.c, tcctools.c:
      - use unix LF mode to for .def output files (that is for
        creating reproducible output trees)
      - suppress some warnings when makeinfo is missing
      - call 'which install' only on win32
      - change PATH only on WINNT systems (i.e. not if cross-compiling
        on linux for win32)
      - asm-c-connect.test: slim output and do diff
      tccrun.c tccpe.c *-link.c:
      - integrate former 'pe_relocate_rva()' into normal relocation
        This also fixes linkage of the unwind data on WIN64 for -run
        (reported by Janus Lynggaard Thorborg)
      tccasm.c, tests/tcctest.c:
      - fix dot (sym_index of -1 crashed in put_elf_reloc)
      - massage .set a bit (see test)
      - #define SECTION_ABS removed
      - ST_DATA Section *strtab_section: removed
      - put_extern_sym2(): take int section number
  32. 04 Dec, 2017 1 commit