From 43d9a7de9b83f437d55c2cbc6e9625e3fafa5102 Mon Sep 17 00:00:00 2001 From: grischka Date: Mon, 13 Feb 2017 19:03:29 +0100 Subject: updates & cleanups (tcc-doc/Changelog/TODO ...) - 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 option help info - .gitignore: cleanup --- .gitignore | 102 ++++++------ Changelog | 141 +++------------- Makefile | 14 +- TODO | 28 +--- configure | 41 +++-- tcc-doc.texi | 48 ++++-- tcc.c | 1 + tests/Makefile | 5 +- tests/tcctest.py | 15 -- tests/tests2/82_nocode_wanted.c | 112 ------------- tests/tests2/82_nocode_wanted.expect | 14 -- tests/tests2/84-hex-float.c | 12 -- tests/tests2/84-hex-float.expect | 1 - tests/tests2/84_hex-float.c | 12 ++ tests/tests2/84_hex-float.expect | 1 + tests/tests2/85-asm-outside-function.c | 9 - tests/tests2/85-asm-outside-function.expect | 1 - tests/tests2/85_asm-outside-function.c | 9 + tests/tests2/85_asm-outside-function.expect | 1 + tests/tests2/86-memory-model.c | 38 ----- tests/tests2/86-memory-model.expect | 1 - tests/tests2/86-struct-init.c | 248 ---------------------------- tests/tests2/86-struct-init.expect | 40 ----- tests/tests2/86_memory-model.c | 38 +++++ tests/tests2/86_memory-model.expect | 1 + tests/tests2/87_ptr_longlong_arith32.c | 15 -- tests/tests2/87_ptr_longlong_arith32.expect | 1 - tests/tests2/89_nocode_wanted.c | 112 +++++++++++++ tests/tests2/89_nocode_wanted.expect | 14 ++ tests/tests2/90_struct-init.c | 248 ++++++++++++++++++++++++++++ tests/tests2/90_struct-init.expect | 40 +++++ tests/tests2/91_ptr_longlong_arith32.c | 15 ++ tests/tests2/91_ptr_longlong_arith32.expect | 1 + win32/Makefile | 2 +- win32/build-tcc.bat | 23 ++- win32/include/tcc/tcc_libm.h | 2 +- win32/tcc-win32.txt | 15 +- win32/vs2015/PreBuild.bat | 9 - win32/vs2015/libtcc.vcxproj | 220 ------------------------ win32/vs2015/tcc.sln | 41 ----- win32/vs2015/tcc.vcxproj | 195 ---------------------- 41 files changed, 668 insertions(+), 1218 deletions(-) delete mode 100644 tests/tcctest.py delete mode 100644 tests/tests2/82_nocode_wanted.c delete mode 100644 tests/tests2/82_nocode_wanted.expect delete mode 100644 tests/tests2/84-hex-float.c delete mode 100644 tests/tests2/84-hex-float.expect create mode 100644 tests/tests2/84_hex-float.c create mode 100644 tests/tests2/84_hex-float.expect delete mode 100644 tests/tests2/85-asm-outside-function.c delete mode 100644 tests/tests2/85-asm-outside-function.expect create mode 100644 tests/tests2/85_asm-outside-function.c create mode 100644 tests/tests2/85_asm-outside-function.expect delete mode 100755 tests/tests2/86-memory-model.c delete mode 100755 tests/tests2/86-memory-model.expect delete mode 100644 tests/tests2/86-struct-init.c delete mode 100644 tests/tests2/86-struct-init.expect create mode 100644 tests/tests2/86_memory-model.c create mode 100644 tests/tests2/86_memory-model.expect delete mode 100644 tests/tests2/87_ptr_longlong_arith32.c delete mode 100644 tests/tests2/87_ptr_longlong_arith32.expect create mode 100644 tests/tests2/89_nocode_wanted.c create mode 100644 tests/tests2/89_nocode_wanted.expect create mode 100644 tests/tests2/90_struct-init.c create mode 100644 tests/tests2/90_struct-init.expect create mode 100644 tests/tests2/91_ptr_longlong_arith32.c create mode 100644 tests/tests2/91_ptr_longlong_arith32.expect delete mode 100644 win32/vs2015/PreBuild.bat delete mode 100644 win32/vs2015/libtcc.vcxproj delete mode 100644 win32/vs2015/tcc.sln delete mode 100644 win32/vs2015/tcc.vcxproj diff --git a/.gitignore b/.gitignore index 518cae4..36c8aac 100644 --- a/.gitignore +++ b/.gitignore @@ -1,72 +1,64 @@ +*~ +\#* +.#* *.o *.a -a.out *.exe +*.dll +*.obj +*.pdb +*.lib +*.exp *.log +*.bz2 +*.zip +.gdb_history +a.out tcc_g tcc -/*-tcc -tc2.c -doc -tc3s.c -p3.c -tc1.c -error.c -i386-gen1.c -test.out1 -test.out1b -test.out2 -test.out2b -test.out3 -test.out3b -web.sh -memdebug.c -bench -Makefile.uClibc -boundtest -prog.ref -test.ref -test.out -tcc-doc.html -ideas -tcctest.ref -linux.tcc -ldtest -libtcc_test -instr.S -p.c -p2.c -tcctest[1234] -test[1234].out -tests/tcclib.h -tests/tcctest.cc -tests/weaktest.*.o.txt -tests/tests2/fred.txt -tests/tests2/*.exe -tests/hello -tests/abitest-*cc -tests/vla_test -.gdb_history -tcc.1 -tcc.pod +*-tcc + config.h config.mak config.texi +conftest* tags TAGS -.DS_Store -*.swp +tcc.1 +tcc.pod +tcc-doc.html +tcc-doc.info + lib/x86_64 lib/i386 lib/x86_64-win32 lib/i386-win32 lib/arm lib/arm64 -tcc-doc.info -conftest* -tiny_libmaker -*.dSYM -*~ -\#* -.#* -win32/* + +win32/doc +win32/libtcc +win32/lib/32 +win32/lib/64 +win32/include/float.h +win32/include/stdarg.h +win32/include/stdbool.h +win32/include/stddef.h +win32/include/varargs.h +win32/include/tcclib.h + +tests/test.out* +tests/test*.out +tests/tcctest[1234] +tests/tcctest.gcc +tests/*.ref +tests/*.txt +tests/*.gcc +tests/*-cc* +tests/*-tcc* +tests/libtcc_test +tests/vla_test +tests/hello +tests/tests2/fred.txt + +libtcc*.def diff --git a/Changelog b/Changelog index 7cc19c8..6928536 100644 --- a/Changelog +++ b/Changelog @@ -1,126 +1,35 @@ Version 0.9.27: -Licensing: - -- TinyCC partly relicensed to MIT license - User interface: +- -x[c|a|n] filetype option (Sergey Korshunoff) +- -P[1], -dD, -dM preprocessor options (Sergey Korshunoff) +- -Wl,-(no-)whole-archive linker option (Reuben Thomas) +- -mms-bitfields option (David Mertens) +- -include option (Michael Matz) +- @listfile support (Vlad Vissoultchev) +- CPATH, C_INCLUDE_PATH and LD_LIBRARY_PATH environment variables support + (Andrew Aladjev, Urs Janssen) -- define __STDC_HOSTED__ (Michael Matz, Urs Janssen) -- added support for CPATH, C_INCLUDE_PATH and LD_LIBRARY_PATH (Andrew Aladjev -and Urs Janssen) -- added option -norunsrc to control argv[0] with tcc -run (James Lyon) -- improve --with-libgcc configure help (grischka) -- improve error message when memory is full (grischka) -- improve wording about compiler switches in documentation (Thomas Preud'homme) -- use GNU triplet prefix for cross compiler names (Thomas Preud'homme) -- ignore unknown linker optimization and as-needed option (Austin English) +Platforms: +- new AARCH64 (arm64) target (Edmund Grimley Evans) +- vastly improved support for ARM hard float calling convention + (Thomas Preud'homme, Daniel Glöckner) +- provide a runtime library for ARM (Thomas Preud'homme) +- many x86-64 ABI fixes incl. XMM register passing and tests (James Lyon) +- ABI tests with native compiler using libtcc (James Lyon) Features: +- VLA (variable length array) improved (James Lyon, Pip Cet) +- import functions by ordinal in .def files on windows (YX Hao) +- x86/x86-64 assembler much improved (Michael Matz) +- simple dead code suppression (Edmund Grimley Evans, Michael Matz, grischka) +- implement round/fmin/fmax etc. math on windows (Avi Halachmi) +- #pragma once support (Sergey Korshunoff, Vlad Vissoultchev, ...) +- switch/case code improved (Zdenek Pavlas) +- ~15% faster by TinyAlloc fast memory allocator (Vlad Vissoultchev) -- added ABI tests with native compiler using libtcc (James Lyon) -- added CMake build system with support for cross-compilation (James Lyon) -- improved variable length array support (James Lyon) -- add the possibility to use noname functions by ordinal (YX Hao) -- add a install-strip target to install tcc (Thomas Preud'homme) -- add runtime selection of float ABI on ARM (Thomas Preud'homme) -- add shared lib support on x86-64 (Michael Matz) - -Platforms: -- support Debian GNU/kfreeBSD 64bit userspace (Thomas Preud'homme) -- fix GNU/Hurd interpreter path (Thomas Preud'homme) -- fix configure script for FreeBSD host (Thomas Preud'homme) -- make tcc -run work reliably on ARM by flushing caches (Thomas Preud'homme) -- many x86-64 ABI fixes incl. XMM register passing (James Lyon) -- improve compatibility with mingw's long double (James Lyon) -- avoid .stabstr section name to be truncated on win32 (Roy) -- add support for load/store of _Bool value (Thomas Preud'homme) -- detect instruction with incorrect operands on x86-64 (Thomas Preud'homme) -- improved relocations on ARM (Thomas Preud'homme) -- add va_* macro implementation for ARM (Thomas Preud'homme) -- define __ARM_EABI__, __ARMEL__ and __ARM_PCS_VFP (Thomas Preud'homme) -- provide a runtime library for ARM (Thomas Preud'homme) -- vastly improved support for ARM hard float calling convention -(Thomas Preud'homme, Daniel Glöckner) -- tcc can uses libtcc1 on ARM (Thomas Preud'homme) -- use __fixdfdi for all float to integer conversion (grischka) -- simplify startup code for unix platforms (grischka) -- improve ELF generated on ARM (Thomas Preud'homme) -- add support for thumb to ARM relocation (Thomas Preud'homme) -- fix globbing to match MSVC on Windows (Thomas Preud'homme) -- deprecate FPA and OABI support for ARM (Thomas Preud'homme) -- warn about softfloat not being supported on ARM (Thomas Preud'homme) - -Bug fixes: -- many code clean up (Urs Janssen, grischka) -- fixes of other's patches (grischka, Ramsay Jones, Michael Matz) -- fix documentation about __TINYC__ (Urs Janssen) -- improve build of documentation (Urs Janssen) -- improve build instructions (Jov) -- switch from texi2html to makeinfo --html to build tcc-doc.html (James Lyon) -- improve out of tree build (James Lyon) -- improved passing and returning of struct (James Lyon) -- fix CMake build on i386 and x86-64 (James Lyon) -- fix i386 calling convention issue (James Lyon) -- fix error in Windows build of tests (James Lyon) -- fix x86-64 long double passing (James Lyon) -- fix crash with undefined struct (grischka) -- normalize slashes on win32 to always use backslashes (grischka) -- use runtime function for float to int conversion on i386 (grischka) -- improved documentation for include and lib lookup on win32 (grischka) -- detect redefinition of function (Thomas Preud'homme) -- detect the use of array of functions (Thomas Preud'homme) -- detect use of enumerator with wrong enumeration (Thomas Preud'homme) -- detect redefinition of enumerator or enumeration (Thomas Preud'homme) -- set the user-defined library search paths first (Vittorio Giovara) -- detect usage of incomplete types inside struct/union (Amine Najahi) -- various macro bug fixes (Joseph Poirier) -- avoid wrong trigger of assert on x86-64 platform (Thomas Preud'homme) -- fix NaN comparison (Thomas Preud'homme) -- use libtcc for static linking with runtime library (Thomas Preud'homme) -- fix negation of 0.0 and -0.0 values (Thomas Preud'homme) -- fix use of long long as if condition (Thomas Preud'homme) -- disable bound check if libgcc is used (Thomas Preud'homme) -- error out when casting to void (grischka) -- remove circular dependency in Makefile (grischka) -- stop preventing gcc to do strict aliasing (grischka) -- fix Windows build of tcc (grischka) -- build runtime library for arm cross compiler (Thomas Preud'homme) -- fix installation of arm cross-compiler (Thomas Preud'homme) -- add basic test for cross-compiler (Thomas Preud'homme) -- fix failure when generating PE on x86-64 (Archidemon) -- fix floating point unary minus and plus (Michael Matz) -- add more tests for signed zero float (Michael Matz) -- fix precision of double on x86-64 (Vincent Lefevre) -- fix bound checking of argv with -run switch (Kirill Smelkov) -- work around a wine cmd bug when building tcc on Windows (Austin English) -- reenable some bound check tests (grischka) -- boundtest.c lookup honors VPATH (grischka) -- diff compared to CC in test[123]b? are now errors (grischka) -- fix test3 on Windows (grischka) -- prevent gcc from building (non functional) libtcc.a (grischka) -- fix warning related to PE file generation on x86-64 (grischka) -- stop mixing ordinary and implicit rule in Makefile (Iavael) -- fix integer to double conversion on ARM (Thomas Preud'homme) -- fix parameter passing of structure < 4 bytes on ARM (Thomas Preud'homme) -- disable builtin_frame_address test on ARM due to gcc bug (Thomas Preud'homme) -- fix initialization of struct on ARM (Thomas Preud'homme) -- fix parameter passing of (unsigned) long long bitfield (Thomas Preud'homme) -- improve float to integer tests (Thomas Preud'homme) -- fix relocation of Thumb branch to ARM function (Thomas Preud'homme) -- fix char wrong compatibility with [un]signed char (Thomas Preud'homme) -- choose the code to compile based on target in libtcc1 (Thomas Preud'homme) -- fix various clang warnings (Thomas Preud'homme) -- don't hardcode tcc in Makefile for tests (Thomas Preud'homme) -- fix relocation of __bound_init bound checking code (Thomas Preud'homme) -- accept only one basic type for a given variable (Thomas Preud'homme) -- fix error when using va_* with tcc using libgcc (Thomas Preud'homme) -- support GOT32 and PLT32 reloc on the same symbol (Thomas Preud'homme) -- fix memory leak due to symbol attributes (mingodad) -- partially fix bound checking of argv and arge (Thomas Preud'homme) -- fix possible dereference when getting name of symbol (grischka) -- fix va_list type definition on x86-64 (Daniel Glöckner) -- reduce number of scan-build false positive (mingodad) +Licensing: +- TinyCC partly relicensed to MIT license (See RELICENSING file). version 0.9.26: diff --git a/Makefile b/Makefile index 9527d12..c13ce37 100644 --- a/Makefile +++ b/Makefile @@ -26,14 +26,16 @@ LINK_LIBTCC = LIBS = ifdef CONFIG_WIN32 - LIBTCC = libtcc.dll + ifneq ($(DISABLE_STATIC),no) + LIBTCC = libtcc.dll + endif else LIBS=-lm ifndef CONFIG_NOLDL LIBS+=-ldl endif # make libtcc as static or dynamic library? - ifdef DISABLE_STATIC + ifeq ($(DISABLE_STATIC),yes) LIBTCC=libtcc.so ifndef DISABLE_RPATH LINK_LIBTCC += -Wl,-rpath,"$(libdir)" @@ -92,7 +94,7 @@ ARM64_FILES = $(CORE_FILES) arm64-gen.c arm64-link.c C67_FILES = $(CORE_FILES) c67-gen.c c67-link.c tcccoff.c ifdef CONFIG_WIN32 - PROGS+=tiny_impdef$(EXESUF) tiny_libmaker$(EXESUF) $(LIBTCC) + PROGS+=tiny_impdef$(EXESUF) tiny_libmaker$(EXESUF) ifeq ($(ARCH),x86-64) NATIVE_FILES=$(WIN64_FILES) PROGS_CROSS=$(WIN32_CROSS) $(X64_CROSS) $(ARM_CROSS) $(ARM64_CROSS) $(C67_CROSS) $(WINCE_CROSS) @@ -272,14 +274,14 @@ install: mkdir -p "$(tccdir)/examples" mkdir -p "$(tccdir)/doc" mkdir -p "$(tccdir)/libtcc" - $(INSTALLBIN) -m755 $(PROGS) "$(tccdir)" + $(INSTALLBIN) -m755 $(PROGS) $(subst libtcc.a,,$(LIBTCC)) "$(tccdir)" $(INSTALL) -m644 libtcc1.a $(TOPSRC)/win32/lib/*.def "$(tccdir)/lib" cp -r $(TOPSRC)/win32/include/. "$(tccdir)/include" cp -r $(TOPSRC)/win32/examples/. "$(tccdir)/examples" cp $(TOPSRC)/tests/libtcc_test.c "$(tccdir)/examples" $(INSTALL) -m644 $(TOPSRC)/include/*.h $(TOPSRC)/tcclib.h "$(tccdir)/include" - $(INSTALL) -m644 tcc-doc.html $(TOPSRC)/win32/tcc-win32.txt "$(tccdir)/doc" - $(INSTALL) -m644 $(TOPSRC)/libtcc.h libtcc.def "$(tccdir)/libtcc" + $(INSTALL) -m644 $(TOPSRC)/libtcc.h $(subst .dll,.def,$(LIBTCC)) "$(tccdir)/libtcc" + -$(INSTALL) -m644 $(TOPSRC)/win32/tcc-win32.txt tcc-doc.html "$(tccdir)/doc" ifdef CONFIG_CROSS mkdir -p "$(tccdir)/lib/32" mkdir -p "$(tccdir)/lib/64" diff --git a/TODO b/TODO index e6e5b07..5e6f7bf 100644 --- a/TODO +++ b/TODO @@ -2,16 +2,8 @@ TODO list: Bugs: -- fix macro substitution with nested definitions (ShangHongzhang) - FPU st(0) is left unclean (kwisatz haderach). Incompatible with optimized gcc/msc code - -- constructors -- cast bug (Peter Wang) -- define incomplete type if defined several times (Peter Wang). -- test binutils/gcc compile -- tci patch + argument. -- see -lxxx bug (Michael Charity). - see transparent union pb in /urs/include/sys/socket.h - precise behaviour of typeof with arrays ? (__put_user macro) but should suffice for most cases) @@ -26,11 +18,10 @@ Bugs: - finish varargs.h support (gcc 3.2 testsuite issue) - fix static functions declared inside block - fix multiple unions init -- sizeof, alignof, typeof can still generate code in some cases. -- Fix the remaining libtcc memory leaks. - make libtcc fully reentrant (except for the compilation stage itself). - struct/union/enum definitions in nested scopes (see also Debian bug #770657) - __STDC_IEC_559__: float f(void) { static float x = 0.0 / 0.0; return x; } +- memory may be leaked after errors (longjmp). Portability: @@ -42,14 +33,10 @@ Portability: Linking: -- static linking does not work -- with "-run" and libtcc, no PLT is used, so branches may be out of - range and relocations may fail; as a result libtest fails on arm64; see: - https://lists.gnu.org/archive/html/tinycc-devel/2015-03/msg00111.html +- static linking (-static) does not work Bound checking: -- '-b' bug. - fix bound exit on RedHat 7.3 - setjmp is not supported properly in bound checking. - fix bound check code with '&' on local variables (currently done @@ -61,11 +48,10 @@ Missing features: - disable-asm and disable-bcheck options - __builtin_expect() -- improve '-E' option. - atexit (Nigel Horne) -- packed attribute - C99: add complex types (gcc 3.2 testsuite issue) - postfix compound literals (see 20010124-1.c) +- interactive mode / integrated debugger Optimizations: @@ -81,9 +67,8 @@ Not critical: normative example - only relevant when using gotos! -> must add boolean variable to tell if compound literal was already initialized). -- add PowerPC or ARM code generator and improve codegen for RISC (need +- add PowerPC generator and improve codegen for RISC (need to suppress VT_LOCAL and use a base register instead). -- interactive mode / integrated debugger - fix preprocessor symbol redefinition - add portable byte code generator and interpreter for other unsupported architectures. @@ -108,3 +93,8 @@ Fixed (probably): - #include_next support for /usr/include/limits ? - function pointers/lvalues in ? : (linux kernel net/core/dev.c) - win32: add __stdcall, check GetModuleHandle for dlls. +- macro substitution with nested definitions (ShangHongzhang) +- with "-run" and libtcc, a PLT is now built. +- '-E' option was improved +- packed attribute is now supported +- ARM and ARM64 code generators have been added. diff --git a/configure b/configure index 42821ce..3799805 100755 --- a/configure +++ b/configure @@ -19,6 +19,7 @@ TMPH=$TMPN.h # default parameters build_cross="no" use_libgcc="no" +disable_static="" prefix="" execprefix="" bindir="" @@ -53,6 +54,7 @@ targetos=`uname` case $targetos in MINGW*) mingw32=yes;; MSYS*) mingw32=yes;; + CYGWIN*) mingw32=yes; cygwin=yes; cross_prefix="mingw32-";; DragonFly) noldl=yes;; OpenBSD) noldl=yes;; FreeBSD) noldl=yes;; @@ -69,6 +71,8 @@ source_path_used="yes" if test -z "$source_path" -o "$source_path" = "." ; then source_path=`pwd` source_path_used="no" + # mingw compilers might not understand cygwin paths + if test $cygwin = "yes"; then source_path="."; fi fi for opt do @@ -126,12 +130,12 @@ for opt do ;; --enable-mingw32) mingw32="yes" ; cross_prefix="i686-pc-mingw32-" ; cpu=x86 ;; - --enable-cygwin) mingw32="yes" ; cygwin="yes" ; cross_prefix="mingw32-" ; cpu=x86 - ;; --enable-cross) build_cross="yes" ;; --disable-static) disable_static="yes" ;; + --enable-static) disable_static="no" + ;; --disable-rpath) disable_rpath="yes" ;; --strip-binaries) strip_binaries="yes" @@ -288,12 +292,12 @@ Advanced options (experts only): --cpu=CPU CPU [$cpu] --strip-binaries strip symbol tables from resulting binaries --disable-static make libtcc.so instead of libtcc.a + --enable-static make libtcc.a instead of libtcc.dll (win32) --disable-rpath disable use of -rpath with the above --with-libgcc use libgcc_s.so.1 instead of libtcc1.a in dynamic link --enable-mingw32 build windows version on linux with mingw32 - --enable-cygwin build windows version on windows with cygwin --enable-cross build cross compilers - --with-selinux use mmap for exec mem [needs writable /tmp] + --with-selinux use mmap for executable memory (with tcc -run) --sysincludepaths=... specify system include paths, colon separated --libpaths=... specify system library paths, colon separated --crtprefix=... specify locations of crt?.o, colon separated @@ -309,15 +313,16 @@ ar="${cross_prefix}${ar}" strip="${cross_prefix}${strip}" CONFTEST=./conftest$EXESUF +if ! $cc -o $CONFTEST $source_path/conftest.c 2>/dev/null ; then + echo "configure: error: '$cc' failed to compile conftest.c." +else + gcc_major="$($CONFTEST version)" + gcc_minor="$($CONFTEST minor)" +fi if test -z "$cross_prefix" ; then - if ! $cc -o $CONFTEST $source_path/conftest.c 2>/dev/null ; then - echo "configure: error: '$cc' failed to compile conftest.c." - else - bigendian="$($CONFTEST bigendian)" - gcc_major="$($CONFTEST version)" - gcc_minor="$($CONFTEST minor)" - if test "$mingw32" = "no" ; then + bigendian="$($CONFTEST bigendian)" + if test "$mingw32" = "no" ; then if test -z "$triplet"; then tt="$($CONFTEST triplet)" @@ -348,8 +353,6 @@ if test -z "$cross_prefix" ; then if test -f "/lib/ld-uClibc.so.0" ; then confvars="$confvars uClibc" fi - - fi fi else # if cross compiling, cannot launch a program, so make a static guess @@ -365,7 +368,7 @@ for i in $W_OPTIONS; do O_PRESENT="$(grep -- -W$i cc_help.txt)" if test -n "$O_PRESENT"; then CFLAGS="$CFLAGS -W$i"; fi done -W_OPTIONS="deprecated-declarations strict-aliasing pointer-sign sign-compare unused-result uninitialized" +W_OPTIONS="pointer-sign sign-compare unused-result" for i in $W_OPTIONS; do O_PRESENT="$(grep -- -W$i cc_help.txt)" if test -n "$O_PRESENT"; then CFLAGS="$CFLAGS -Wno-$i"; fi @@ -481,12 +484,6 @@ fi if test "$mingw32" = "yes" ; then echo "CONFIG_WIN32=yes" >> config.mak fi -if test "$cygwin" = "yes" ; then - echo "#ifndef _WIN32" >> $TMPH - echo "# define _WIN32" >> $TMPH - echo "#endif" >> $TMPH - echo "AR=ar" >> config.mak -fi if test "$bigendian" = "yes" ; then echo "WORDS_BIGENDIAN=yes" >> config.mak echo "#define WORDS_BIGENDIAN 1" >> $TMPH @@ -498,8 +495,8 @@ fi if test "$build_cross" = "yes" ; then echo "CONFIG_CROSS=yes" >> config.mak fi -if test "$disable_static" = "yes" ; then - echo "DISABLE_STATIC=yes" >> config.mak +if test -n "$disable_static" ; then + echo "DISABLE_STATIC=$disable_static" >> config.mak fi if test "$disable_rpath" = "yes" ; then echo "DISABLE_RPATH=yes" >> config.mak diff --git a/tcc-doc.texi b/tcc-doc.texi index 9f136ed..db1d28f 100644 --- a/tcc-doc.texi +++ b/tcc-doc.texi @@ -176,29 +176,15 @@ In a script, it gives the following header: #!/usr/local/bin/tcc -run -L/usr/X11R6/lib -lX11 @end example -@item -mms-bitfields -Use an algorithm for bitfield alignment consistent with MSVC. Default is -gcc's algorithm. - -@item -mfloat-abi (ARM only) -Select the float ABI. Possible values: @code{softfp} and @code{hard} - -@item -dumpversion -Print only the compiler version and nothing else. - @item -v Display TCC version. @item -vv -Show included files. As sole argument, print search dirs (as below). +Show included files. As sole argument, print search dirs. -vvv shows tries too. @item -bench Display compilation statistics. -@item -print-search-dirs -Print the configured installation directory and a list of library -and include directories tcc will search. - @end table Preprocessor options: @@ -220,6 +206,10 @@ also be defined: @option{-DF(a)=a+1} @item -Usym Undefine preprocessor symbol @samp{sym}. + +@item -E +Preprocess only, to stdout or file (with -o). + @end table Compilation flags: @@ -337,6 +327,9 @@ Modify executable layout. @item -Wl,-Bsymbolic Set DT_SYMBOLIC tag. +@item -Wl,-(no-)whole-archive +Turn on/off linking of all objects in archives. + @end table Debugger options: @@ -370,6 +363,31 @@ Generate makefile fragment with dependencies. @item -MF depfile Use @file{depfile} as output for -MD. +@item -print-search-dirs +Print the configured installation directory and a list of library +and include directories tcc will search. + +@item -dumpversion +Print version. + +@end table + +Target specific options: + +@table @option +@item -mms-bitfields +Use an algorithm for bitfield alignment consistent with MSVC. Default is +gcc's algorithm. + +@item -mfloat-abi (ARM only) +Select the float ABI. Possible values: @code{softfp} and @code{hard} + +@item -mno-sse +Do not use sse registers on x86-64 + +@item -m32, -m64 +Pass command line to the i386/x86-64 cross compiler. + @end table Note: GCC options @option{-Ox}, @option{-fx} and @option{-mx} are diff --git a/tcc.c b/tcc.c index 0c60d64..c5a1f0e 100644 --- a/tcc.c +++ b/tcc.c @@ -109,6 +109,7 @@ static void help(void) " -E preprocess only\n" " -P[1] no / alternative #line output with -E\n" " -dD -dM output #define directives with -E\n" + " -include file include file above each input file\n" "Linker options:\n" " -Ldir add library path 'dir'\n" " -llib link with dynamic or static library 'lib'\n" diff --git a/tests/Makefile b/tests/Makefile index 39c4830..dbd035f 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -187,7 +187,7 @@ speedtest: ex2 ex3 weaktest: tcctest.c test.ref $(TCC) -c $< -o weaktest.tcc.o - $(CC) -c $< -o weaktest.gcc.o -I. $(CFLAGS) + $(CC) -c $< -o weaktest.gcc.o $(NATIVE_DEFINES) $(CFLAGS) -w -O0 -std=gnu99 -fno-omit-frame-pointer objdump -t weaktest.tcc.o | grep ' w ' | sed -e 's/.* \([a-zA-Z0-9_]*\)$$/\1/' | LC_ALL=C sort > weaktest.tcc.o.txt objdump -t weaktest.gcc.o | grep ' w ' | sed -e 's/.* \([a-zA-Z0-9_]*\)$$/\1/' | LC_ALL=C sort > weaktest.gcc.o.txt diff weaktest.gcc.o.txt weaktest.tcc.o.txt && echo "Weak Auto Test OK" @@ -254,7 +254,8 @@ cache: tcc_g # clean clean: rm -f *~ *.o *.a *.bin *.i *.ref *.out *.out? *.out?b *.cc *.gcc \ -*-cc *-gcc *-tcc *.exe hello libtcc_test vla_test tcctest[1234] ex? tcc_g + *-cc *-gcc *-tcc *.exe hello libtcc_test vla_test tcctest[1234] \ + ex? tcc_g *.def weaktest.*.txt $(MAKE) -C tests2 $@ $(MAKE) -C pp $@ diff --git a/tests/tcctest.py b/tests/tcctest.py deleted file mode 100644 index 817250f..0000000 --- a/tests/tcctest.py +++ /dev/null @@ -1,15 +0,0 @@ -import subprocess -import sys -import difflib - -def main(): - reference = subprocess.check_output([sys.argv[1]]) - compare = subprocess.check_output(sys.argv[2:]) - failed = False - for line in difflib.unified_diff(reference.split('\n'), compare.split('\n'), fromfile='cc', tofile='tcc', lineterm=''): - failed = True - print line - sys.exit(1 if failed else 0) - -if __name__ == '__main__': - main() diff --git a/tests/tests2/82_nocode_wanted.c b/tests/tests2/82_nocode_wanted.c deleted file mode 100644 index a0ec890..0000000 --- a/tests/tests2/82_nocode_wanted.c +++ /dev/null @@ -1,112 +0,0 @@ -extern int printf(const char *format, ...); -static void kb_wait_1(void) -{ - unsigned long timeout = 2; - do { - (1 ? - printf("timeout=%ld\n", timeout) : - ({ - while (1) - printf("error\n"); - }) - ); - timeout--; - } while (timeout); -} -static void kb_wait_2(void) -{ - unsigned long timeout = 2; - do { - (1 ? - printf("timeout=%ld\n", timeout) : - ({ - for (;;) - printf("error\n"); - }) - ); - timeout--; - } while (timeout); -} -static void kb_wait_2_1(void) -{ - unsigned long timeout = 2; - do { - (1 ? - printf("timeout=%ld\n", timeout) : - ({ - do { - printf("error\n"); - } while (1); - }) - ); - timeout--; - } while (timeout); -} -static void kb_wait_2_2(void) -{ - unsigned long timeout = 2; - do { - (1 ? - printf("timeout=%ld\n", timeout) : - ({ - label: - printf("error\n"); - goto label; - }) - ); - timeout--; - } while (timeout); -} -static void kb_wait_3(void) -{ - unsigned long timeout = 2; - do { - (1 ? - printf("timeout=%ld\n", timeout) : - ({ - int i = 1; - goto label; - i = i + 2; - label: - i = i + 3; - }) - ); - timeout--; - } while (timeout); -} -static void kb_wait_4(void) -{ - unsigned long timeout = 2; - do { - (1 ? - printf("timeout=%ld\n", timeout) : - ({ - switch(timeout) { - case 2: - printf("timeout is 2"); - break; - case 1: - printf("timeout is 1"); - break; - default: - printf("timeout is 0?"); - break; - }; - // return; - }) - ); - timeout--; - } while (timeout); -} -int main() -{ - printf("begin\n"); - kb_wait_1(); - kb_wait_2(); - kb_wait_2_1(); - kb_wait_2_2(); - kb_wait_3(); - kb_wait_4(); - printf("end\n"); - return 0; -} diff --git a/tests/tests2/82_nocode_wanted.expect b/tests/tests2/82_nocode_wanted.expect deleted file mode 100644 index c44d4ea..0000000 --- a/tests/tests2/82_nocode_wanted.expect +++ /dev/null @@ -1,14 +0,0 @@ -begin -timeout=2 -timeout=1 -timeout=2 -timeout=1 -timeout=2 -timeout=1 -timeout=2 -timeout=1 -timeout=2 -timeout=1 -timeout=2 -timeout=1 -end diff --git a/tests/tests2/84-hex-float.c b/tests/tests2/84-hex-float.c deleted file mode 100644 index 0ef09bf..0000000 --- a/tests/tests2/84-hex-float.c +++ /dev/null @@ -1,12 +0,0 @@ -extern int printf(const char *format, ...); - -#define ACPI_TYPE_INVALID 0x1E -#define NUM_NS_TYPES ACPI_TYPE_INVALID+1 -int array[NUM_NS_TYPES]; - -#define n 0xe -int main() -{ - printf("n+1 = %d\n", n+1); -// printf("n+1 = %d\n", 0xe+1); -} diff --git a/tests/tests2/84-hex-float.expect b/tests/tests2/84-hex-float.expect deleted file mode 100644 index 2175385..0000000 --- a/tests/tests2/84-hex-float.expect +++ /dev/null @@ -1 +0,0 @@ -n+1 = 15 diff --git a/tests/tests2/84_hex-float.c b/tests/tests2/84_hex-float.c new file mode 100644 index 0000000..0ef09bf --- /dev/null +++ b/tests/tests2/84_hex-float.c @@ -0,0 +1,12 @@ +extern int printf(const char *format, ...); + +#define ACPI_TYPE_INVALID 0x1E +#define NUM_NS_TYPES ACPI_TYPE_INVALID+1 +int array[NUM_NS_TYPES]; + +#define n 0xe +int main() +{ + printf("n+1 = %d\n", n+1); +// printf("n+1 = %d\n", 0xe+1); +} diff --git a/tests/tests2/84_hex-float.expect b/tests/tests2/84_hex-float.expect new file mode 100644 index 0000000..2175385 --- /dev/null +++ b/tests/tests2/84_hex-float.expect @@ -0,0 +1 @@ +n+1 = 15 diff --git a/tests/tests2/85-asm-outside-function.c b/tests/tests2/85-asm-outside-function.c deleted file mode 100644 index dc5639a..0000000 --- a/tests/tests2/85-asm-outside-function.c +++ /dev/null @@ -1,9 +0,0 @@ -extern int printf (const char *, ...); -extern void vide(void); -__asm__("vide: ret"); - -int main() { - vide(); - printf ("okay\n"); - return 0; -} diff --git a/tests/tests2/85-asm-outside-function.expect b/tests/tests2/85-asm-outside-function.expect deleted file mode 100644 index dcf02b2..0000000 --- a/tests/tests2/85-asm-outside-function.expect +++ /dev/null @@ -1 +0,0 @@ -okay diff --git a/tests/tests2/85_asm-outside-function.c b/tests/tests2/85_asm-outside-function.c new file mode 100644 index 0000000..dc5639a --- /dev/null +++ b/tests/tests2/85_asm-outside-function.c @@ -0,0 +1,9 @@ +extern int printf (const char *, ...); +extern void vide(void); +__asm__("vide: ret"); + +int main() { + vide(); + printf ("okay\n"); + return 0; +} diff --git a/tests/tests2/85_asm-outside-function.expect b/tests/tests2/85_asm-outside-function.expect new file mode 100644 index 0000000..dcf02b2 --- /dev/null +++ b/tests/tests2/85_asm-outside-function.expect @@ -0,0 +1 @@ +okay diff --git a/tests/tests2/86-memory-model.c b/tests/tests2/86-memory-model.c deleted file mode 100755 index ca30737..0000000 --- a/tests/tests2/86-memory-model.c +++ /dev/null @@ -1,38 +0,0 @@ -#include - -int -main() -{ -#if defined(__LLP64__) - if (sizeof(short) == 2 - && sizeof(int) == 4 - && sizeof(long int) == 4 - && sizeof(long long int) == 8 - && sizeof(void*) == 8) { - (void)printf("Ok\n"); - } else { - (void)printf("KO __LLP64__\n"); - } -#elif defined(__LP64__) - if (sizeof(short) == 2 - && sizeof(int) == 4 - && sizeof(long int) == 8 - && sizeof(long long int) == 8 - && sizeof(void*) == 8) { - (void)printf("Ok\n"); - } else { - (void)printf("KO __LP64__\n"); - } -#elif defined(__ILP32__) - if (sizeof(short) == 2 - && sizeof(int) == 4 - && sizeof(long int) == 4 - && sizeof(void*) == 4) { - (void)printf("Ok\n"); - } else { - (void)printf("KO __ILP32__\n"); - } -#else - (void)printf("KO no __*LP*__ defined.\n"); -#endif -} diff --git a/tests/tests2/86-memory-model.expect b/tests/tests2/86-memory-model.expect deleted file mode 100755 index a28de60..0000000 --- a/tests/tests2/86-memory-model.expect +++ /dev/null @@ -1 +0,0 @@ -Ok diff --git a/tests/tests2/86-struct-init.c b/tests/tests2/86-struct-init.c deleted file mode 100644 index fd212ba..0000000 --- a/tests/tests2/86-struct-init.c +++ /dev/null @@ -1,248 +0,0 @@ -typedef unsigned char u8; -typedef struct {} empty_s; -struct contains_empty { - u8 a; - empty_s empty; - u8 b; -}; -struct contains_empty ce = { { (1) }, (empty_s){}, 022, }; -/* The following decl of 'q' would demonstrate the TCC bug in init_putv when - handling copying compound literals. (Compound literals - aren't acceptable constant initializers in isoc99, but - we accept them like gcc, except for this case) -//char *q = (char *){ "trara" }; */ -struct SS {u8 a[3], b; }; -struct SS sinit16[] = { { 1 }, 2 }; -struct S -{ - u8 a,b; - u8 c[2]; -}; - -struct T -{ - u8 s[16]; - u8 a; -}; - -struct U -{ - u8 a; - struct S s; - u8 b; - struct T t; -}; - -struct V -{ - struct S s; - struct T t; - u8 a; -}; - -struct W -{ - struct V t; - struct S s[]; -}; - -struct S gs = ((struct S){1, 2, 3, 4}); -struct S gs2 = {1, 2, {3, 4}}; -struct T gt = {"hello", 42}; -struct U gu = {3, 5,6,7,8, 4, "huhu", 43}; -struct U gu2 = {3, {5,6,7,8}, 4, {"huhu", 43}}; -/* Optional braces around scalar initializers. Accepted, but with - a warning. */ -struct U gu3 = { {3}, {5,6,7,8,}, 4, {"huhu", 43}}; -/* Many superfluous braces and leaving out one initializer for U.s.c[1] */ -struct U gu4 = { 3, {5,6,7,}, 5, { "bla", {44}} }; -/* Superfluous braces and useless parens around values */ -struct S gs3 = { (1), {(2)}, {(((3))), {4}}}; -/* Superfluous braces, and leaving out braces for V.t, plus cast */ -struct V gv = {{{3},4,{5,6}}, "haha", (u8)45, 46}; -/* Compund literal */ -struct V gv2 = {(struct S){7,8,{9,10}}, {"hihi", 47}, 48}; -/* Parens around compound literal */ -struct V gv3 = {((struct S){7,8,{9,10}}), {"hoho", 49}, 50}; -/* Initialization of a flex array member (warns in GCC) */ -struct W gw = {{1,2,3,4}, {1,2,3,4,5}}; - -union UU { - u8 a; - u8 b; -}; -struct SU { - union UU u; - u8 c; -}; -struct SU gsu = {5,6}; - -/* Unnamed struct/union members aren't ISO C, but it's a widely accepted - extension. See below for further extensions to that under -fms-extension.*/ -union UV { - struct {u8 a,b;}; - struct S s; -}; -union UV guv = {{6,5}}; -union UV guv2 = {{.b = 7, .a = 8}}; -union UV guv3 = {.b = 8, .a = 7}; - -/* Under -fms-extensions also the following is valid: -union UV2 { - struct Anon {u8 a,b;}; // unnamed member, but tagged struct, ... - struct S s; -}; -struct Anon gan = { 10, 11 }; // ... which makes it available here. -union UV2 guv4 = {{4,3}}; // and the other inits from above as well -*/ - -struct in6_addr { - union { - u8 u6_addr8[16]; - unsigned short u6_addr16[8]; - } u; -}; -struct flowi6 { - struct in6_addr saddr, daddr; -}; -struct pkthdr { - struct in6_addr daddr, saddr; -}; -struct pkthdr phdr = { { { 6,5,4,3 } }, { { 9,8,7,6 } } }; - -struct Wrap { - void *func; -}; -int global; -void inc_global (void) -{ - global++; -} - -struct Wrap global_wrap[] = { - ((struct Wrap) {inc_global}), - inc_global, -}; - -#include -void print_ (const char *name, const u8 *p, long size) -{ - printf ("%s:", name); - while (size--) { - printf (" %x", *p++); - } - printf ("\n"); -} -#define print(x) print_(#x, (u8*)&x, sizeof (x)) -#if 1 -void foo (struct W *w, struct pkthdr *phdr_) -{ - struct S ls = {1, 2, 3, 4}; - struct S ls2 = {1, 2, {3, 4}}; - struct T lt = {"hello", 42}; - struct U lu = {3, 5,6,7,8, 4, "huhu", 43}; - struct U lu1 = {3, ls, 4, {"huhu", 43}}; - struct U lu2 = {3, (ls), 4, {"huhu", 43}}; - const struct S *pls = &ls; - struct S ls21 = *pls; - struct U lu22 = {3, *pls, 4, {"huhu", 43}}; - /* Incomplete bracing. */ - struct U lu21 = {3, ls, 4, "huhu", 43}; - /* Optional braces around scalar initializers. Accepted, but with - a warning. */ - struct U lu3 = { 3, {5,6,7,8,}, 4, {"huhu", 43}}; - /* Many superfluous braces and leaving out one initializer for U.s.c[1] */ - struct U lu4 = { 3, {5,6,7,}, 5, { "bla", 44} }; - /* Superfluous braces and useless parens around values */ - struct S ls3 = { (1), (2), {(((3))), 4}}; - /* Superfluous braces, and leaving out braces for V.t, plus cast */ - struct V lv = {{3,4,{5,6}}, "haha", (u8)45, 46}; - /* Compund literal */ - struct V lv2 = {(struct S)w->t.s, {"hihi", 47}, 48}; - /* Parens around compound literal */ - struct V lv3 = {((struct S){7,8,{9,10}}), ((const struct W *)w)->t.t, 50}; - const struct pkthdr *phdr = phdr_; - struct flowi6 flow = { .daddr = phdr->daddr, .saddr = phdr->saddr }; - int elt = 0x42; - /* Range init, overlapping */ - struct T lt2 = { { [1 ... 5] = 9, [6 ... 10] = elt, [4 ... 7] = elt+1 }, 1 }; - print(ls); - print(ls2); - print(lt); - print(lu); - print(lu1); - print(lu2); - print(ls21); - print(lu21); - print(lu22); - print(lu3); - print(lu4); - print(ls3); - print(lv); - print(lv2); - print(lv3); - print(lt2); - print(flow); -} -#endif - -void test_compound_with_relocs (void) -{ - struct Wrap local_wrap[] = { - ((struct Wrap) {inc_global}), - inc_global, - }; - void (*p)(void); - p = global_wrap[0].func; p(); - p = global_wrap[1].func; p(); - p = local_wrap[0].func; p(); - p = local_wrap[1].func; p(); -} - -void sys_ni(void) { printf("ni\n"); } -void sys_one(void) { printf("one\n"); } -void sys_two(void) { printf("two\n"); } -void sys_three(void) { printf("three\n"); } -typedef void (*fptr)(void); -const fptr table[3] = { - [0 ... 2] = &sys_ni, - [0] = sys_one, - [1] = sys_two, - [2] = sys_three, -}; - -void test_multi_relocs(void) -{ - int i; - for (i = 0; i < sizeof(table)/sizeof(table[0]); i++) - table[i](); -} - -int main() -{ - print(ce); - print(gs); - print(gs2); - print(gt); - print(gu); - print(gu2); - print(gu3); - print(gu4); - print(gs3); - print(gv); - print(gv2); - print(gv3); - print(sinit16); - print(gw); - print(gsu); - print(guv); - print(guv.b); - print(guv2); - print(guv3); - print(phdr); - foo(&gw, &phdr); - //printf("q: %s\n", q); - test_compound_with_relocs(); - test_multi_relocs(); - return 0; -} diff --git a/tests/tests2/86-struct-init.expect b/tests/tests2/86-struct-init.expect deleted file mode 100644 index adda76d..0000000 --- a/tests/tests2/86-struct-init.expect +++ /dev/null @@ -1,40 +0,0 @@ -ce: 1 12 -gs: 1 2 3 4 -gs2: 1 2 3 4 -gt: 68 65 6c 6c 6f 0 0 0 0 0 0 0 0 0 0 0 2a -gu: 3 5 6 7 8 4 68 75 68 75 0 0 0 0 0 0 0 0 0 0 0 0 2b -gu2: 3 5 6 7 8 4 68 75 68 75 0 0 0 0 0 0 0 0 0 0 0 0 2b -gu3: 3 5 6 7 8 4 68 75 68 75 0 0 0 0 0 0 0 0 0 0 0 0 2b -gu4: 3 5 6 7 0 5 62 6c 61 0 0 0 0 0 0 0 0 0 0 0 0 0 2c -gs3: 1 2 3 4 -gv: 3 4 5 6 68 61 68 61 0 0 0 0 0 0 0 0 0 0 0 0 2d 2e -gv2: 7 8 9 a 68 69 68 69 0 0 0 0 0 0 0 0 0 0 0 0 2f 30 -gv3: 7 8 9 a 68 6f 68 6f 0 0 0 0 0 0 0 0 0 0 0 0 31 32 -sinit16: 1 0 0 0 2 0 0 0 -gw: 1 2 3 4 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -gsu: 5 6 -guv: 6 5 0 0 -guv.b: 5 -guv2: 8 7 0 0 -guv3: 7 8 0 0 -phdr: 6 5 4 3 0 0 0 0 0 0 0 0 0 0 0 0 9 8 7 6 0 0 0 0 0 0 0 0 0 0 0 0 -ls: 1 2 3 4 -ls2: 1 2 3 4 -lt: 68 65 6c 6c 6f 0 0 0 0 0 0 0 0 0 0 0 2a -lu: 3 5 6 7 8 4 68 75 68 75 0 0 0 0 0 0 0 0 0 0 0 0 2b -lu1: 3 1 2 3 4 4 68 75 68 75 0 0 0 0 0 0 0 0 0 0 0 0 2b -lu2: 3 1 2 3 4 4 68 75 68 75 0 0 0 0 0 0 0 0 0 0 0 0 2b -ls21: 1 2 3 4 -lu21: 3 1 2 3 4 4 68 75 68 75 0 0 0 0 0 0 0 0 0 0 0 0 2b -lu22: 3 1 2 3 4 4 68 75 68 75 0 0 0 0 0 0 0 0 0 0 0 0 2b -lu3: 3 5 6 7 8 4 68 75 68 75 0 0 0 0 0 0 0 0 0 0 0 0 2b -lu4: 3 5 6 7 0 5 62 6c 61 0 0 0 0 0 0 0 0 0 0 0 0 0 2c -ls3: 1 2 3 4 -lv: 3 4 5 6 68 61 68 61 0 0 0 0 0 0 0 0 0 0 0 0 2d 2e -lv2: 1 2 3 4 68 69 68 69 0 0 0 0 0 0 0 0 0 0 0 0 2f 30 -lv3: 7 8 9 a 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 32 -lt2: 0 9 9 9 43 43 43 43 42 42 42 0 0 0 0 0 1 -flow: 9 8 7 6 0 0 0 0 0 0 0 0 0 0 0 0 6 5 4 3 0 0 0 0 0 0 0 0 0 0 0 0 -one -two -three diff --git a/tests/tests2/86_memory-model.c b/tests/tests2/86_memory-model.c new file mode 100644 index 0000000..744c3e2 --- /dev/null +++ b/tests/tests2/86_memory-model.c @@ -0,0 +1,38 @@ +#include + +int +main() +{ +#if defined(__LLP64__) + if (sizeof(short) == 2 + && sizeof(int) == 4 + && sizeof(long int) == 4 + && sizeof(long long int) == 8 + && sizeof(void*) == 8) { + (void)printf("Ok\n"); + } else { + (void)printf("KO __LLP64__\n"); + } +#elif defined(__LP64__) + if (sizeof(short) == 2 + && sizeof(int) == 4 + && sizeof(long int) == 8 + && sizeof(long long int) == 8 + && sizeof(void*) == 8) { + (void)printf("Ok\n"); + } else { + (void)printf("KO __LP64__\n"); + } +#elif defined(__ILP32__) + if (sizeof(short) == 2 + && sizeof(int) == 4 + && sizeof(long int) == 4 + && sizeof(void*) == 4) { + (void)printf("Ok\n"); + } else { + (void)printf("KO __ILP32__\n"); + } +#else + (void)printf("KO no __*LP*__ defined.\n"); +#endif +} diff --git a/tests/tests2/86_memory-model.expect b/tests/tests2/86_memory-model.expect new file mode 100644 index 0000000..7326d96 --- /dev/null +++ b/tests/tests2/86_memory-model.expect @@ -0,0 +1 @@ +Ok diff --git a/tests/tests2/87_ptr_longlong_arith32.c b/tests/tests2/87_ptr_longlong_arith32.c deleted file mode 100644 index bf07915..0000000 --- a/tests/tests2/87_ptr_longlong_arith32.c +++ /dev/null @@ -1,15 +0,0 @@ -int printf(const char *, ...); -char t[] = "012345678"; - -int main(void) -{ - char *data = t; - unsigned long long r = 4; - unsigned a = 5; - unsigned long long b = 12; - - *(unsigned*)(data + r) += a - b; - - printf("data = \"%s\"\n", data); - return 0; -} diff --git a/tests/tests2/87_ptr_longlong_arith32.expect b/tests/tests2/87_ptr_longlong_arith32.expect deleted file mode 100644 index f91e4b4..0000000 --- a/tests/tests2/87_ptr_longlong_arith32.expect +++ /dev/null @@ -1 +0,0 @@ -data = "0123-5678" diff --git a/tests/tests2/89_nocode_wanted.c b/tests/tests2/89_nocode_wanted.c new file mode 100644 index 0000000..73e0a4b --- /dev/null +++ b/tests/tests2/89_nocode_wanted.c @@ -0,0 +1,112 @@ +extern int printf(const char *format, ...); +static void kb_wait_1(void) +{ + unsigned long timeout = 2; + do { + (1 ? + printf("timeout=%ld\n", timeout) : + ({ + while (1) + printf("error\n"); + }) + ); + timeout--; + } while (timeout); +} +static void kb_wait_2(void) +{ + unsigned long timeout = 2; + do { + (1 ? + printf("timeout=%ld\n", timeout) : + ({ + for (;;) + printf("error\n"); + }) + ); + timeout--; + } while (timeout); +} +static void kb_wait_2_1(void) +{ + unsigned long timeout = 2; + do { + (1 ? + printf("timeout=%ld\n", timeout) : + ({ + do { + printf("error\n"); + } while (1); + }) + ); + timeout--; + } while (timeout); +} +static void kb_wait_2_2(void) +{ + unsigned long timeout = 2; + do { + (1 ? + printf("timeout=%ld\n", timeout) : + ({ + label: + printf("error\n"); + goto label; + }) + ); + timeout--; + } while (timeout); +} +static void kb_wait_3(void) +{ + unsigned long timeout = 2; + do { + (1 ? + printf("timeout=%ld\n", timeout) : + ({ + int i = 1; + goto label; + i = i + 2; + label: + i = i + 3; + }) + ); + timeout--; + } while (timeout); +} +static void kb_wait_4(void) +{ + unsigned long timeout = 2; + do { + (1 ? + printf("timeout=%ld\n", timeout) : + ({ + switch(timeout) { + case 2: + printf("timeout is 2"); + break; + case 1: + printf("timeout is 1"); + break; + default: + printf("timeout is 0?"); + break; + }; + // return; + }) + ); + timeout--; + } while (timeout); +} +int main() +{ + printf("begin\n"); + kb_wait_1(); + kb_wait_2(); + kb_wait_2_1(); + kb_wait_2_2(); + kb_wait_3(); + kb_wait_4(); + printf("end\n"); + return 0; +} diff --git a/tests/tests2/89_nocode_wanted.expect b/tests/tests2/89_nocode_wanted.expect new file mode 100644 index 0000000..c44d4ea --- /dev/null +++ b/tests/tests2/89_nocode_wanted.expect @@ -0,0 +1,14 @@ +begin +timeout=2 +timeout=1 +timeout=2 +timeout=1 +timeout=2 +timeout=1 +timeout=2 +timeout=1 +timeout=2 +timeout=1 +timeout=2 +timeout=1 +end diff --git a/tests/tests2/90_struct-init.c b/tests/tests2/90_struct-init.c new file mode 100644 index 0000000..fd212ba --- /dev/null +++ b/tests/tests2/90_struct-init.c @@ -0,0 +1,248 @@ +typedef unsigned char u8; +typedef struct {} empty_s; +struct contains_empty { + u8 a; + empty_s empty; + u8 b; +}; +struct contains_empty ce = { { (1) }, (empty_s){}, 022, }; +/* The following decl of 'q' would demonstrate the TCC bug in init_putv when + handling copying compound literals. (Compound literals + aren't acceptable constant initializers in isoc99, but + we accept them like gcc, except for this case) +//char *q = (char *){ "trara" }; */ +struct SS {u8 a[3], b; }; +struct SS sinit16[] = { { 1 }, 2 }; +struct S +{ + u8 a,b; + u8 c[2]; +}; + +struct T +{ + u8 s[16]; + u8 a; +}; + +struct U +{ + u8 a; + struct S s; + u8 b; + struct T t; +}; + +struct V +{ + struct S s; + struct T t; + u8 a; +}; + +struct W +{ + struct V t; + struct S s[]; +}; + +struct S gs = ((struct S){1, 2, 3, 4}); +struct S gs2 = {1, 2, {3, 4}}; +struct T gt = {"hello", 42}; +struct U gu = {3, 5,6,7,8, 4, "huhu", 43}; +struct U gu2 = {3, {5,6,7,8}, 4, {"huhu", 43}}; +/* Optional braces around scalar initializers. Accepted, but with + a warning. */ +struct U gu3 = { {3}, {5,6,7,8,}, 4, {"huhu", 43}}; +/* Many superfluous braces and leaving out one initializer for U.s.c[1] */ +struct U gu4 = { 3, {5,6,7,}, 5, { "bla", {44}} }; +/* Superfluous braces and useless parens around values */ +struct S gs3 = { (1), {(2)}, {(((3))), {4}}}; +/* Superfluous braces, and leaving out braces for V.t, plus cast */ +struct V gv = {{{3},4,{5,6}}, "haha", (u8)45, 46}; +/* Compund literal */ +struct V gv2 = {(struct S){7,8,{9,10}}, {"hihi", 47}, 48}; +/* Parens around compound literal */ +struct V gv3 = {((struct S){7,8,{9,10}}), {"hoho", 49}, 50}; +/* Initialization of a flex array member (warns in GCC) */ +struct W gw = {{1,2,3,4}, {1,2,3,4,5}}; + +union UU { + u8 a; + u8 b; +}; +struct SU { + union UU u; + u8 c; +}; +struct SU gsu = {5,6}; + +/* Unnamed struct/union members aren't ISO C, but it's a widely accepted + extension. See below for further extensions to that under -fms-extension.*/ +union UV { + struct {u8 a,b;}; + struct S s; +}; +union UV guv = {{6,5}}; +union UV guv2 = {{.b = 7, .a = 8}}; +union UV guv3 = {.b = 8, .a = 7}; + +/* Under -fms-extensions also the following is valid: +union UV2 { + struct Anon {u8 a,b;}; // unnamed member, but tagged struct, ... + struct S s; +}; +struct Anon gan = { 10, 11 }; // ... which makes it available here. +union UV2 guv4 = {{4,3}}; // and the other inits from above as well +*/ + +struct in6_addr { + union { + u8 u6_addr8[16]; + unsigned short u6_addr16[8]; + } u; +}; +struct flowi6 { + struct in6_addr saddr, daddr; +}; +struct pkthdr { + struct in6_addr daddr, saddr; +}; +struct pkthdr phdr = { { { 6,5,4,3 } }, { { 9,8,7,6 } } }; + +struct Wrap { + void *func; +}; +int global; +void inc_global (void) +{ + global++; +} + +struct Wrap global_wrap[] = { + ((struct Wrap) {inc_global}), + inc_global, +}; + +#include +void print_ (const char *name, const u8 *p, long size) +{ + printf ("%s:", name); + while (size--) { + printf (" %x", *p++); + } + printf ("\n"); +} +#define print(x) print_(#x, (u8*)&x, sizeof (x)) +#if 1 +void foo (struct W *w, struct pkthdr *phdr_) +{ + struct S ls = {1, 2, 3, 4}; + struct S ls2 = {1, 2, {3, 4}}; + struct T lt = {"hello", 42}; + struct U lu = {3, 5,6,7,8, 4, "huhu", 43}; + struct U lu1 = {3, ls, 4, {"huhu", 43}}; + struct U lu2 = {3, (ls), 4, {"huhu", 43}}; + const struct S *pls = &ls; + struct S ls21 = *pls; + struct U lu22 = {3, *pls, 4, {"huhu", 43}}; + /* Incomplete bracing. */ + struct U lu21 = {3, ls, 4, "huhu", 43}; + /* Optional braces around scalar initializers. Accepted, but with + a warning. */ + struct U lu3 = { 3, {5,6,7,8,}, 4, {"huhu", 43}}; + /* Many superfluous braces and leaving out one initializer for U.s.c[1] */ + struct U lu4 = { 3, {5,6,7,}, 5, { "bla", 44} }; + /* Superfluous braces and useless parens around values */ + struct S ls3 = { (1), (2), {(((3))), 4}}; + /* Superfluous braces, and leaving out braces for V.t, plus cast */ + struct V lv = {{3,4,{5,6}}, "haha", (u8)45, 46}; + /* Compund literal */ + struct V lv2 = {(struct S)w->t.s, {"hihi", 47}, 48}; + /* Parens around compound literal */ + struct V lv3 = {((struct S){7,8,{9,10}}), ((const struct W *)w)->t.t, 50}; + const struct pkthdr *phdr = phdr_; + struct flowi6 flow = { .daddr = phdr->daddr, .saddr = phdr->saddr }; + int elt = 0x42; + /* Range init, overlapping */ + struct T lt2 = { { [1 ... 5] = 9, [6 ... 10] = elt, [4 ... 7] = elt+1 }, 1 }; + print(ls); + print(ls2); + print(lt); + print(lu); + print(lu1); + print(lu2); + print(ls21); + print(lu21); + print(lu22); + print(lu3); + print(lu4); + print(ls3); + print(lv); + print(lv2); + print(lv3); + print(lt2); + print(flow); +} +#endif + +void test_compound_with_relocs (void) +{ + struct Wrap local_wrap[] = { + ((struct Wrap) {inc_global}), + inc_global, + }; + void (*p)(void); + p = global_wrap[0].func; p(); + p = global_wrap[1].func; p(); + p = local_wrap[0].func; p(); + p = local_wrap[1].func; p(); +} + +void sys_ni(void) { printf("ni\n"); } +void sys_one(void) { printf("one\n"); } +void sys_two(void) { printf("two\n"); } +void sys_three(void) { printf("three\n"); } +typedef void (*fptr)(void); +const fptr table[3] = { + [0 ... 2] = &sys_ni, + [0] = sys_one, + [1] = sys_two, + [2] = sys_three, +}; + +void test_multi_relocs(void) +{ + int i; + for (i = 0; i < sizeof(table)/sizeof(table[0]); i++) + table[i](); +} + +int main() +{ + print(ce); + print(gs); + print(gs2); + print(gt); + print(gu); + print(gu2); + print(gu3); + print(gu4); + print(gs3); + print(gv); + print(gv2); + print(gv3); + print(sinit16); + print(gw); + print(gsu); + print(guv); + print(guv.b); + print(guv2); + print(guv3); + print(phdr); + foo(&gw, &phdr); + //printf("q: %s\n", q); + test_compound_with_relocs(); + test_multi_relocs(); + return 0; +} diff --git a/tests/tests2/90_struct-init.expect b/tests/tests2/90_struct-init.expect new file mode 100644 index 0000000..adda76d --- /dev/null +++ b/tests/tests2/90_struct-init.expect @@ -0,0 +1,40 @@ +ce: 1 12 +gs: 1 2 3 4 +gs2: 1 2 3 4 +gt: 68 65 6c 6c 6f 0 0 0 0 0 0 0 0 0 0 0 2a +gu: 3 5 6 7 8 4 68 75 68 75 0 0 0 0 0 0 0 0 0 0 0 0 2b +gu2: 3 5 6 7 8 4 68 75 68 75 0 0 0 0 0 0 0 0 0 0 0 0 2b +gu3: 3 5 6 7 8 4 68 75 68 75 0 0 0 0 0 0 0 0 0 0 0 0 2b +gu4: 3 5 6 7 0 5 62 6c 61 0 0 0 0 0 0 0 0 0 0 0 0 0 2c +gs3: 1 2 3 4 +gv: 3 4 5 6 68 61 68 61 0 0 0 0 0 0 0 0 0 0 0 0 2d 2e +gv2: 7 8 9 a 68 69 68 69 0 0 0 0 0 0 0 0 0 0 0 0 2f 30 +gv3: 7 8 9 a 68 6f 68 6f 0 0 0 0 0 0 0 0 0 0 0 0 31 32 +sinit16: 1 0 0 0 2 0 0 0 +gw: 1 2 3 4 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +gsu: 5 6 +guv: 6 5 0 0 +guv.b: 5 +guv2: 8 7 0 0 +guv3: 7 8 0 0 +phdr: 6 5 4 3 0 0 0 0 0 0 0 0 0 0 0 0 9 8 7 6 0 0 0 0 0 0 0 0 0 0 0 0 +ls: 1 2 3 4 +ls2: 1 2 3 4 +lt: 68 65 6c 6c 6f 0 0 0 0 0 0 0 0 0 0 0 2a +lu: 3 5 6 7 8 4 68 75 68 75 0 0 0 0 0 0 0 0 0 0 0 0 2b +lu1: 3 1 2 3 4 4 68 75 68 75 0 0 0 0 0 0 0 0 0 0 0 0 2b +lu2: 3 1 2 3 4 4 68 75 68 75 0 0 0 0 0 0 0 0 0 0 0 0 2b +ls21: 1 2 3 4 +lu21: 3 1 2 3 4 4 68 75 68 75 0 0 0 0 0 0 0 0 0 0 0 0 2b +lu22: 3 1 2 3 4 4 68 75 68 75 0 0 0 0 0 0 0 0 0 0 0 0 2b +lu3: 3 5 6 7 8 4 68 75 68 75 0 0 0 0 0 0 0 0 0 0 0 0 2b +lu4: 3 5 6 7 0 5 62 6c 61 0 0 0 0 0 0 0 0 0 0 0 0 0 2c +ls3: 1 2 3 4 +lv: 3 4 5 6 68 61 68 61 0 0 0 0 0 0 0 0 0 0 0 0 2d 2e +lv2: 1 2 3 4 68 69 68 69 0 0 0 0 0 0 0 0 0 0 0 0 2f 30 +lv3: 7 8 9 a 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 32 +lt2: 0 9 9 9 43 43 43 43 42 42 42 0 0 0 0 0 1 +flow: 9 8 7 6 0 0 0 0 0 0 0 0 0 0 0 0 6 5 4 3 0 0 0 0 0 0 0 0 0 0 0 0 +one +two +three diff --git a/tests/tests2/91_ptr_longlong_arith32.c b/tests/tests2/91_ptr_longlong_arith32.c new file mode 100644 index 0000000..bf07915 --- /dev/null +++ b/tests/tests2/91_ptr_longlong_arith32.c @@ -0,0 +1,15 @@ +int printf(const char *, ...); +char t[] = "012345678"; + +int main(void) +{ + char *data = t; + unsigned long long r = 4; + unsigned a = 5; + unsigned long long b = 12; + + *(unsigned*)(data + r) += a - b; + + printf("data = \"%s\"\n", data); + return 0; +} diff --git a/tests/tests2/91_ptr_longlong_arith32.expect b/tests/tests2/91_ptr_longlong_arith32.expect new file mode 100644 index 0000000..f91e4b4 --- /dev/null +++ b/tests/tests2/91_ptr_longlong_arith32.expect @@ -0,0 +1 @@ +data = "0123-5678" diff --git a/win32/Makefile b/win32/Makefile index 0b0c5b5..f52da4b 100644 --- a/win32/Makefile +++ b/win32/Makefile @@ -110,7 +110,7 @@ tarball: @cp -r lib $(TARNAME) @cp -r libtcc $(TARNAME) @cp -r tools $(TARNAME) - @cp -r vs2015 $(TARNAME) +# @cp -r vs2015 $(TARNAME) @cp -r build-tcc.bat $(TARNAME) @cp -r i386-win32-tcc.exe $(TARNAME) @cp -r libtcc.def $(TARNAME) diff --git a/win32/build-tcc.bat b/win32/build-tcc.bat index 0598119..77c0067 100644 --- a/win32/build-tcc.bat +++ b/win32/build-tcc.bat @@ -1,10 +1,11 @@ @rem ------------------------------------------------------ -@rem batch file to build tcc using mingw gcc or tcc itself +@rem batch file to build tcc using mingw, msvc or tcc itself @rem ------------------------------------------------------ @echo off -set CC=gcc -Os -s -fno-strict-aliasing +set CC=gcc -Os -s + set T=32 if %PROCESSOR_ARCHITECTURE%_==AMD64_ set T=64 if %PROCESSOR_ARCHITEW6432%_==AMD64_ set T=64 @@ -16,7 +17,7 @@ goto :a0 :usage echo usage: build-tcc.bat [ options ... ] echo options: -echo -c prog use prog (gcc or tcc) to compile tcc +echo -c prog use prog (gcc/tcc/cl) to compile tcc echo -c "prog options" use prog with options to compile tcc echo -t 32/64 force 32/64 bit default target echo -v "version" set tcc version @@ -24,6 +25,21 @@ echo -i dir install tcc into dir echo -d create tcc-doc.html too (needs makeinfo) exit /B 1 +:cl +@echo off +set CMD=cl +:c0 +set ARG=%1 +set ARG=%ARG:.dll=.lib% +if (%1)==(-shared) set ARG=-LD +if (%1)==(-o) shift && set ARG=-Fe%2 +set CMD=%CMD% %ARG% +shift +if not (%1)==() goto :c0 +echo on +%CMD% -O1 -W2 -Zi -MT -GS- -nologo -link -opt:ref,icf +@exit /B %ERRORLEVEL% + :a2 shift :a1 @@ -31,6 +47,7 @@ shift :a0 if not (%1)==(-c) goto :a3 set CC=%~2 +if (%2)==(cl) set CC=@call :cl goto :a2 :a3 if not (%1)==(-t) goto :a4 diff --git a/win32/include/tcc/tcc_libm.h b/win32/include/tcc/tcc_libm.h index c9a6ad1..44b96e2 100644 --- a/win32/include/tcc/tcc_libm.h +++ b/win32/include/tcc/tcc_libm.h @@ -1,7 +1,7 @@ #ifndef _TCC_LIBM_H_ #define _TCC_LIBM_H_ -#include "../include/math.h" +#include "../math.h" /* TCC uses 8 bytes for double and long double, so effectively the l variants * are never used. For now, they just run the normal (double) variant. diff --git a/win32/tcc-win32.txt b/win32/tcc-win32.txt index da07e44..9299e68 100644 --- a/win32/tcc-win32.txt +++ b/win32/tcc-win32.txt @@ -107,23 +107,26 @@ Compilation from source: ------------------------ * You can use the MinGW and MSYS tools available at - http://www.mingw.org Untar the TCC archive and type in the MSYS shell: - ./configure [--prefix installpath] make make install - The default install location is c:\Program Files\tcc + The default install location is c:\Program Files\tcc * Alternatively you can compile TCC with just GCC from MinGW using + > build-tcc.bat (from the win32 directory) + + Also MSVC can be used with the "VSTools Developer Command Prompt": + > build-tcc.bat -c cl - build-tcc.bat (from the win32 directory) + or with a tcc (needs to be in a different directory) + > build-tcc.bat -c some-tcc-dir\tcc.exe - To install, copy the entire contents of the win32 directory to - where you want. + Also you can copy/install everything into another directory: + > build-tcc.bat -i Limitations: diff --git a/win32/vs2015/PreBuild.bat b/win32/vs2015/PreBuild.bat deleted file mode 100644 index 9d2f8b1..0000000 --- a/win32/vs2015/PreBuild.bat +++ /dev/null @@ -1,9 +0,0 @@ -set /p VERSION= < %~dp0..\..\VERSION - -:config.h -echo> .\config.h #define TCC_VERSION "%VERSION%" -echo>> .\config.h #ifdef TCC_TARGET_X86_64 -echo>> .\config.h #define CONFIG_TCC_LIBPATHS "{B}/lib/64;{B}/lib" -echo>> .\config.h #else -echo>> .\config.h #define CONFIG_TCC_LIBPATHS "{B}/lib/32;{B}/lib" -echo>> .\config.h #endif diff --git a/win32/vs2015/libtcc.vcxproj b/win32/vs2015/libtcc.vcxproj deleted file mode 100644 index af179c3..0000000 --- a/win32/vs2015/libtcc.vcxproj +++ /dev/null @@ -1,220 +0,0 @@ - - - - - Debug - Win32 - - - Release - Win32 - - - Debug - x64 - - - Release - x64 - - - - {41F2DA74-9707-49A3-A466-157C7028BD79} - Win32Proj - libtcc - 8.1 - - - - DynamicLibrary - true - v140 - MultiByte - - - DynamicLibrary - false - v140 - true - MultiByte - - - DynamicLibrary - true - v140 - MultiByte - - - DynamicLibrary - false - v140 - true - MultiByte - - - - - - - - - - - - - - - - - - - - - true - $(ProjectDir);$(VC_IncludePath);$(WindowsSDK_IncludePath); - - - true - $(ProjectDir);$(VC_IncludePath);$(WindowsSDK_IncludePath); - - - false - $(ProjectDir);$(VC_IncludePath);$(WindowsSDK_IncludePath); - - - false - $(ProjectDir);$(VC_IncludePath);$(WindowsSDK_IncludePath); - - - - - - Level3 - Disabled - ONE_SOURCE;LIBTCC_AS_DLL;TCC_TARGET_PE;TCC_TARGET_I386;WIN32;_DEBUG;_WINDOWS;_USRDLL;LIBTCC_EXPORTS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) - EditAndContinue - - - Windows - true - - - copy $(TargetPath) $(SolutionDir).. - - - $(ProjectDir)PreBuild.bat - - - Generate config.h - - - - - - - Level3 - Disabled - ONE_SOURCE;LIBTCC_AS_DLL;TCC_TARGET_PE;TCC_TARGET_X86_64;_DEBUG;_WINDOWS;_USRDLL;LIBTCC_EXPORTS;%(PreprocessorDefinitions) - EditAndContinue - - - Windows - true - - - copy $(TargetPath) $(SolutionDir).. - - - $(ProjectDir)PreBuild.bat - - - Generate config.h - - - - - Level3 - - - MaxSpeed - true - true - ONE_SOURCE;LIBTCC_AS_DLL;TCC_TARGET_PE;TCC_TARGET_I386;WIN32;NDEBUG;_WINDOWS;_USRDLL;LIBTCC_EXPORTS;%(PreprocessorDefinitions) - - - Windows - true - true - true - - - copy $(TargetPath) $(SolutionDir).. - - - $(ProjectDir)PreBuild.bat - - - Generate config.h - - - - - Level3 - - - MaxSpeed - true - true - ONE_SOURCE;LIBTCC_AS_DLL;TCC_TARGET_PE;TCC_TARGET_X86_64;NDEBUG;_WINDOWS;_USRDLL;LIBTCC_EXPORTS;%(PreprocessorDefinitions) - - - Windows - true - true - true - - - copy $(TargetPath) $(SolutionDir).. - - - $(ProjectDir)PreBuild.bat - - - Generate config.h - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/win32/vs2015/tcc.sln b/win32/vs2015/tcc.sln deleted file mode 100644 index 9015cd0..0000000 --- a/win32/vs2015/tcc.sln +++ /dev/null @@ -1,41 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 14 -VisualStudioVersion = 14.0.25123.0 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "tcc", "tcc.vcxproj", "{6E7932A7-B123-48EB-AB39-40867AF28105}" - ProjectSection(ProjectDependencies) = postProject - {41F2DA74-9707-49A3-A466-157C7028BD79} = {41F2DA74-9707-49A3-A466-157C7028BD79} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libtcc", "libtcc.vcxproj", "{41F2DA74-9707-49A3-A466-157C7028BD79}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|x64 = Debug|x64 - Debug|x86 = Debug|x86 - Release|x64 = Release|x64 - Release|x86 = Release|x86 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {6E7932A7-B123-48EB-AB39-40867AF28105}.Debug|x64.ActiveCfg = Debug|x64 - {6E7932A7-B123-48EB-AB39-40867AF28105}.Debug|x64.Build.0 = Debug|x64 - {6E7932A7-B123-48EB-AB39-40867AF28105}.Debug|x86.ActiveCfg = Debug|Win32 - {6E7932A7-B123-48EB-AB39-40867AF28105}.Debug|x86.Build.0 = Debug|Win32 - {6E7932A7-B123-48EB-AB39-40867AF28105}.Release|x64.ActiveCfg = Release|x64 - {6E7932A7-B123-48EB-AB39-40867AF28105}.Release|x64.Build.0 = Release|x64 - {6E7932A7-B123-48EB-AB39-40867AF28105}.Release|x86.ActiveCfg = Release|Win32 - {6E7932A7-B123-48EB-AB39-40867AF28105}.Release|x86.Build.0 = Release|Win32 - {41F2DA74-9707-49A3-A466-157C7028BD79}.Debug|x64.ActiveCfg = Debug|x64 - {41F2DA74-9707-49A3-A466-157C7028BD79}.Debug|x64.Build.0 = Debug|x64 - {41F2DA74-9707-49A3-A466-157C7028BD79}.Debug|x86.ActiveCfg = Debug|Win32 - {41F2DA74-9707-49A3-A466-157C7028BD79}.Debug|x86.Build.0 = Debug|Win32 - {41F2DA74-9707-49A3-A466-157C7028BD79}.Release|x64.ActiveCfg = Release|x64 - {41F2DA74-9707-49A3-A466-157C7028BD79}.Release|x64.Build.0 = Release|x64 - {41F2DA74-9707-49A3-A466-157C7028BD79}.Release|x86.ActiveCfg = Release|Win32 - {41F2DA74-9707-49A3-A466-157C7028BD79}.Release|x86.Build.0 = Release|Win32 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/win32/vs2015/tcc.vcxproj b/win32/vs2015/tcc.vcxproj deleted file mode 100644 index 29543d7..0000000 --- a/win32/vs2015/tcc.vcxproj +++ /dev/null @@ -1,195 +0,0 @@ - - - - - Debug - Win32 - - - Release - Win32 - - - Debug - x64 - - - Release - x64 - - - - {6E7932A7-B123-48EB-AB39-40867AF28105} - Win32Proj - tcc - 8.1 - - - - Application - true - v140 - Unicode - - - Application - false - v140 - true - Unicode - - - Application - true - v140 - Unicode - - - Application - false - v140 - true - Unicode - - - - - - - - - - - - - - - - - - - - - true - $(ProjectDir);$(VC_IncludePath);$(WindowsSDK_IncludePath); - - - true - $(ProjectDir);$(VC_IncludePath);$(WindowsSDK_IncludePath); - - - false - $(ProjectDir);$(VC_IncludePath);$(WindowsSDK_IncludePath); - - - false - $(ProjectDir);$(VC_IncludePath);$(WindowsSDK_IncludePath); - - - - - - Level3 - Disabled - TCC_TARGET_PE;TCC_TARGET_I386;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - EditAndContinue - - - Console - true - Debug - libtcc.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) - - - copy $(TargetPath) $(SolutionDir).. - - - $(ProjectDir)PreBuild.bat - Generate config.h - - - - - - - Level3 - Disabled - TCC_TARGET_PE;TCC_TARGET_X86_64;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - EditAndContinue - - - Console - true - libtcc.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) - x64\Debug - - - copy $(TargetPath) $(SolutionDir).. - - - $(ProjectDir)PreBuild.bat - Generate config.h - - - - - Level3 - - - MaxSpeed - true - true - TCC_TARGET_PE;TCC_TARGET_I386;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - - - Console - true - true - true - Release - libtcc.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) - - - copy $(TargetPath) $(SolutionDir).. - - - $(ProjectDir)PreBuild.bat - Generate config.h - - - - - Level3 - - - MaxSpeed - true - true - TCC_TARGET_PE;TCC_TARGET_X86_64;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - - - Console - true - true - true - libtcc.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) - x64\Release - - - copy $(TargetPath) $(SolutionDir).. - - - $(ProjectDir)PreBuild.bat - Generate config.h - - - - - - - - - - - - \ No newline at end of file -- cgit v1.3.1