Re: [Tinycc-devel] Crash on static function when compiling with -nostdlib

2021-03-31 Thread Christian Jullien
Hi Oren,

 

Unfortunately, tcc –v does not indicates precisely the version you use.

I can just say that I can’t reproduce with mob. The official 0.9.27 is really 
old. Please use mod instead.

 

[jullien@fedora64 ~]$ uname -a

Linux fedora64.eligis.com 5.11.10-200.fc33.x86_64 #1 SMP Thu Mar 25 16:51:31 
UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

[jullien@fedora64 ~]$ cat testcase.c

static void test () {;}

void _start() {;}

[jullien@fedora64 ~]$ tcc testcase.c –nostdlib

[jullien@fedora64 ~]$

 

C.

 

 

 

From: Tinycc-devel [mailto:tinycc-devel-bounces+eligis=orange...@nongnu.org] On 
Behalf Of Oren Watson via Tinycc-devel
Sent: Wednesday, March 31, 2021 07:19
To: tinycc-devel@nongnu.org
Cc: orenwat...@tutanota.com
Subject: [Tinycc-devel] Crash on static function when compiling with -nostdlib

 

the following code, when compiled with tcc -nostdlib caused tcc to segafult

$ cat testcase.c 

static void test () {;}
void _start() {;}

$ tcc testcase.c -nostdlib

Segmentation fault (core dumped)

$ tcc -v

tcc version 0.9.27 (x86_64 Linux)

 

I did some variations and it seems it's just any "static" function definition, 
causes segfault when compiling without standard library.


---

Oren Watson (he/him)

orenwat...@tutanota.com

 

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


Re: [Tinycc-devel] Crash on static function when compiling with -nostdlib

2021-03-31 Thread Ivan Medoedov
It would be nice if tcc -v specified the git commit it was built on.

On Wed, Mar 31, 2021 at 10:01 AM Christian Jullien  wrote:

> Hi Oren,
>
>
>
> Unfortunately, tcc –v does not indicates precisely the version you use.
>
> I can just say that I can’t reproduce with mob. The official 0.9.27 is
> really old. Please use mod instead.
>
>
>
> [jullien@fedora64 ~]$ uname -a
>
> Linux fedora64.eligis.com 5.11.10-200.fc33.x86_64 #1 SMP Thu Mar 25
> 16:51:31 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
>
> [jullien@fedora64 ~]$ cat testcase.c
>
> static void test () {;}
>
> void _start() {;}
>
> [jullien@fedora64 ~]$ tcc testcase.c –nostdlib
>
> [jullien@fedora64 ~]$
>
>
>
> C.
>
>
>
>
>
>
>
> *From:* Tinycc-devel [mailto:tinycc-devel-bounces+eligis=
> orange...@nongnu.org] *On Behalf Of *Oren Watson via Tinycc-devel
> *Sent:* Wednesday, March 31, 2021 07:19
> *To:* tinycc-devel@nongnu.org
> *Cc:* orenwat...@tutanota.com
> *Subject:* [Tinycc-devel] Crash on static function when compiling with
> -nostdlib
>
>
>
> the following code, when compiled with tcc -nostdlib caused tcc to segafult
>
> $ cat testcase.c
>
> static void test () {;}
> void _start() {;}
>
> $ tcc testcase.c -nostdlib
>
> Segmentation fault (core dumped)
>
> $ tcc -v
>
> tcc version 0.9.27 (x86_64 Linux)
>
>
>
> I did some variations and it seems it's just any "static" function
> definition, causes segfault when compiling without standard library.
>
>
> ---
>
> Oren Watson (he/him)
>
> orenwat...@tutanota.com
>
>
> ___
> Tinycc-devel mailing list
> Tinycc-devel@nongnu.org
> https://lists.nongnu.org/mailman/listinfo/tinycc-devel
>
___
Tinycc-devel mailing list
Tinycc-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/tinycc-devel


Re: [Tinycc-devel] Crash on static function when compiling with -nostdlib

2021-03-31 Thread Christian Jullien
I fully agree with you, I already asked the same thing on this list (git 
version + commit date) but got no replies L

Also the last official 0.9.27 is quite old (> 3y) it would be nice to update 
the official version.

 

C.

 

From: Ivan Medoedov [mailto:ivan.medoe...@gmail.com] 
Sent: Wednesday, March 31, 2021 14:31
To: jull...@eligis.com; tinycc-devel@nongnu.org
Cc: orenwat...@tutanota.com
Subject: Re: [Tinycc-devel] Crash on static function when compiling with 
-nostdlib

 

It would be nice if tcc -v specified the git commit it was built on.

 

On Wed, Mar 31, 2021 at 10:01 AM Christian Jullien  wrote:

Hi Oren,

 

Unfortunately, tcc –v does not indicates precisely the version you use.

I can just say that I can’t reproduce with mob. The official 0.9.27 is really 
old. Please use mod instead.

 

[jullien@fedora64 ~]$ uname -a

Linux fedora64.eligis.com 5.11.10-200.fc33.x86_64 #1 SMP Thu Mar 25 16:51:31 
UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

[jullien@fedora64 ~]$ cat testcase.c

static void test () {;}

void _start() {;}

[jullien@fedora64 ~]$ tcc testcase.c –nostdlib

[jullien@fedora64 ~]$

 

C.

 

 

 

From: Tinycc-devel [mailto:tinycc-devel-bounces+eligis 
 =orange...@nongnu.org] On Behalf Of Oren 
Watson via Tinycc-devel
Sent: Wednesday, March 31, 2021 07:19
To: tinycc-devel@nongnu.org
Cc: orenwat...@tutanota.com
Subject: [Tinycc-devel] Crash on static function when compiling with -nostdlib

 

the following code, when compiled with tcc -nostdlib caused tcc to segafult

$ cat testcase.c 

static void test () {;}
void _start() {;}

$ tcc testcase.c -nostdlib

Segmentation fault (core dumped)

$ tcc -v

tcc version 0.9.27 (x86_64 Linux)

 

I did some variations and it seems it's just any "static" function definition, 
causes segfault when compiling without standard library.


---

Oren Watson (he/him)

orenwat...@tutanota.com

 

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

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


[Tinycc-devel] I want to add more info with -v option

2021-03-31 Thread Christian Jullien
Hi,

 

More and more users complain with 0.9.27 bugs which are solved by mob.

They often tell us they are using ./tcc -v => 0.9.27 which is meaningless as
0.9.27 is anything form last >3y old official 0.9.27 to mob.

 

To improve this, I would like to add the git last date (or anything that can
easily identify the source code version used to compile tcc).

 

./tcc -v

jullien@sims4:~/tinycc $ ./tcc -v

tcc version 0.9.27 (ARM eabihf Linux - git version Thu Mar 18 22:54:24 2021)

 

When tcc is compiled from a tarball (w.o. git info) it will tell:

jullien@sims4:~/tinycc $ ./tcc -v

tcc version 0.9.27 (ARM eabihf Linux - unknown git version)

 

Can I push this patch?

 

jullien@sims4:~/tinycc $ git diff

diff --git a/Makefile b/Makefile

index 6d09b65..691a2d3 100644

--- a/Makefile

+++ b/Makefile

@@ -24,6 +24,12 @@ CFLAGS += -I$(TOP)

CFLAGS += $(CPPFLAGS)

VPATH = $(TOPSRC)

 

+TCC_GIT_DATE=$(shell which gut > /dev/null 2>&1 && git log -1 --format=%ad
--date=local || echo no)

+

+ifneq ($(TCC_GIT_DATE),no)

+ CFLAGS += -DTCC_GIT_DATE="\"$(TCC_GIT_DATE)\""

+endif

+

ifdef CONFIG_WIN32

  CFG = -win

  ifneq ($(CONFIG_static),yes)

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

index bd9ce2f..36f4af1 100644

--- a/tcc.c

+++ b/tcc.c

@@ -181,6 +181,12 @@ static const char version[] =

 " NetBSD"

#else

 " Linux"

+#endif

+#ifdef TCC_GIT_DATE

+" - git version "

+TCC_GIT_DATE

+#else

+" - unknown git version"

#endif

 ")\n"

 ;

 

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


Re: [Tinycc-devel] I want to add more info with -v option

2021-03-31 Thread Dmitry Selyutin
Hi Jullien,

I think this is a really good idea. I'd also consider git hash, not a date,
but this is likely a minor.

> +TCC_GIT_DATE=$(shell which gut > /dev/null 2>&1 && git log -1
--format=%ad --date=local || echo no)

Did you mean "git" here, not "gut"?
___
Tinycc-devel mailing list
Tinycc-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/tinycc-devel


Re: [Tinycc-devel] I want to add more info with -v option

2021-03-31 Thread Christian Jullien
Of course it’s git. I use gut to test the case git is not installed.

 

From: Tinycc-devel [mailto:tinycc-devel-bounces+eligis=orange...@nongnu.org] On 
Behalf Of Dmitry Selyutin
Sent: Wednesday, March 31, 2021 17:44
To: jull...@eligis.com; tinycc-devel@nongnu.org
Subject: Re: [Tinycc-devel] I want to add more info with -v option

 

Hi Jullien,

 

I think this is a really good idea. I'd also consider git hash, not a date, but 
this is likely a minor.

 

> +TCC_GIT_DATE=$(shell which gut > /dev/null 2>&1 && git log -1 --format=%ad 
> --date=local || echo no)

 

Did you mean "git" here, not "gut"?

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


Re: [Tinycc-devel] I want to add more info with -v option

2021-03-31 Thread arnold
I think this is a good idea.

"Christian Jullien"  wrote:

> Can I push this patch?
>
  vvv
> +TCC_GIT_DATE=$(shell which gut > /dev/null 2>&1 && git log -1 --format=%ad 
> --date=local || echo no)
  ^^^

You have a typo here. :-)

Thanks,

Arnold

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


Re: [Tinycc-devel] I want to add more info with -v option

2021-03-31 Thread avih via Tinycc-devel
 
I also think the hash should be there.
git describe can be useful here too.

 On Wednesday, March 31, 2021, 06:44:39 PM GMT+3, Dmitry Selyutin 
 wrote:  
 
 Hi Jullien,
I think this is a really good idea. I'd also consider git hash, not a date, but 
this is likely a minor.
> +TCC_GIT_DATE=$(shell which gut > /dev/null 2>&1 && git log -1 --format=%ad 
> --date=local || echo no)
Did you mean "git" here, not 
"gut"?___
Tinycc-devel mailing list
Tinycc-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/tinycc-devel
  ___
Tinycc-devel mailing list
Tinycc-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/tinycc-devel


Re: [Tinycc-devel] I want to add more info with -v option

2021-03-31 Thread Christian Jullien
It appears some prefer git hash so I added short hash.

Code is commited, you should get something like:

 

$ ./tcc -v

tcc version 0.9.27 - 65d00b1 (ARM eabihf Linux)

 

Now, anything wo. hash is not from mod.

 

C.

 

 

From: Tinycc-devel [mailto:tinycc-devel-bounces+eligis=orange...@nongnu.org]
On Behalf Of Christian Jullien
Sent: Wednesday, March 31, 2021 17:37
To: tinycc-devel@nongnu.org
Subject: [Tinycc-devel] I want to add more info with -v option

 

Hi,

 

More and more users complain with 0.9.27 bugs which are solved by mob.

They often tell us they are using ./tcc -v => 0.9.27 which is meaningless as
0.9.27 is anything form last >3y old official 0.9.27 to mob.

 

To improve this, I would like to add the git last date (or anything that can
easily identify the source code version used to compile tcc).

 

./tcc -v

jullien@sims4:~/tinycc $ ./tcc -v

tcc version 0.9.27 (ARM eabihf Linux - git version Thu Mar 18 22:54:24 2021)

 

When tcc is compiled from a tarball (w.o. git info) it will tell:

jullien@sims4:~/tinycc $ ./tcc -v

tcc version 0.9.27 (ARM eabihf Linux - unknown git version)

 

Can I push this patch?

 

jullien@sims4:~/tinycc $ git diff

diff --git a/Makefile b/Makefile

index 6d09b65..691a2d3 100644

--- a/Makefile

+++ b/Makefile

@@ -24,6 +24,12 @@ CFLAGS += -I$(TOP)

CFLAGS += $(CPPFLAGS)

VPATH = $(TOPSRC)

 

+TCC_GIT_DATE=$(shell which gut > /dev/null 2>&1 && git log -1 --format=%ad
--date=local || echo no)

+

+ifneq ($(TCC_GIT_DATE),no)

+ CFLAGS += -DTCC_GIT_DATE="\"$(TCC_GIT_DATE)\""

+endif

+

ifdef CONFIG_WIN32

  CFG = -win

  ifneq ($(CONFIG_static),yes)

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

index bd9ce2f..36f4af1 100644

--- a/tcc.c

+++ b/tcc.c

@@ -181,6 +181,12 @@ static const char version[] =

 " NetBSD"

#else

 " Linux"

+#endif

+#ifdef TCC_GIT_DATE

+" - git version "

+TCC_GIT_DATE

+#else

+" - unknown git version"

#endif

 ")\n"

 ;

 

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