aboutsummaryrefslogtreecommitdiff
path: root/win32
Commit message (Collapse)AuthorAgeFilesLines
* Add -O2 when compiling tcc on Windows. Not sure this flag is really used by tcc.Christian Jullien2017-06-101-24/+24
|
* force i386-win32-tcc.exe to be a 32bit binary. Run tests in both 32/64 bits ↵U-NELSON\jullien2017-06-051-1/+5
| | | | on Windows.
* Add more common tests to be run from win32/MakefileU-NELSON\jullien2017-06-041-2/+2
|
* Windows test Makefile target also test pp tests.Christian Jullien2017-05-281-0/+1
|
* Add -static to be in sync with Windows bat.Christian Jullien2017-04-271-1/+1
|
* final adjustments for releasegrischka2017-04-252-1/+2
| | | | | | | | | | | | | | | | | | | | | - configure/Makefiles: minor adjustments - build-tcc.bat: add -static to gcc options (avoids libgcc_s*.dll dependency with some mingw versions) - tccpe.c/tcctools.c: eliminate MAX_PATH (not available for cross compilers) - tccasm.c: use uint64_t/strtoull in unary() (unsigned long sometimes is only uint32_t, as always on windows) - tccgen.c: Revert (f077d16c) "tccgen: gen_cast: cast FLOAT to DOUBLE" Was a rather experimental, tentative commit, not really necessary and somewhat ugly too. - cleanup recent osx support: - Makefile/libtcc.c: cleanup copy&paste code - tccpp.c: restore deleted function
* tccgen/win32: let __declspec(dllimport) imply externgrischka2017-04-042-11/+13
| | | | | | | | | | | | | | | | | | | | | | | Also, retain storage qualifiers in type_decl, in particular also for function pointers. This allows to get rid of this very early hack in decl() type.t |= (btype.t & VT_STATIC); /* Retain "static". */ which was to fix the case of int main() { static int (*foo)(); ... Also: - missing __declspec(dllimport) is an error now - except if the symbol is "_imp__symbol" - demonstrate export/import of data in the dll example (while 'extern' isn't strictly required with dllimport anymore) - new function 'patch_storage()' replaces 'weaken_symbol()' and 'apply_visibility()' - new function 'update_storage()' applies storage attributes to Elf symbols. - put_extern_sym/2 accepts new pseudo section SECTION_COMMON - add -Wl,-export-all-symbols as alias for -rdynamic - add -Wl,-subsystem=windows for mingw compatibility - redefinition of 'sym' error for initialized global data
* makefile: unify cross with native buildsgrischka2017-02-251-0/+4
| | | | | | | | | | | | | supports building cross compilers on the fly without need for configure --enable-cross $ make cross # all compilers $ make cross-TARGET # only TARGET-compiler & its libtcc1.a with TARGET one from i386 x86_64 i386-win32 x86_64-win32 arm arm64 arm-wince c67 Type 'make help' for more information
* Cygwin Makefile was to aggresive to remove entire lib/Christian Jullien2017-02-241-5/+3
|
* Update Cygwin Makefile for new libtcc1-xx.a layoutChristian Jullien2017-02-241-10/+9
|
* cross-compilers: allow individual configurationgrischka2017-02-231-13/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | since configure supports only native configuration a file 'cross-tcc.mak' needs to be created manually. It is included in the Makefile if present. # ---------------------------------------------------- # Example config-cross.mak: # # windows -> i386-linux cross-compiler # (it expects the linux files in <prefix>/i386-linux) ROOT-i386 = {B}/i386-linux CRT-i386 = $(ROOT-i386)/usr/lib LIB-i386 = $(ROOT-i386)/lib:$(ROOT-i386)/usr/lib INC-i386 = {B}/lib/include:$(ROOT-i386)/usr/include DEF-i386 += -D__linux__ # ---------------------------------------------------- Also: - use libtcc1-<target>.a instead of directories - add dummy arm assembler - remove include dependencies from armeabi.c/lib-arm64.c - tccelf/ld_add_file: add SYSROOT (when defined) to absolute filenames coming from ld-scripts
* tcc: re-enable correct option -r supportgrischka2017-02-205-4/+23
| | | | | | | | | | | | | | | Forgot about it. It allows to compile several sources (and other .o's) to one single .o file; tcc -r -o all.o f1.c f2.c f3.S o4.o ... Also: - option -fold-struct-init-code removed, no effect anymore - (tcc_)set_environment() moved to tcc.c - win32/lib/(win)crt1 minor fix & add dependency - debug line output for asm (tcc -c -g xxx.S) enabled - configure/Makefiles: x86-64 -> x86_64 changes - README: cleanup
* Update cygwin Makefile after recent Windows source changesChristian Jullien2017-02-181-18/+8
|
* tcctools.c: integrate tiny_libmaker/_impdefgrischka2017-02-184-557/+23
| | | | | | | | | | | | | | usage: tcc -ar [rcsv] lib files... tcc -impdef lib.dll [-v] [-o lib.def] also: - support more files with -c: tcc -c f1.c f2.c ... - fix a bug which caused tcc f1.c f2.S to produce no asm - allow tcc -ar @listfile too - change prototype: _void_ tcc_set_options(...) - apply -Wl,-whole-archive when a librariy is given as libxxx.a also (not just for -lxxx)
* win32: adjust new unicode supportgrischka2017-02-185-26/+34
| | | | | | | | | | | | | | | | | | | - lib/Makefile: add (win)crt1_w.o - crt1.c/_runtmain: return to tcc & only use for UNICODE (because it might be not 100% reliable with for example wildcards (tcc *.c -run ...) - tccrun.c/tccpe.c: load -run startup_code only if called from tcc_run(). Otherwise main may not be defined. See libtcc_test.c - tests2/Makefile: pass extra options in FLAGS to allow overriding TCC Also: - tccpe.c: support weak attribute. (I first tried to solve the problem above by using it but then didn't)
* Makefile for Windows native tcc handles recent UNICODE supportChristian Jullien2017-02-181-26/+32
|
* Add support for Unicode entries 'wmain' and 'wWinMain' on WindowsYX Hao2017-02-173-23/+91
| | | | | | '-run' suported. argvs are converted. But don't use compliled Unicode CLI exe-file to get inputs interactively in other codepage! Please add other compliling supports than 'build-tcc.bat' (Who is good at them).
* Add entry to run tests2 testsChristian Jullien2017-02-171-0/+9
|
* tiny_impldef.exe was not built by MakefileChristian Jullien2017-02-161-140/+142
|
* win32: build-tcc.bat: figure out correct bitness of cl.exeVlad Vissoultchev2017-02-141-6/+21
|
* Improve cygwin Makefile that now support TARGET=32/64 to force final version ↵Christian Jullien2017-02-142-11/+30
| | | | for 32/64 platform
* updates & cleanups (tcc-doc/Changelog/TODO ...)grischka2017-02-138-476/+31
| | | | | | | | | | | | | | | - tcc-doc.texi: commandline option info update - Changelog/TODO: update - tests/tcctest.py: removed - tests/Makefile: weaktest fixed - tests/tests2: some files renamed and/or converted to unix LF - configure/Makefile: --enable-static option (no dll on win32) - win32/build-tcc.bat: msvc support - win32/tcc-win32.txt: build info update - win32/vs2015/: VS solution removed - win32/include/tcc/tcc_libm.h: #include statement fixed - tcc.c: -include <file> option help info - .gitignore: cleanup
* Detect native version from default gcc target.Christian Jullien2017-02-121-8/+9
|
* Add Makefile to build native tcc 32/64 on Windows using cygwinChristian Jullien2017-02-121-0/+130
|
* Add pre-build step in VS2015 projects to generate config.h from VERSIONVlad Vissoultchev2017-02-093-0/+61
|
* win32: build-tcc.bat: add some optionsgrischka2017-02-081-52/+134
| | | | | | | | | | | | | | | | | | In particular: -c <compiler> : Allow using tcc to compile itself -i <dir> : Create installation in dir Summary: usage: build-tcc.bat [ options ... ] options: -c prog use prog (gcc or tcc) to compile tcc -c "prog options" use prog with options to compile tcc -t 32/64 force 32/64 bit default target -v "version" set tcc version -i dir install tcc into dir -d create tcc-doc.html too (needs makeinfo)
* win32: include/winapi: remove more filesgrischka2017-02-0811-1500/+10
| | | | Also: use _assert, older msvcrt does not have _wassert
* tccrun/win64: cleanup runtime function tablegrischka2016-10-191-0/+1
| | | | | | | | | | | | | | - call RtlDeleteFunctionTable (important for multiple compilations) - the RUNTIME_FUNCTION* is now at the beginning of the runtime memory. Therefor when tcc_relocate is called with user memory, this should be done manually before it is free'd: RtlDeleteFunctionTable(*(void**)user_mem); [ free(user_mem); ] - x86_64-gen.c: expand char/short return values to int
* tccpp_new/delete and other cleanupsgrischka2016-10-171-16/+22
|
* win32/64: msys2 supportgrischka2016-10-022-9/+8
| | | | | | | | | | | | Support ./configure && make under msys2 (a new msys fork) on win32 and win64. Get rid of CONFIG_WIN64 make-var. (On windows, WIN32 in general is used for both 32 and 64 bit platforms) Also: - cleanup win32/build-tcc.bat - adjust win32/(doc/)tcc-win32.tx
* build: revert Makefiles to 0.9.26 state (mostly)grischka2016-10-011-12/+7
| | | | | | | | | | | | Except - that libtcc1.a is now installed in subdirs i386/ etc. - the support for arm and arm64 - some of the "Darwin" fixes - tests are mosly unchanged Also - removed the "legacy links for cross compilers" (was total mess) - removed "out-of-tree" build support (was broken anyway)
* Remove misc. filesgrischka2016-10-0128-6401/+9
| | | | | | | | | | | | - from win32/include/winapi: various .h The winapi header set cannot be complete no matter what. So lets have just the minimal set necessary to compile the examples. - remove CMake support (hard to keep up to date) - some other files Also, drop useless changes in win32/lib/(win)crt1.c
* Rein in unintended external functions on Windows.Jean-Claude Beaudoin2016-09-271-2/+2
|
* tiny_libmaker: fix a commentAvi Halachmi (:avih)2016-06-191-1/+1
|
* win32: _mingw.h: add definition for _TRUNCATE from newer _mingw.hAvi Halachmi (:avih)2016-06-191-0/+4
|
* win32: malloc.h: use alloca instead of (missing) _allocaAvi Halachmi (:avih)2016-06-191-1/+7
| | | | | | _alloca is not part of msvcrt (and therefore not found if used), and tcc has an internal implementation for alloca for x86[_64] since d778bde7 - initally as _alloca and later changed to alloca. Use it instead.
* win32: wchar.h: don't redifine WCHAR_MIN[/MAX] (after stdint.h)Avi Halachmi (:avih)2016-06-191-0/+2
|
* tiny_libmaker: more robust arguments interpretationAvi Halachmi (:avih)2016-06-191-34/+54
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Syntax is now much closer to gnu ar, but still supports whatever was supported before, with the following exceptions (which gnu ar has too): - lib is now mandatory (was optional and defaulted to ar_test.a before). - Path cannot start with '-' (but ./-myfile.o is OK). - Unlike gnu ar, modes are still optional (as before). - Now supports also (like gnu ar): - First argument as options doesn't have to start with '-', later options do. - Now supports mode v (verbose) with same output format as gnu ar. - Any names for lib/objs (were limited to .a/.o - broke cmake on windows). - Now explicitly fail on options which would be destructive for the user. - Now doesn't get confused by options between file arguments. - Still ignores other unknown options - as before. - Now doesn't read out-of-bounds if an option is one char. - As a result, cmake for windows can now use tiny_libmaker as ar, and configure can also detect tiny_libmaker as a valid ar (both couldn't before). Ignoring all options could previously cause to misinterpret the mode in a destructive way, e.g. if the user wanted to do something with an existing archive (such as p - print, or x - extract, etc), then it would instead just delete (re-create) the archive. Modes which can be destructive if ignored now explicitly fail. These include [habdioptxN]. Note that 'h' can be ignored, but this way we also implicitly print the usage for -h/--help. The .a/.o name limitations previously resulted in complete failure on some cases, such as cmake on windows which uses <filename>.obj and <libname>.lib . Fixed: e.g. 'tiny_libmaker r x.a x.o' was reading out of bounds [-1] for 'r'.
* tccgen: scopes levels for local symbols (update 1)grischka2016-05-052-4/+10
| | | | | | | Catch top level redeclarations too. Also fix mistakes in tcctest.c and the tcc sources (win32) showing up now.
* win32: Better VS2015 solution and project filesVlad Vissoultchev2016-04-132-0/+31
| | | | These include all header and source files from source directory
* win32: Add missing header files for nginx compilationseyko2016-04-136-0/+1122
| | | | | | | | | From: Vlad Vissoultchev Date: Tue, 12 Apr 2016 21:02:43 +0300 Subject: win32: Add missing header files for nginx compilation The new ones are hoisted from mingw-w64 as most other headers under `win32/include/winapi`
* VS2015 solution and project filesseyko2016-04-134-2/+376
| | | | | | | | | | | | | From: Vlad Vissoultchev Date: Mon, 11 Apr 2016 01:32:28 +0300 Subject: Add VS2015 solution and project files to `win32/vs2015` directory This allows release/debug builds for both x86 and x64 targets. Some warnings had to be suppressed. Output libtcc.dll and tcc.exe are copied to parent `win32` directory w/ a post-build action.
* Use proper ifdef for x64 check in winnt.hVlad Vissoultchev2016-03-141-3/+3
|
* Revert spawnvp param cast and use `no-incompatible-pointer-types` in ↵Vlad Vissoultchev2016-03-141-2/+2
| | | | build-tcc.bat
* Add x64 SEH decls. Add exports to kernel32.defVlad Vissoultchev2016-03-132-0/+68
|
* Move WIN32_LEAN_AND_MEAN to windows.h (silence redeclarations)Vlad Vissoultchev2016-03-132-3/+4
|
* Win32 build script handles `x64` and `debug` paramsVlad Vissoultchev2016-03-131-6/+11
|
* win: libm: add implementation for round/fmin/fmax and variantsAvi Halachmi (:avih)2015-11-071-0/+113
| | | | | | | | | | | | | | | | | | | | round and fmin/fmax are relatively commonly used functions but were not implemented anywhere in the tcc Windows distribution package. Newer mingw(64) math.h stil doesn't include these implementations. Add C implementations for these functions and place it as inline functions at win32/include/tcc/tcc_libm.h - which is already included from math.h . The code is mostly taken from musl-libc rs-1.0 (MIT) [*], musl-libc: http://git.musl-libc.org/cgit/musl/tree/src/math?h=rs-1.0 license: http://git.musl-libc.org/cgit/musl/tree/COPYRIGHT?h=rs-1.0 Potential enhancements: - Check how many useful libm implementations are still missing and consider adding them (some of them already work via the MS runtime). - Consider putting libm implementations in an actual libm.a file, or add a dummy one such that build processes which try to link with libm will not fail.
* win: math.h: fix fpclassify/signbit/etc - use C instead of broken asmAvi Halachmi (:avih)2015-11-072-22/+97
| | | | | | | | | | | | | | | | The asm code cannot currently be used with tcc since tcc doesn't support 't' constraint. Use inline C implementation instead, place it win32/include/tcc/tcc_libm.h, and include it from win32/include/math.h. Since fpclassify now works, it also fixes few other macros which depend on it. Implicitly fixed: isfinite, isinf, isnan, isnormal. The implementations were taken from musl-libc rs-1.0 (MIT license). musl-libc: http://git.musl-libc.org/cgit/musl/tree/src/math?h=rs-1.0 license: http://git.musl-libc.org/cgit/musl/tree/COPYRIGHT?h=rs-1.0
* win: math.h: isnan: use macro, similar to others (still broken)Avi Halachmi (:avih)2015-11-071-32/+1
| | | | | | It was broken due to tcc not able to compile asm with 't' constraint, and it's still broken because fpclassify on which it now depends has the same issue. Next commit will fix this.