<feed xmlns='http://www.w3.org/2005/Atom'>
<title>tinycc/tccgen.c, branch main</title>
<subtitle>Tiny C Compiler by Fabrice Bellard Git mirror of the final release by Bellard, discarding all changes after. The repository at https://repo.or.cz/tinycc.git has become untrustworthy. Also the tcc sources have become tainted with AI slop.
</subtitle>
<link rel='alternate' type='text/html' href='https://git.datenwolf.net/tinycc/'/>
<entry>
<title>final update for 0.9.27</title>
<updated>2017-12-12T16:57:20+00:00</updated>
<author>
<name>grischka</name>
<email>grischka</email>
</author>
<published>2017-12-12T16:57:20+00:00</published>
<link rel='alternate' type='text/html' href='https://git.datenwolf.net/tinycc/commit/?id=d348a9a51d32cece842b7885d27a411436d7887b'/>
<id>d348a9a51d32cece842b7885d27a411436d7887b</id>
<content type='text'>
tccgen.c:
- 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.c:
- 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)

Makefile:
- suppress some warnings when makeinfo is missing
- call 'which install' only on win32

tests/Makefile:
- 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)

other:
- #define SECTION_ABS removed
- ST_DATA Section *strtab_section: removed
- put_extern_sym2(): take int section number

Conflicts:
	tccelf.c
	tccpe.c

Conflicts:
	tccelf.c
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
tccgen.c:
- 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.c:
- 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)

Makefile:
- suppress some warnings when makeinfo is missing
- call 'which install' only on win32

tests/Makefile:
- 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)

other:
- #define SECTION_ABS removed
- ST_DATA Section *strtab_section: removed
- put_extern_sym2(): take int section number

Conflicts:
	tccelf.c
	tccpe.c

Conflicts:
	tccelf.c
</pre>
</div>
</content>
</entry>
<entry>
<title>tccgen_begin/end_file</title>
<updated>2017-12-12T16:33:37+00:00</updated>
<author>
<name>grischka</name>
<email>grischka</email>
</author>
<published>2017-12-12T16:33:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.datenwolf.net/tinycc/commit/?id=1a4d4b76e803a32db1168e66ad8f8b26c29c8ea0'/>
<id>1a4d4b76e803a32db1168e66ad8f8b26c29c8ea0</id>
<content type='text'>
This is supposed to make compilation and linking with
multiple source files (tcc f1.c f2.S ...) behave just
the same as linking object files.

tccgen.c:put_extern_sym2():
- use put_elf_sym to enter new symbols unconditionally

tccelf.c:
- save section state before compilation
- disable symbol hashing during compilation
- merge symbols and update relocations after compilation

tccpe.c:
- re-create s1-&gt;uw_sym for each compilation (because it
  may change)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This is supposed to make compilation and linking with
multiple source files (tcc f1.c f2.S ...) behave just
the same as linking object files.

tccgen.c:put_extern_sym2():
- use put_elf_sym to enter new symbols unconditionally

tccelf.c:
- save section state before compilation
- disable symbol hashing during compilation
- merge symbols and update relocations after compilation

tccpe.c:
- re-create s1-&gt;uw_sym for each compilation (because it
  may change)
</pre>
</div>
</content>
</entry>
<entry>
<title>tccgen: unify type redefinition checks</title>
<updated>2017-12-05T01:06:26+00:00</updated>
<author>
<name>grischka</name>
<email>grischka</email>
</author>
<published>2017-12-03T19:43:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.datenwolf.net/tinycc/commit/?id=3ae1a2af1c10f9b64631d8e18d948498e14b283d'/>
<id>3ae1a2af1c10f9b64631d8e18d948498e14b283d</id>
<content type='text'>
tccgen.c:
- improved function patch_storage() and added new function
  patch_type() for more consistent type redefinition and
  instance redefinition checks.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
tccgen.c:
- improved function patch_storage() and added new function
  patch_type() for more consistent type redefinition and
  instance redefinition checks.
</pre>
</div>
</content>
</entry>
<entry>
<title>tccasm: use global(_symbol)_stack</title>
<updated>2017-12-05T00:54:49+00:00</updated>
<author>
<name>grischka</name>
<email>grischka</email>
</author>
<published>2017-11-30T14:15:22+00:00</published>
<link rel='alternate' type='text/html' href='https://git.datenwolf.net/tinycc/commit/?id=877e164d6ade4167f9d7f6994ece8e06b5d67060'/>
<id>877e164d6ade4167f9d7f6994ece8e06b5d67060</id>
<content type='text'>
* removed asm_label stack
* removed asm_free_labels() post-processing
* using "impossible C type" for asm labels (VT_ASM)
* tccgen.c:update_storage(): use it to refresh symbol attributes
* tccelf.c:find_elf_sym(): ignore STB_LOCAL symbols
* tccgen.c:unary(): asm symbols are supposed to be undeclared in C
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* removed asm_label stack
* removed asm_free_labels() post-processing
* using "impossible C type" for asm labels (VT_ASM)
* tccgen.c:update_storage(): use it to refresh symbol attributes
* tccelf.c:find_elf_sym(): ignore STB_LOCAL symbols
* tccgen.c:unary(): asm symbols are supposed to be undeclared in C
</pre>
</div>
</content>
</entry>
<entry>
<title>tccasm: Unify C and asm symbol table</title>
<updated>2017-11-27T03:59:29+00:00</updated>
<author>
<name>Michael Matz</name>
<email>matz@suse.de</email>
</author>
<published>2017-11-27T03:03:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.datenwolf.net/tinycc/commit/?id=9e0d23cc47359149a39eafffdbb133963980b6ed'/>
<id>9e0d23cc47359149a39eafffdbb133963980b6ed</id>
<content type='text'>
This makes the asm symbols use the same members as the C symbols
for global decls, e.g. using the ELF symbol to hold offset and
section.  That allows us to use only one symbol table for C and
asm symbols and to get rid of hacks to synch between them.

We still need some special handling for symbols that come purely
from asm sources.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This makes the asm symbols use the same members as the C symbols
for global decls, e.g. using the ELF symbol to hold offset and
section.  That allows us to use only one symbol table for C and
asm symbols and to get rid of hacks to synch between them.

We still need some special handling for symbols that come purely
from asm sources.
</pre>
</div>
</content>
</entry>
<entry>
<title>tccasm: synch C and asm symtab tighter</title>
<updated>2017-11-22T16:57:43+00:00</updated>
<author>
<name>Michael Matz</name>
<email>matz@suse.de</email>
</author>
<published>2017-11-22T16:57:43+00:00</published>
<link rel='alternate' type='text/html' href='https://git.datenwolf.net/tinycc/commit/?id=e7c71e24730ae07241980812c8b747963f216260'/>
<id>e7c71e24730ae07241980812c8b747963f216260</id>
<content type='text'>
See testcase.  The C and asm symtab are still separate,
but integrated tighter: the asm labels are only synched at file
end, not after each asm snippet (this fixes references from one
to another asm block), the C and asm syms are synched both ways,
so defining things in asm and refering from C, or the other way
around works.  In effect this model reflects what happens with
GCC better.

For this the asm labels aren't using the C label namespace anymore,
but their own, which increases the size of each TokenSym by a pointer.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
See testcase.  The C and asm symtab are still separate,
but integrated tighter: the asm labels are only synched at file
end, not after each asm snippet (this fixes references from one
to another asm block), the C and asm syms are synched both ways,
so defining things in asm and refering from C, or the other way
around works.  In effect this model reflects what happens with
GCC better.

For this the asm labels aren't using the C label namespace anymore,
but their own, which increases the size of each TokenSym by a pointer.
</pre>
</div>
</content>
</entry>
<entry>
<title>various stuff</title>
<updated>2017-10-11T16:13:43+00:00</updated>
<author>
<name>grischka</name>
<email>grischka</email>
</author>
<published>2017-10-11T16:13:43+00:00</published>
<link rel='alternate' type='text/html' href='https://git.datenwolf.net/tinycc/commit/?id=da8c62f75d893449e232944fc62566c020b4d010'/>
<id>da8c62f75d893449e232944fc62566c020b4d010</id>
<content type='text'>
win32/Makefile ("for cygwin") removed
- On cygwin, the normal ./configure &amp;&amp; make can be used with either
  cygwin's "GCC for Win32 Toolchain"
      ./configure --cross-prefix=i686-w64-mingw32-
  or with an existing tcc:
      ./configure --cc=&lt;old-tccdir&gt;/tcc.exe

tcctest.c:
- exclude test_high_clobbers() on _WIN64 (does not work)

tests2/95_bitfield.c:
- use 'signed char' for ARM (where default 'char' is unsigned)

tests:
- remove -I "expr" diff option to allow tests with
  busybox-diff.

libtcc.c, tcc.c:
- removed -iwithprefix option.  It is supposed to be
  combined with -iprefix which we don't have either.

tccgen.c:
- fix assignments and return of 'void', as in
     void f() {
         void *p, *q;
         *p = *q:
         return *p;
     }
  This appears to be allowed but should do nothing.

tcc.h, libtcc.c, tccpp.c:
- Revert "Introduce VIP sysinclude paths which are always searched first"
  This reverts commit 1d5e386b0a78393ac6b670c209a185849ec798a1.

  The patch was giving tcc's system includes priority over -I which
  is not how it should be.

tccelf.c:
- add DT_TEXTREL tag only if text relocations are actually
  used (which is likely not the case on x86_64)
- prepare_dynamic_rel(): avoid relocation of unresolved
  (weak) symbols

tccrun.c:
- for HAVE_SELINUX, use two mappings to the same (real) file.
  (it was so once except the RX mapping wasn't used at all).

tccpe.c:
- fix relocation constant used for x86_64 (by Andrei E. Warentin)
- #ifndef _WIN32 do "chmod 755 ..." to get runnable exes on cygwin.

tccasm.c:
- keep forward asm labels static, otherwise they will endup
  in dynsym eventually.

configure, Makefile:
- mingw32: respect ./configure options --bindir --docdir --libdir
- allow overriding tcc when building libtcc1.a and libtcc.def with
      make XTCC=&lt;tcc program to use&gt;
- use $(wildcard ...) for install to allow installing just
  a cross compiler for example
      make cross-arm
      make install
- use name &lt;target&gt;-libtcc1.a

build-tcc.bat:
- add  options: -clean, -b bindir
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
win32/Makefile ("for cygwin") removed
- On cygwin, the normal ./configure &amp;&amp; make can be used with either
  cygwin's "GCC for Win32 Toolchain"
      ./configure --cross-prefix=i686-w64-mingw32-
  or with an existing tcc:
      ./configure --cc=&lt;old-tccdir&gt;/tcc.exe

tcctest.c:
- exclude test_high_clobbers() on _WIN64 (does not work)

tests2/95_bitfield.c:
- use 'signed char' for ARM (where default 'char' is unsigned)

tests:
- remove -I "expr" diff option to allow tests with
  busybox-diff.

libtcc.c, tcc.c:
- removed -iwithprefix option.  It is supposed to be
  combined with -iprefix which we don't have either.

tccgen.c:
- fix assignments and return of 'void', as in
     void f() {
         void *p, *q;
         *p = *q:
         return *p;
     }
  This appears to be allowed but should do nothing.

tcc.h, libtcc.c, tccpp.c:
- Revert "Introduce VIP sysinclude paths which are always searched first"
  This reverts commit 1d5e386b0a78393ac6b670c209a185849ec798a1.

  The patch was giving tcc's system includes priority over -I which
  is not how it should be.

tccelf.c:
- add DT_TEXTREL tag only if text relocations are actually
  used (which is likely not the case on x86_64)
- prepare_dynamic_rel(): avoid relocation of unresolved
  (weak) symbols

tccrun.c:
- for HAVE_SELINUX, use two mappings to the same (real) file.
  (it was so once except the RX mapping wasn't used at all).

tccpe.c:
- fix relocation constant used for x86_64 (by Andrei E. Warentin)
- #ifndef _WIN32 do "chmod 755 ..." to get runnable exes on cygwin.

tccasm.c:
- keep forward asm labels static, otherwise they will endup
  in dynsym eventually.

configure, Makefile:
- mingw32: respect ./configure options --bindir --docdir --libdir
- allow overriding tcc when building libtcc1.a and libtcc.def with
      make XTCC=&lt;tcc program to use&gt;
- use $(wildcard ...) for install to allow installing just
  a cross compiler for example
      make cross-arm
      make install
- use name &lt;target&gt;-libtcc1.a

build-tcc.bat:
- add  options: -clean, -b bindir
</pre>
</div>
</content>
</entry>
<entry>
<title>Spelling fixes</title>
<updated>2017-09-25T01:03:26+00:00</updated>
<author>
<name>Larry Doolittle</name>
<email>ldoolitt@recycle.lbl.gov</email>
</author>
<published>2017-09-25T01:03:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.datenwolf.net/tinycc/commit/?id=1b6806e5bb39623c75b4aa8d8d6ffe1ef7ea46e7'/>
<id>1b6806e5bb39623c75b4aa8d8d6ffe1ef7ea46e7</id>
<content type='text'>
Comments only, no change to functionality
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Comments only, no change to functionality
</pre>
</div>
</content>
</entry>
<entry>
<title>'long' review</title>
<updated>2017-09-24T16:57:48+00:00</updated>
<author>
<name>grischka</name>
<email>grischka</email>
</author>
<published>2017-09-24T16:57:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.datenwolf.net/tinycc/commit/?id=1443039416dd02750765efde1af35e31c8d41be3'/>
<id>1443039416dd02750765efde1af35e31c8d41be3</id>
<content type='text'>
add some features for more complete 'long' support

tcc.h:
- use LONG_SIZE=4/8 instead of TCC_LONG_ARE_64_BIT
tccgen.c:
- add ptrdiff_type, update size_type
- support shift and ?: operations
- support long enum types
- display 'long' from type_to_str
- nwchar_t is unsigned short on windows
- unrelated: use memcpy in init_putv for long doubles to avoid
  random bytes in the image (if tcc was compiled by gcc) for
  diff purposes.
tccpp.c:
- make parse_number return correct types
- improve multi-character-constants 'XX' 'abcd'
Changelog:
- update
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
add some features for more complete 'long' support

tcc.h:
- use LONG_SIZE=4/8 instead of TCC_LONG_ARE_64_BIT
tccgen.c:
- add ptrdiff_type, update size_type
- support shift and ?: operations
- support long enum types
- display 'long' from type_to_str
- nwchar_t is unsigned short on windows
- unrelated: use memcpy in init_putv for long doubles to avoid
  random bytes in the image (if tcc was compiled by gcc) for
  diff purposes.
tccpp.c:
- make parse_number return correct types
- improve multi-character-constants 'XX' 'abcd'
Changelog:
- update
</pre>
</div>
</content>
</entry>
<entry>
<title>Revert "simplify VT_LONG parsing"</title>
<updated>2017-07-25T20:04:24+00:00</updated>
<author>
<name>matthias</name>
<email>uso.cosmo.ray@gmail.com</email>
</author>
<published>2017-07-25T20:04:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.datenwolf.net/tinycc/commit/?id=c18fc950d721f5f734116cebba729fc8f7759964'/>
<id>c18fc950d721f5f734116cebba729fc8f7759964</id>
<content type='text'>
Too simple long parsion.
Take me a long long long time to see my mistake,
Sorry

(long long long wasn't see as an error)
This reverts commit a4cd2805f95e1369254762478883e91050f2cba1.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Too simple long parsion.
Take me a long long long time to see my mistake,
Sorry

(long long long wasn't see as an error)
This reverts commit a4cd2805f95e1369254762478883e91050f2cba1.
</pre>
</div>
</content>
</entry>
</feed>
