Christian JULLIEN | 26 Mar 10:56 2015
Picon

RE :Re: Last commit [26-03-2015] breaks RPi build - conflicting types for 'section_ptr_add'

You'd better thanks my cron job that, every hours, checks tinycc changes and sends me email :o)

The latest runs tells me it is (as I am) happy with your fix.

Christian

----- message d'origine -----
De : "Sergey Korshunoff" <seyko2 <at> gmail.com>
date jeu. 26/03/2015 09:34 (GMT +01:00)
À : "tinycc-devel-qX2TKyscuCcdnm+yROfE0A@public.gmane.org" <tinycc-devel-qX2TKyscuCcdnm+yROfE0A@public.gmane.org>
Objet : Re: [Tinycc-devel] Last commit [26-03-2015] breaks RPi build - conflicting types for 'section_ptr_add'

Hi! Thanks for checking. A fix is commited. Please test it.

_______________________________________________
Tinycc-devel mailing list
Tinycc-devel-qX2TKyscuCcdnm+yROfE0A@public.gmane.org
https://lists.nongnu.org/mailman/listinfo/tinycc-devel
<div>
<p>You'd better thanks my cron job that, every hours, checks tinycc changes and sends me email :o)<br><br>The latest runs tells me it is  (as I am) happy with your fix.<br><br>Christian<br><br></p>
<blockquote>----- message d'origine -----<br>De : <span dir="ltr">"Sergey Korshunoff"</span> <span dir="lrt">&lt;seyko2 <at> gmail.com&gt;</span><br>date jeu. 26/03/2015 09:34 (GMT +01:00)<br>&Agrave; : <span dir="ltr">"tinycc-devel@..."</span> <span dir="lrt">&lt;tinycc-devel@...&gt;</span><br>Objet : Re: [Tinycc-devel] Last commit [26-03-2015] breaks RPi build - conflicting types for 'section_ptr_add'<br><br>Hi! Thanks for checking. A fix is commited. Please test it.<br><br>_______________________________________________<br>Tinycc-devel mailing list<br>Tinycc-devel@...<br>https://lists.nongnu.org/mailman/listinfo/tinycc-devel<br>
</blockquote>
</div>
Christian Jullien | 26 Mar 07:04 2015
Picon

Last commit [26-03-2015] breaks RPi build - conflicting types for 'section_ptr_add'

gcc -o tcc.o -c tcc.c -DCONFIG_MULTIARCHDIR="\"arm-linux-gnueabihf\"" -DTCC_TARGET_ARM -DTCC_ARM_EABI -DTCC_ARM_HARDFLOAT -DTCC_ARM_VFP -I.  -Wall -g -O2 -Wno-deprecated-declarations -Wno-strict-aliasing -Wno-pointer-sign -Wno-sign-compare -Wno-unused-result -Wno-uninitialized -fno-strict-aliasing gcc -o libtcc.o -c libtcc.c -DCONFIG_MULTIARCHDIR="\"arm-linux-gnueabihf\"" -DTCC_TARGET_ARM -DTCC_ARM_EABI -DTCC_ARM_HARDFLOAT -DTCC_ARM_VFP -I.  -Wall -g -O2 -Wno-deprecated-declarations -Wno-strict-aliasing -Wno-pointer-sign -Wno-sign-compare -Wno-unused-result -Wno-uninitialized -fno-strict-aliasing

libtcc.c:391:15: error: conflicting types for 'section_ptr_add'

tcc.h:1091:15: note: previous declaration of 'section_ptr_add' was here

Makefile:228: recipe for target 'libtcc.o' failed

 

<div><div class="WordSection1">
<p class="MsoPlainText">gcc -o tcc.o -c tcc.c -DCONFIG_MULTIARCHDIR="\"arm-linux-gnueabihf\"" -DTCC_TARGET_ARM -DTCC_ARM_EABI -DTCC_ARM_HARDFLOAT -DTCC_ARM_VFP -I.&nbsp; -Wall -g -O2 -Wno-deprecated-declarations -Wno-strict-aliasing -Wno-pointer-sign -Wno-sign-compare -Wno-unused-result -Wno-uninitialized -fno-strict-aliasing gcc -o libtcc.o -c libtcc.c -DCONFIG_MULTIARCHDIR="\"arm-linux-gnueabihf\"" -DTCC_TARGET_ARM -DTCC_ARM_EABI -DTCC_ARM_HARDFLOAT -DTCC_ARM_VFP -I.&nbsp; -Wall -g -O2 -Wno-deprecated-declarations -Wno-strict-aliasing -Wno-pointer-sign -Wno-sign-compare -Wno-unused-result -Wno-uninitialized -fno-strict-aliasing<p></p></p>
<p class="MsoPlainText">libtcc.c:391:15: error: conflicting types for 'section_ptr_add'<p></p></p>
<p class="MsoPlainText">tcc.h:1091:15: note: previous declaration of 'section_ptr_add' was here<p></p></p>
<p class="MsoPlainText">Makefile:228: recipe for target 'libtcc.o' failed<p></p></p>
<p class="MsoNormal"><p>&nbsp;</p></p>
</div></div>
Sergey Korshunoff | 25 Mar 14:54 2015
Picon

[TIPS] empty test program will crash if compiled with -b option

Hi! There is a patch for tcc and test program. If a tcc is not patched
(a call to the __bound_init() is inserted) then a call to the
__bound_init() leads to the crash of the compiled test (tcc -b test.c;
./a.out). Can someone explain while this happens even when
__bound_init() is a null function (does nothing)?

int main ()
{
#ifdef BOUNDS
    int v[10];  // program will crash if compiled with -b option
#endif
    return 0;
}

diff -urN tinycc.old/lib/bcheck.c tinycc/lib/bcheck.c
--- tinycc.old/lib/bcheck.c     2015-03-25 16:38:59.000000000 +0300
+++ tinycc/lib/bcheck.c 2015-03-25 16:40:34.000000000 +0300
 <at>  <at>  -343,6 +343,7  <at>  <at> 
     }
 }

+#if 0
 void __bound_init(void)
 {
     int i;
 <at>  <at>  -419,6 +420,11  <at>  <at> 
         p += 2;
     }
 }
+#else
+void __bound_init(void)
+{
+}
+#endif

 void __bound_main_arg(void **p)
 {
diff -urN tinycc.old/tccelf.c tinycc/tccelf.c
--- tinycc.old/tccelf.c 2015-03-25 16:38:59.000000000 +0300
+++ tinycc/tccelf.c     2015-03-25 16:39:25.000000000 +0300
 <at>  <at>  -1557,7 +1557,8  <at>  <at> 
     add_elf_sym(symtab_section, 0, 0,
                 ELFW(ST_INFO)(STB_GLOBAL, STT_NOTYPE), 0,
                 bounds_section->sh_num, "__bounds_start");
-#ifdef TCC_TARGET_I386
+#if 0
+//#ifdef TCC_TARGET_I386
     if (s1->output_type != TCC_OUTPUT_MEMORY) {
         /* add 'call __bound_init()' in .init section */
         init_section = find_section(s1, ".init");

Sergey Korshunoff | 25 Mar 06:36 2015
Picon

errno clearing with tcc -run

Hi!
There is a bug #43984: tcc -run reports errno=2
The following program (errno.c) reports errno=2 when run using "tcc
-run errno.c"
It reports errno=0 when run using "tcc errno.c && ./a.out".

#include <errno.h>
#include <stdio.h>
int main(void) { printf("errno=%d\n", errno); return 0; }

If all section of the compiled program are inited OK, then errno != 0
is a result of some system call of the tcc before a compiled program
is executed. Is there a need to clean the errno?

oldfaber | 24 Mar 22:55 2015
Picon

Fix for Microsoft compilers

Hi,

Miccrosoft Visual Sudio (Express) 2008 and 2010 do not accept variable
definitions C99 style.
Please apply this patch to mob

libtcc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libtcc.c b/libtcc.c
index 5a9681f..660c935 100644
--- a/libtcc.c
+++ b/libtcc.c
 <at>  <at>  -462,8 +462,8  <at>  <at>  ST_FUNC void put_extern_sym2(Sym *sym, Section *section,
     if (!sym->c) {
         name = get_tok_str(sym->v, NULL);
 #ifdef CONFIG_TCC_BCHECK
-        char buf[32];
         if (tcc_state->do_bounds_check) {
+           char buf[32];
             /* XXX: avoid doing that for statics ? */
             /* if bound checking is activated, we change some function
                names by adding the "__bound" prefix */

Sorry if this patch is space-mangled by gmail.
Committers please: add a blank line after the first line of commit
message to explain the
commit, it helps to read the log.

Thank you
Fabio

oldfaber | 23 Mar 18:49 2015
Picon

Commit b7b9f9f5 broke -dumpversion

Hi,

using a self-compiled tcc for Windows 32 bit
tcc -dumpversion
gives the error
tcc: error: invalid option -- '-dumpversion'

In tcc_parse_args() strstart() looks only at the first char,
'd' and decides that the option is -dD !!!

Thanks
Fabio

arnold | 22 Mar 12:16 2015

out of the box configuration on x86_64 ubuntu still broken

Hi.

Latest mob, out of the box configuration on x86_64 ubuntu is still
broken.

Is anyone planning to fix this?

Thanks,

Arnold

Sergey Korshunoff | 20 Mar 14:41 2015
Picon

[BUG] x86_64-tcc compiled by i386-tcc is wrong

A x86_64-tcc compiler compiled by i386-tcc is wrong.

./configure --enable-cross --cc=x86_64-tcc
make; make install; x86_64-tcc 009-test.c; a.out
    0x6006c0 0x6006bc

./configure --enable-cross --cc=i386-tcc
make; make install; x86_64-tcc 009-test.c; a.out
    0x6006c0 0x1006006bc

PS: 009-test.c is the test program described in the another thread
/* Tickle a bug in TinyC on 64-bit systems:
 * the LSB of the top word or ARGP gets set
 * for no obvious reason.
 *
 * Source: a legacy language interpreter which
 * has a little stack / stack pointer for arguments.
 *
 * Output is: 0x8049620 0x10804961c
 * Should be: 0x8049620 0x804961c
 */
#include <stdio.h>
#define NARGS 20000
int ARG[NARGS];
int *ARGSPACE = ARG;
int *ARGP = ARG - 1;
main()
{
  printf("%p %p\n", ARGSPACE, ARGP);
}

Martin Guy | 16 Mar 11:50 2015
Picon

Predefined macro identifying TinyC?

Hi

I wondered if there is a predefined TinyC macro to tell that TinyC is
the compiler in use.
I've looked through the documentation and "strings"-ed the binary but
can't see anything.

The reason is to work round what looks like a bug in the 64-bit
pointer handling, which is
fairly easy to workaround:

/* Tickle a bug in TinyC on 64-bit systems:
 * the LSB of the top word or ARGP gets set
 * for no obvious reason.
 *
 * Source: a legacy language interpreter which
 * has a little stack / stack pointer for arguments.
 *
 * Output is: 0x8049620 0x10804961c
 * Should be: 0x8049620 0x804961c
 */

#define NARGS 20000
int ARG[NARGS];
int *ARGSPACE = ARG;
int *ARGP = ARG - 1;

main()
{
  printf("%p %p\n", ARGSPACE, ARGP);
}

Thanks for keeping tcc alive and well. Your work is appreciated

    M

Christian Jullien | 15 Mar 15:43 2015
Picon

Re: some thoughts on the search path mess

Here native compiler values on arm (RPI).
Tcc is configred with:
./configure --with-libgcc
Binary  directory   /usr/local/bin
TinyCC directory    /usr/local/lib/tcc
Library directory   /usr/local/lib
Include directory   /usr/local/include
Manual directory    /usr/local/share/man
Info directory      /usr/local/share/info
Doc directory       /usr/local/share/doc//usr/local/lib/tcc
Target root prefix
Source path      /home/jullien/tinycc
C compiler       gcc
cross compilers  no
Target CPU       armv4l
Host OS          Linux
Target OS        Linux
Big Endian       no
gprof enabled    no
use libgcc       yes
Creating config.mak and config.h

Otherwise, without --with-ligcc,  arm abi fucntions are missing. Then tcc
-vv returns:

crt:
  /usr/lib/arm-linux-gnueabihf
libraries:
  /usr/lib/arm-linux-gnueabihf
  /usr/lib
  /lib/arm-linux-gnueabihf
  /lib
  /usr/local/lib/arm-linux-gnueabihf
  /usr/local/lib
include:
  /usr/local/include/arm-linux-gnueabihf
  /usr/local/include
  /usr/include/arm-linux-gnueabihf
  /usr/include
  /usr/local/lib/tcc/include
elfinterp:
  /lib/ld-linux-armhf.so.3

-----Original Message-----
From: tinycc-devel-bounces+eligis=orange.fr@...
[mailto:tinycc-devel-bounces+eligis=orange.fr@...] On
Behalf Of
Sergey Korshunoff
Sent: dimanche 15 mars 2015 15:32
To: tinycc-devel@...
Subject: Re: [Tinycc-devel] some thoughts on the search path mess

Hi! We must collect a valid configurations (tcc -vv) for all used
configurations (currently only Linux).

1) native compier on arm64. I think the output must look like the following
crt:
  /usr/lib/aarch64-linux-gnu
  /usr/lib64
libraries:
  /usr/lib/aarch64-linux-gnu
  /usr/lib64
  /lib/aarch64-linux-gnu
  /lib64
  /usr/local/lib/aarch64-linux-gnu
  /usr/local/lib64
include:
  /usr/local/include/aarch64-linux-gnu
  /usr/local/include
  /usr/include/aarch64-linux-gnu
  /usr/include
  /usr/local/lib/tcc/include

2) cross-compiler for arm64
crt:
  /usr/lib/aarch64-linux-gnu
libraries:
  /usr/lib/aarch64-linux-gnu
  /lib/aarch64-linux-gnu
  /usr/local/lib/aarch64-linux-gnu
include:
... the same

3) native compiler on arm
    ??????

4) native x86 compiler on amd/intel platform
crt:
  /usr/lib/i386-linux-gnu
  /usr/lib32
  /usr/lib          (if not a symlink)
libraries:
  /usr/lib/i386-linux-gnu
  /usr/lib32
  /usr/lib          (if not a symlink)
  /lib/i386-linux-gnu
  /lib32
  /lib                (if not a symlink)
  /usr/local/lib/i386-linux-gnu
  /usr/local/lib32
  /usr/local/lib   (if not a symlink)
include:
  /usr/local/include/i386-linux-gnu
  /usr/local/include
  /usr/include/i386-linux-gnu
  /usr/include
  /usr/local/lib/tcc/include

5) x86 cross compiler (from arm)
crt:
  /usr/lib/i386-linux-gnu
libraries:
  /usr/lib/aarch64-linux-gnu
  /lib/i386-linux-gnu
  /usr/local/lib/i386-linux-gnu
include:
   the same as above

6) x86_64 native compiler
crt:
  /usr/lib/x86_64-linux-gnu
  /usr/lib64
libraries:
  /usr/lib/x86_64-linux-gnu
  /usr/lib64
  /lib/x86_64-linux-gnu
  /lib64
  /usr/local/lib/x86_64-linux-gnu
  /usr/local/lib64
include:
  /usr/local/include/x86_64-linux-gnu
  /usr/local/include
  /usr/include/x86_64-linux-gnu
  /usr/include
  /usr/local/lib/tcc/include

7) x86_64 cross compiler (from arm)
crt:
  /usr/lib/x86_64-linux-gnu
libraries:
  /usr/lib/x86_64-linux-gnu
  /lib/x86_64-linux-gnu
  /usr/local/lib/x86_64-linux-gnu
include:
  the same as above

_______________________________________________
Tinycc-devel mailing list
Tinycc-devel@...
https://lists.nongnu.org/mailman/listinfo/tinycc-devel

Christian Jullien | 15 Mar 09:03 2015
Picon

Windows build broken after 'A gcc preprocessor option -dD added' commit on March 3

Hi all,

 

This commit:

author

seyko <seyko2-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>

Tue, 3 Mar 2015 11:25:57 +0000 (14:25 +0300)

 

 

 

diff --git a/tcc.c b/tcc.c

index 7b19114..ce03d3b 100644 (file)

--- a/tcc.c

+++ b/tcc.c

<at> <at> -47,6 +47,7 <at> <at>  static void help(void)

            "  -Usym       undefine 'sym'\n"

            "  -P          do not output a #line directive\n"

            "  -P1         use a #line directive in output instead of the gcc style\n"

+           "  -dD         put a define directive in the output (inside a comment)\n"

            "Linker options:\n"

            "  -Ldir       add library path 'dir'\n"

            "  -llib       link with dynamic or static library 'lib'\n"

<at> <at> -307,6 +308,8 <at> <at>  int main(int argc, char **argv)

         start_time = getclock_us();

 

     tcc_set_output_type(s, s->output_type);

+    if (s->output_type == TCC_OUTPUT_PREPROCESS)

+       print_defines();

 

     /* compile or add each files or library */

     for(i = ret = 0; i < s->nb_files && ret == 0; i++) {

 

On Windows, using build-tcc.bat, results to

C:\Users\jullien\AppData\Local\Temp\ccGAI2YU.o:tcc.c:(.text.startup+0x49a): undefined reference to `print_defines'

collect2.exe: error: ld returned 1 exit status.

 

If I add tccpp.c in libtcc, I get:

 

C:\Users\jullien\AppData\Local\Temp\cc5OdrSb.o:tccpp.c:(.text+0x3c0): multiple definition of `print_defines'

C:\Users\jullien\AppData\Local\Temp\ccqQyUPS.o:libtcc.c:(.text+0x2d30): first defined here

collect2.exe: error: ld returned 1 exit status

 

Which does not help a lot.

 

If I comment:

+    if (s->output_type == TCC_OUTPUT_PREPROCESS)

+       print_defines();

 

It compiles and runs nicely.

 

What is the right way to have print_defines included on Windows?

 

Seyko2, can you please investigate?

 

Tia

 

Christian

<div><div class="WordSection1">
<p class="MsoNormal"><span>Hi all,<p></p></span></p>
<p class="MsoNormal"><span><p>&nbsp;</p></span></p>
<p class="MsoNormal"><span>This commit:<p></p></span></p>
<table class="MsoNormalTable" border="0" cellpadding="0">
<tr>
<td valign="top"><p class="MsoNormal"><span>author</span><span><p></p></span></p></td>
<td valign="top"><p class="MsoNormal"><span><a href="http://repo.or.cz/w/tinycc.git/search/b7b9f9f51170bd1616ee56acfef9c6bf20b9cf3f?s=seyko;st=author" title="Search for commits authored by seyko"><span>seyko</span></a> <a href="http://repo.or.cz/w/tinycc.git/search/b7b9f9f51170bd1616ee56acfef9c6bf20b9cf3f?s=seyko2-Re5JQEeQqe8AvxtiuMwx3w <at> public.gmane.org;st=author" title="Search for commits authored by seyko2@..."><span>&lt;seyko2@...&gt;</span></a></span><span><p></p></span></p></td>
<td rowspan="2" valign="top"></td>
</tr>
<tr>
<td valign="top"></td>
<td valign="top"><p class="MsoNormal"><span>Tue, 3 Mar 2015 11:25:57 +0000 (14:25 +0300)</span><span><p></p></span></p></td>
</tr>
</table>
<p class="MsoNormal"><span><p>&nbsp;</p></span></p>
<p class="MsoNormal"><span><p>&nbsp;</p></span></p>
<p class="MsoNormal"><span><p>&nbsp;</p></span></p>
<p class="MsoNormal"><span>diff --git <a href="http://repo.or.cz/w/tinycc.git/blob/7b191147b593106665581ed892dabb205ba444cf:/tcc.c">a/tcc.c</a> <a href="http://repo.or.cz/w/tinycc.git/blob/ce03d3b3cbd235fd783682e9f705570e6d2d86a6:/tcc.c">b/tcc.c</a><p></p></span></p>
<p class="MsoNormal"><span>index <a href="http://repo.or.cz/w/tinycc.git/blob/7b191147b593106665581ed892dabb205ba444cf:/tcc.c">7b19114</a>..<a href="http://repo.or.cz/w/tinycc.git/blob/ce03d3b3cbd235fd783682e9f705570e6d2d86a6:/tcc.c">ce03d3b</a> 100644<span class="info"> (file)</span><p></p></span></p>
<p class="MsoNormal"><span>--- a/<a href="http://repo.or.cz/w/tinycc.git/blob/7b191147b593106665581ed892dabb205ba444cf:/tcc.c">tcc.c</a><p></p></span></p>
<p class="MsoNormal"><span>+++ b/<a href="http://repo.or.cz/w/tinycc.git/blob/ce03d3b3cbd235fd783682e9f705570e6d2d86a6:/tcc.c">tcc.c</a><p></p></span></p>
<p class="MsoNormal"><span class="chunkinfo"><span> <at>  <at>  <a href="http://repo.or.cz/w/tinycc.git/blob/7b191147b593106665581ed892dabb205ba444cf:/tcc.c#l47"><span>-47,6</span></a> <a href="http://repo.or.cz/w/tinycc.git/blob/ce03d3b3cbd235fd783682e9f705570e6d2d86a6:/tcc.c#l47"><span>+47,7</span></a>  <at>  <at> </span></span><span class="section"><span>&nbsp;static&nbsp;void&nbsp;help(void)</span></span><span><p></p></span></p>
<p class="MsoNormal"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"&nbsp;&nbsp;-Usym&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;undefine&nbsp;'sym'\n"<p></p></span></p>
<p class="MsoNormal"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"&nbsp;&nbsp;-P&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;do&nbsp;not&nbsp;output&nbsp;a&nbsp;#line&nbsp;directive\n"<p></p></span></p>
<p class="MsoNormal"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"&nbsp;&nbsp;-P1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;use&nbsp;a&nbsp;#line&nbsp;directive&nbsp;in&nbsp;output&nbsp;instead&nbsp;of&nbsp;the&nbsp;gcc&nbsp;style\n"<p></p></span></p>
<p class="MsoNormal"><span>+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"&nbsp;&nbsp;-dD&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;put&nbsp;a&nbsp;define&nbsp;directive&nbsp;in&nbsp;the&nbsp;output&nbsp;(inside&nbsp;a&nbsp;comment)\n"<p></p></span></p>
<p class="MsoNormal"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"Linker&nbsp;options:\n"<p></p></span></p>
<p class="MsoNormal"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"&nbsp;&nbsp;-Ldir&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;add&nbsp;library&nbsp;path&nbsp;'dir'\n"<p></p></span></p>
<p class="MsoNormal"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"&nbsp;&nbsp;-llib&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;link&nbsp;with&nbsp;dynamic&nbsp;or&nbsp;static&nbsp;library&nbsp;'lib'\n"<p></p></span></p>
<p class="MsoNormal"><span class="chunkinfo"><span> <at>  <at>  <a href="http://repo.or.cz/w/tinycc.git/blob/7b191147b593106665581ed892dabb205ba444cf:/tcc.c#l307"><span>-307,6</span></a> <a href="http://repo.or.cz/w/tinycc.git/blob/ce03d3b3cbd235fd783682e9f705570e6d2d86a6:/tcc.c#l308"><span>+308,8</span></a>  <at>  <at> </span></span><span class="section"><span>&nbsp;int&nbsp;main(int&nbsp;argc,&nbsp;char&nbsp;**argv)</span></span><span><p></p></span></p>
<p class="MsoNormal"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;start_time&nbsp;=&nbsp;getclock_us();<p></p></span></p>
<p class="MsoNormal"><span>&nbsp;<p></p></span></p>
<p class="MsoNormal"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;tcc_set_output_type(s,&nbsp;s-&gt;output_type);<p></p></span></p>
<p class="MsoNormal"><span>+&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;(s-&gt;output_type&nbsp;==&nbsp;TCC_OUTPUT_PREPROCESS)<p></p></span></p>
<p class="MsoNormal"><span>+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;print_defines();</span><span><p></p></span></p>
<p class="MsoNormal"><span>&nbsp;<p></p></span></p>
<p class="MsoNormal"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/*&nbsp;compile&nbsp;or&nbsp;add&nbsp;each&nbsp;files&nbsp;or&nbsp;library&nbsp;*/<p></p></span></p>
<p class="MsoNormal"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;for(i&nbsp;=&nbsp;ret&nbsp;=&nbsp;0;&nbsp;i&nbsp;&lt;&nbsp;s-&gt;nb_files&nbsp;&amp;&amp;&nbsp;ret&nbsp;==&nbsp;0;&nbsp;i++)&nbsp;{<p></p></span></p>
<p class="MsoNormal"><p>&nbsp;</p></p>
<p class="MsoNormal">On Windows, using build-tcc.bat, results to<p></p></p>
<p class="MsoNormal">C:\Users\jullien\AppData\Local\Temp\ccGAI2YU.o:tcc.c:(.text.startup+0x49a): undefined reference to `print_defines'<p></p></p>
<p class="MsoNormal">collect2.exe: error: ld returned 1 exit status.<p></p></p>
<p class="MsoNormal"><p>&nbsp;</p></p>
<p class="MsoNormal">If I add tccpp.c in libtcc, I get:<p></p></p>
<p class="MsoNormal"><p>&nbsp;</p></p>
<p class="MsoNormal">C:\Users\jullien\AppData\Local\Temp\cc5OdrSb.o:tccpp.c:(.text+0x3c0): multiple definition of `print_defines'<p></p></p>
<p class="MsoNormal">C:\Users\jullien\AppData\Local\Temp\ccqQyUPS.o:libtcc.c:(.text+0x2d30): first defined here<p></p></p>
<p class="MsoNormal">collect2.exe: error: ld returned 1 exit status<p></p></p>
<p class="MsoNormal"><p>&nbsp;</p></p>
<p class="MsoNormal">Which does not help a lot.<p></p></p>
<p class="MsoNormal"><p>&nbsp;</p></p>
<p class="MsoNormal">If I comment:<p></p></p>
<p class="MsoNormal"><span>+&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;(s-&gt;output_type&nbsp;==&nbsp;TCC_OUTPUT_PREPROCESS)<p></p></span></p>
<p class="MsoNormal"><span>+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;print_defines();</span><span><p></p></span></p>
<p class="MsoNormal"><p>&nbsp;</p></p>
<p class="MsoNormal">It compiles and runs nicely.<p></p></p>
<p class="MsoNormal"><p>&nbsp;</p></p>
<p class="MsoNormal">What is the right way to have print_defines included on Windows?<p></p></p>
<p class="MsoNormal"><p>&nbsp;</p></p>
<p class="MsoNormal">Seyko2, can you please investigate?<p></p></p>
<p class="MsoNormal"><p>&nbsp;</p></p>
<p class="MsoNormal">Tia<p></p></p>
<p class="MsoNormal"><p>&nbsp;</p></p>
<p class="MsoNormal">Christian<p></p></p>
</div></div>

Gmane