C-Chads/tinycc

Windows build issues

rontrek opened this issue · 2 comments

so running the build-tcc.bat under win32 produces the below error, but still builds and the version is still 0.9.27 (tcc -v).

Changelog says it should be 0.9.28?

fatal: Not a git repository (or any of the parent directories): .git
fatal: Not a git repository (or any of the parent directories): .git
Not a git repository
To compare two paths outside a working tree:
usage: git diff [--no-index] <path> <path>

C:\tcc\tinycc-mob\win32>echo #define TCC_VERSION "0.9.27" 1>..\config.h

C:\tcc\tinycc-mob\win32>echo #ifdef TCC_TARGET_X86_64 1>>..\config.h

C:\tcc\tinycc-mob\win32>echo #define TCC_LIBTCC1 "libtcc1-64.a" 1>>..\config.h

C:\tcc\tinycc-mob\win32>echo #else 1>>..\config.h

C:\tcc\tinycc-mob\win32>echo #define TCC_LIBTCC1 "libtcc1-32.a" 1>>..\config.h

C:\tcc\tinycc-mob\win32>echo #endif 1>>..\config.h

This is a problem from upstream. I actually compiled tinycc for my system using msys2 and it works... it just reports incorrect version numbers.
yeah I don't know why it does that

as for the git error, let me rebuild on msys2 really quick and see if it happens to me

gordo@devbox MINGW64 ~
# cd tinycc

gordo@devbox MINGW64 ~/tinycc
# ./configure && make && make install
Binary directory    C:/Program Files/tcc
TinyCC directory    C:/Program Files/tcc
Library directory   C:/Program Files/tcc/libtcc
Doc directory       C:/Program Files/tcc/doc
Source path         .
C compiler          gcc (12.2)
Target OS           WIN32
CPU                 x86_64
Config              WIN32
Creating config.mak and config.h
gcc -o tcc.o -c tcc.c -DTCC_TARGET_X86_64 -DTCC_TARGET_PE         -DONE_SOURCE=0 -DTCC_GITHASH="\"mob:560526a 2023-01-01T16:39:14+01:00\""  -Wall -O2 -Wdeclaration-after-statement -fno-strict-aliasing -Wno-pointer-sign -Wno-sign-compare -Wno-unused-result -Wno-format-truncation -Wno-stringop-truncation -I.
gcc -o libtcc.o -c libtcc.c -DTCC_TARGET_X86_64 -DTCC_TARGET_PE         -DLIBTCC_AS_DLL -DONE_SOURCE=0 -Wall -O2 -Wdeclaration-after-statement -fno-strict-aliasing -Wno-pointer-sign -Wno-sign-compare -Wno-unused-result -Wno-format-truncation -Wno-stringop-truncation -I.
gcc -DC2STR conftest.c -o c2str.exe && ./c2str.exe include/tccdefs.h tccdefs_.h
gcc -o tccpp.o -c tccpp.c -DTCC_TARGET_X86_64 -DTCC_TARGET_PE         -DLIBTCC_AS_DLL -DONE_SOURCE=0 -Wall -O2 -Wdeclaration-after-statement -fno-strict-aliasing -Wno-pointer-sign -Wno-sign-compare -Wno-unused-result -Wno-format-truncation -Wno-stringop-truncation -I.
gcc -o tccgen.o -c tccgen.c -DTCC_TARGET_X86_64 -DTCC_TARGET_PE         -DLIBTCC_AS_DLL -DONE_SOURCE=0 -Wall -O2 -Wdeclaration-after-statement -fno-strict-aliasing -Wno-pointer-sign -Wno-sign-compare -Wno-unused-result -Wno-format-truncation -Wno-stringop-truncation -I.
gcc -o tccdbg.o -c tccdbg.c -DTCC_TARGET_X86_64 -DTCC_TARGET_PE         -DLIBTCC_AS_DLL -DONE_SOURCE=0 -Wall -O2 -Wdeclaration-after-statement -fno-strict-aliasing -Wno-pointer-sign -Wno-sign-compare -Wno-unused-result -Wno-format-truncation -Wno-stringop-truncation -I.
gcc -o tccelf.o -c tccelf.c -DTCC_TARGET_X86_64 -DTCC_TARGET_PE         -DLIBTCC_AS_DLL -DONE_SOURCE=0 -Wall -O2 -Wdeclaration-after-statement -fno-strict-aliasing -Wno-pointer-sign -Wno-sign-compare -Wno-unused-result -Wno-format-truncation -Wno-stringop-truncation -I.
gcc -o tccasm.o -c tccasm.c -DTCC_TARGET_X86_64 -DTCC_TARGET_PE         -DLIBTCC_AS_DLL -DONE_SOURCE=0 -Wall -O2 -Wdeclaration-after-statement -fno-strict-aliasing -Wno-pointer-sign -Wno-sign-compare -Wno-unused-result -Wno-format-truncation -Wno-stringop-truncation -I.
gcc -o tccrun.o -c tccrun.c -DTCC_TARGET_X86_64 -DTCC_TARGET_PE         -DLIBTCC_AS_DLL -DONE_SOURCE=0 -Wall -O2 -Wdeclaration-after-statement -fno-strict-aliasing -Wno-pointer-sign -Wno-sign-compare -Wno-unused-result -Wno-format-truncation -Wno-stringop-truncation -I.
gcc -o x86_64-gen.o -c x86_64-gen.c -DTCC_TARGET_X86_64 -DTCC_TARGET_PE         -DLIBTCC_AS_DLL -DONE_SOURCE=0 -Wall -O2 -Wdeclaration-after-statement -fno-strict-aliasing -Wno-pointer-sign -Wno-sign-compare -Wno-unused-result -Wno-format-truncation -Wno-stringop-truncation -I.
gcc -o x86_64-link.o -c x86_64-link.c -DTCC_TARGET_X86_64 -DTCC_TARGET_PE         -DLIBTCC_AS_DLL -DONE_SOURCE=0 -Wall -O2 -Wdeclaration-after-statement -fno-strict-aliasing -Wno-pointer-sign -Wno-sign-compare -Wno-unused-result -Wno-format-truncation -Wno-stringop-truncation -I.
gcc -o i386-asm.o -c i386-asm.c -DTCC_TARGET_X86_64 -DTCC_TARGET_PE         -DLIBTCC_AS_DLL -DONE_SOURCE=0 -Wall -O2 -Wdeclaration-after-statement -fno-strict-aliasing -Wno-pointer-sign -Wno-sign-compare -Wno-unused-result -Wno-format-truncation -Wno-stringop-truncation -I.
gcc -o tccpe.o -c tccpe.c -DTCC_TARGET_X86_64 -DTCC_TARGET_PE         -DLIBTCC_AS_DLL -DONE_SOURCE=0 -Wall -O2 -Wdeclaration-after-statement -fno-strict-aliasing -Wno-pointer-sign -Wno-sign-compare -Wno-unused-result -Wno-format-truncation -Wno-stringop-truncation -I.
gcc -shared -o libtcc.dll libtcc.o tccpp.o tccgen.o tccdbg.o tccelf.o tccasm.o tccrun.o x86_64-gen.o x86_64-link.o i386-asm.o tccpe.o -static -s
gcc -o tcc.exe tcc.o libtcc.dll  -static -s
./tcc.exe -impdef libtcc.dll -o libtcc.def
make[1]: Entering directory '/home/gordo/tinycc/lib'
../tcc.exe -c libtcc1.c -o libtcc1.o -B../win32 -I../include -I..
../tcc.exe -c alloca.S -o alloca.o -B../win32 -I../include -I..
../tcc.exe -c alloca-bt.S -o alloca-bt.o -B../win32 -I../include -I..
../tcc.exe -c stdatomic.c -o stdatomic.o -B../win32 -I../include -I..
../tcc.exe -c atomic.S -o atomic.o -B../win32 -I../include -I..
../tcc.exe -c builtin.c -o builtin.o -B../win32 -I../include -I..
../tcc.exe -c tcov.c -o tcov.o -B../win32 -I../include -I..
../tcc.exe -c ../win32/lib/chkstk.S -o chkstk.o -B../win32 -I../include -I..
../tcc.exe -c ../win32/lib/crt1.c -o crt1.o -B../win32 -I../include -I..
../tcc.exe -c ../win32/lib/crt1w.c -o crt1w.o -B../win32 -I../include -I..
../tcc.exe -c ../win32/lib/wincrt1.c -o wincrt1.o -B../win32 -I../include -I..
../tcc.exe -c ../win32/lib/wincrt1w.c -o wincrt1w.o -B../win32 -I../include -I..
../tcc.exe -c ../win32/lib/dllcrt1.c -o dllcrt1.o -B../win32 -I../include -I..
../tcc.exe -c ../win32/lib/dllmain.c -o dllmain.o -B../win32 -I../include -I..
../tcc.exe -ar rcs ../libtcc1.a libtcc1.o alloca.o alloca-bt.o stdatomic.o atomic.o builtin.o tcov.o chkstk.o crt1.o crt1w.o wincrt1.o wincrt1w.o dllcrt1.o dllmain.o
../tcc.exe -c bt-exe.c -o ../bt-exe.o -B../win32 -I../include -I..
../tcc.exe -c bt-log.c -o ../bt-log.o -B../win32 -I../include -I..
../tcc.exe -c bcheck.c -o ../bcheck.o -B../win32 -I../include -I.. -g
../tcc.exe -c bt-dll.c -o ../bt-dll.o -B../win32 -I../include -I..
make[1]: Leaving directory '/home/gordo/tinycc/lib'
perl ./texi2pod.pl tcc-doc.texi tcc-doc.pod
pod2man --section=1 --center="Tiny C Compiler" --release="0.9.27" tcc-doc.pod >tcc.1 && rm -f tcc-doc.pod
which: no makeinfo in (/mingw64/bin:/usr/local/bin:/usr/bin:/bin:/c/Windows/System32:/c/Windows:/c/Windows/System32/Wbem:/c/Windows/System32/WindowsPowerShell/v1.0/:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl)
which: no makeinfo in (/mingw64/bin:/usr/local/bin:/usr/bin:/bin:/c/Windows/System32:/c/Windows:/c/Windows/System32/Wbem:/c/Windows/System32/WindowsPowerShell/v1.0/:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl)
-> "C:/Program Files/tcc" : tcc.exe libtcc.dll
-> "C:/Program Files/tcc/lib" : ./win32/lib/*.def
-> "C:/Program Files/tcc/lib" : libtcc1.a bcheck.o bt-exe.o bt-log.o bt-dll.o
-> "C:/Program Files/tcc/include" : ./include/*.h ./tcclib.h
-> "C:/Program Files/tcc/include" : ./win32/include
-> "C:/Program Files/tcc/examples" : ./win32/examples
-> "C:/Program Files/tcc/examples" : ./tests/libtcc_test.c
-> "C:/Program Files/tcc/libtcc" : ./libtcc.h libtcc.def
-> "C:/Program Files/tcc/doc" : ./win32/tcc-win32.txt

gordo@devbox MINGW64 ~/tinycc
# C:/Program\ Files/tcc/tcc
Tiny C Compiler 0.9.27 - Copyright (C) 2001-2006 Fabrice Bellard
Usage: tcc [options...] [-o outfile] [-c] infile(s)...
       tcc [options...] -run infile [arguments...]
General options:
  -c           compile only - generate an object file
  -o outfile   set output filename
  -run         run compiled source
  -fflag       set or reset (with 'no-' prefix) 'flag' (see tcc -hh)
  -std=c99     Conform to the ISO 1999 C standard (default).
  -std=c11     Conform to the ISO 2011 C standard.
  -Wwarning    set or reset (with 'no-' prefix) 'warning' (see tcc -hh)
  -w           disable all warnings
  -v --version show version
  -vv          show search paths or loaded files
  -h -hh       show this, show more help
  -bench       show compilation statistics
  -            use stdin pipe as infile
  @listfile    read arguments from listfile
Preprocessor options:
  -Idir        add include path 'dir'
  -Dsym[=val]  define 'sym' with value 'val'
  -Usym        undefine 'sym'
  -E           preprocess only
  -C           keep comments (not yet implemented)
Linker options:
  -Ldir        add library path 'dir'
  -llib        link with dynamic or static library 'lib'
  -r           generate (relocatable) object file
  -shared      generate a shared library/dll
  -rdynamic    export all global symbols to dynamic linker
  -soname      set name for shared library to be used at runtime
  -Wl,-opt[=val]  set linker option (see tcc -hh)
Debugger options:
  -g           generate stab runtime debug info
  -gdwarf[-x]  generate dwarf runtime debug info
  -b           compile with built-in memory and bounds checker (implies -g)
  -bt[N]       link with backtrace (stack dump) support [show max N callers]
Misc. options:
  -x[c|a|b|n]  specify type of the next infile (C,ASM,BIN,NONE)
  -nostdinc    do not use standard system include paths
  -nostdlib    do not link with standard crt and libraries
  -Bdir        set tcc's private include/library dir
  -M[M]D       generate make dependency file [ignore system files]
  -M[M]        as above but no other output
  -MF file     specify dependency file name
  -m32/64      defer to i386/x86_64 cross compiler
Tools:
  create library  : tcc -ar [crstvx] lib [files]
  create def file : tcc -impdef lib.dll [-v] [-o lib.def]

gordo@devbox MINGW64 ~/tinycc
# cd ..

gordo@devbox MINGW64 ~
# ls
Mom_Timer  Mom_Timer.zip  SDL2_Base  Simple_ISA  tinycc  tinygl

gordo@devbox MINGW64 ~
# npp test.c

gordo@devbox MINGW64 ~
# C:/Program\ Files/tcc/tcc -run test.c
hello!

gordo@devbox MINGW64 ~
# cat test.c
#include <stdio.h>

main(){puts("hello!");}
gordo@devbox MINGW64 ~
#

How are you compiling tinycc?

I'm using tdm-gcc, but I have git installed as well.

Are you using bloodshed? Very oldskool if true.
I would recommend using Msys2 if possible, though. You get a reasonably good posix environment out of it.
I'm guessing your installation of git is... nonstandard.

Are you using bloodshed? Very oldskool if true.

just to build tools. https://jmeubank.github.io/tdm-gcc/

I would recommend using Msys2 if possible, though. You get a reasonably good posix environment out of it.

I used to before.. is there a lighter version?

I'm guessing your installation of git is... nonstandard.

portable git. (not the portableapps)