<feed xmlns='http://www.w3.org/2005/Atom'>
<title>tinycc/tests/pp, 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>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>tccpp: allow "#define X defined Y ..."</title>
<updated>2017-07-09T09:46:14+00:00</updated>
<author>
<name>grischka</name>
<email>grischka</email>
</author>
<published>2017-06-05T11:21:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.datenwolf.net/tinycc/commit/?id=6c468c10f70d74e962591a0584765e42ce1bcaf2'/>
<id>6c468c10f70d74e962591a0584765e42ce1bcaf2</id>
<content type='text'>
That means: we do not macro-expand the argument of 'defined'

Also: store the last token position into the TokenString
structure in order to get rid of the tok_last function.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
That means: we do not macro-expand the argument of 'defined'

Also: store the last token position into the TokenString
structure in order to get rid of the tok_last function.
</pre>
</div>
</content>
</entry>
<entry>
<title>tccpp: Implement __COUNTER__</title>
<updated>2017-07-09T03:30:47+00:00</updated>
<author>
<name>Michael Matz</name>
<email>matz@suse.de</email>
</author>
<published>2017-07-09T03:30:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.datenwolf.net/tinycc/commit/?id=824dcebe59f52a686b003214c1af0633cf5fe89e'/>
<id>824dcebe59f52a686b003214c1af0633cf5fe89e</id>
<content type='text'>
This requires one more change in how macro arguments are expanded:
the standard requires that macro args are expanded before substituting
into the replacement list.  This implies expanding them only once
even when they occur multiple times in the list.  TCC expanded
them repeatedly in that case.  Without __COUNTER__ that's harmless.

So, simply always expand arguments (when used without # and ##) once
and store the resulting tokens.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This requires one more change in how macro arguments are expanded:
the standard requires that macro args are expanded before substituting
into the replacement list.  This implies expanding them only once
even when they occur multiple times in the list.  TCC expanded
them repeatedly in that case.  Without __COUNTER__ that's harmless.

So, simply always expand arguments (when used without # and ##) once
and store the resulting tokens.
</pre>
</div>
</content>
</entry>
<entry>
<title>tccpp: Fix corner case</title>
<updated>2017-07-09T02:38:56+00:00</updated>
<author>
<name>Michael Matz</name>
<email>matz@suse.de</email>
</author>
<published>2017-07-09T02:30:36+00:00</published>
<link rel='alternate' type='text/html' href='https://git.datenwolf.net/tinycc/commit/?id=d8fdd380f39aa413886c61c2e3624ba3b4582dc0'/>
<id>d8fdd380f39aa413886c61c2e3624ba3b4582dc0</id>
<content type='text'>
See added testcase 19.c from a bug report.  The problem is reading outside
the arguments buffers, even though we aren't allowed to.  The single
can_read_stream variable is not enough, sometimes we need to be able
to pop into outer contexts but not into arbitrarily outside contexts.

The trick is to terminate argument tokens with a EOF (and not just with
0 that makes us pop contexts), and deal with that in the few places
we have to,

This enables some cleanups of the can_read_stream variable use.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
See added testcase 19.c from a bug report.  The problem is reading outside
the arguments buffers, even though we aren't allowed to.  The single
can_read_stream variable is not enough, sometimes we need to be able
to pop into outer contexts but not into arbitrarily outside contexts.

The trick is to terminate argument tokens with a EOF (and not just with
0 that makes us pop contexts), and deal with that in the few places
we have to,

This enables some cleanups of the can_read_stream variable use.
</pre>
</div>
</content>
</entry>
<entry>
<title>tccpp: Fix corner case of fnlike macro invocation</title>
<updated>2017-04-15T17:34:55+00:00</updated>
<author>
<name>Michael Matz</name>
<email>matz@suse.de</email>
</author>
<published>2017-04-15T17:24:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.datenwolf.net/tinycc/commit/?id=328b826e8a43ed39f9eebb8493cc6abea2ddac1c'/>
<id>328b826e8a43ed39f9eebb8493cc6abea2ddac1c</id>
<content type='text'>
Arg substitution leaves placeholder marker in the stream for
empty arguments.  Those need to be skipped when searching for
a fnlike macro invocation in the replacement list itself.  See
testcase.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Arg substitution leaves placeholder marker in the stream for
empty arguments.  Those need to be skipped when searching for
a fnlike macro invocation in the replacement list itself.  See
testcase.
</pre>
</div>
</content>
</entry>
<entry>
<title>makefile: unify cross with native builds</title>
<updated>2017-02-25T11:51:04+00:00</updated>
<author>
<name>grischka</name>
<email>grischka</email>
</author>
<published>2017-02-25T11:49:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.datenwolf.net/tinycc/commit/?id=bb93064d7857d887b674999c9b4152b44a628f9a'/>
<id>bb93064d7857d887b674999c9b4152b44a628f9a</id>
<content type='text'>
supports building cross compilers on the fly without need
for configure --enable-cross

   $ make cross          # all compilers
   $ make cross-TARGET   # only TARGET-compiler &amp; 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
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
supports building cross compilers on the fly without need
for configure --enable-cross

   $ make cross          # all compilers
   $ make cross-TARGET   # only TARGET-compiler &amp; 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
</pre>
</div>
</content>
</entry>
<entry>
<title>update VERSION to 0.9.27</title>
<updated>2017-02-08T18:56:15+00:00</updated>
<author>
<name>grischka</name>
<email>grischka</email>
</author>
<published>2017-02-08T18:56:15+00:00</published>
<link rel='alternate' type='text/html' href='https://git.datenwolf.net/tinycc/commit/?id=5efa75d9b87e88287cf3c56db706f5a32a384072'/>
<id>5efa75d9b87e88287cf3c56db706f5a32a384072</id>
<content type='text'>
Also:
- in tests: generate .expect files only if not yet present,
  because
  1) some files were adjusted manually
  2) switching git branche might change timestamps and
     cause unwanted update
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Also:
- in tests: generate .expect files only if not yet present,
  because
  1) some files were adjusted manually
  2) switching git branche might change timestamps and
     cause unwanted update
</pre>
</div>
</content>
</entry>
<entry>
<title>tests: don't assume $(CC) is gcc</title>
<updated>2016-12-24T18:59:10+00:00</updated>
<author>
<name>Avi Halachmi (:avih)</name>
<email>avihpit@yahoo.com</email>
</author>
<published>2016-12-24T18:59:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.datenwolf.net/tinycc/commit/?id=9b3e4c5895692eaa62ab2dbc14ecc3883980d997'/>
<id>9b3e4c5895692eaa62ab2dbc14ecc3883980d997</id>
<content type='text'>
This also allows self hosting + testing when $(CC) is tcc.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This also allows self hosting + testing when $(CC) is tcc.
</pre>
</div>
</content>
</entry>
<entry>
<title>tests: OOT build fixes etc.</title>
<updated>2016-12-20T17:05:33+00:00</updated>
<author>
<name>grischka</name>
<email>grischka</email>
</author>
<published>2016-12-20T17:05:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.datenwolf.net/tinycc/commit/?id=71c5ce5ced24a5bbd87d7b5415409af340706b1f'/>
<id>71c5ce5ced24a5bbd87d7b5415409af340706b1f</id>
<content type='text'>
tests/Makefile: fix out-of-tree build issues

Also:

- win64: align(16) MEM_DEBUG user memory
  on win64 the struct jmp_buf in the TCCState structure which we
  allocate by tcc_malloc needs alignment 16 because the msvcrt
  setjmp uses MMX instructions.

- libtcc_test.c: win32/64 need __attribute__((dllimport)) for
  extern data objects

- tcctest.c: exclude stuff that gcc does not compile
  except for relocation_test() the other issues are mostly ASM
  related.  We should probably check GCC versions but I have
  no idea which mingw/gcc versions support what and which don't.

- lib/Makefile: use tcc to compile libtcc1.a (except on arm
  which needs arm-asm
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
tests/Makefile: fix out-of-tree build issues

Also:

- win64: align(16) MEM_DEBUG user memory
  on win64 the struct jmp_buf in the TCCState structure which we
  allocate by tcc_malloc needs alignment 16 because the msvcrt
  setjmp uses MMX instructions.

- libtcc_test.c: win32/64 need __attribute__((dllimport)) for
  extern data objects

- tcctest.c: exclude stuff that gcc does not compile
  except for relocation_test() the other issues are mostly ASM
  related.  We should probably check GCC versions but I have
  no idea which mingw/gcc versions support what and which don't.

- lib/Makefile: use tcc to compile libtcc1.a (except on arm
  which needs arm-asm
</pre>
</div>
</content>
</entry>
</feed>
