mob is not compiling on osx 10.12

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

mob is not compiling on osx 10.12

Robert Hölzl
Hello,

I tried to build the "mob" branch (commit id df67d86) of TCC on macos
(10.12) without success.
I get the following error message when running "make":

...
../tcc -c bt-exe.c -o ../bt-exe.o -B.. -I.. -D_ANSI_SOURCE
In file included from bt-exe.c:6:
In file included from ../tccrun.c:21:
In file included from ../tcc.h:27:
In file included from /usr/include/stdlib.h:63:
In file included from /usr/include/_types.h:27:
In file included from /usr/include/sys/_types.h:32:
/usr/include/sys/cdefs.h:81: warning: #warning "Unsupported compiler
detected"
In file included from bt-exe.c:6:
In file included from ../tccrun.c:21:
In file included from ../tcc.h:29:
../include/stdarg.h:19: error: incompatible redefinition of 'va_list'
m


the last last working commit is 0d6801b.

the first failing commit is 3877618. But this one has a different error
message:
(errormsg: "tccrun.c:169:52: error: use of undeclared identifier 'environ'")



_______________________________________________
Tinycc-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/tinycc-devel
Reply | Threaded
Open this post in threaded view
|

Re: mob is not compiling on osx 10.12

Michael Matz-4
Hi,

On Sat, 11 Apr 2020, Robert Hölzl wrote:

> I tried to build the "mob" branch (commit id df67d86) of TCC on macos (10.12)
> without success.
> I get the following error message when running "make":
>
> ...
> ../tcc -c bt-exe.c -o ../bt-exe.o -B.. -I.. -D_ANSI_SOURCE
> In file included from bt-exe.c:6:
> In file included from ../tccrun.c:21:
> In file included from ../tcc.h:27:
> In file included from /usr/include/stdlib.h:63:
> In file included from /usr/include/_types.h:27:
> In file included from /usr/include/sys/_types.h:32:
> /usr/include/sys/cdefs.h:81: warning: #warning "Unsupported compiler
> detected"
> In file included from bt-exe.c:6:
> In file included from ../tccrun.c:21:
> In file included from ../tcc.h:29:
> ../include/stdarg.h:19: error: incompatible redefinition of 'va_list'
> m
Our stdarg.h has provisions for possibly working with MacOS (via defining
a macro that is expected by MacOS headers), but that's only going to work
if it's not too late.  It might be too late if other standard headers are
included before.  So, can you try moving the include stdarg.h in tcc.h in
front of the other includes?  (As in the below patch).

If that works, please push it to mob.


Ciao,
Michael.

diff --git a/tcc.h b/tcc.h
index 82238ce..184a62a 100644
--- a/tcc.h
+++ b/tcc.h
@@ -24,9 +24,9 @@
  #define _GNU_SOURCE
  #include "config.h"

+#include <stdarg.h>
  #include <stdlib.h>
  #include <stdio.h>
-#include <stdarg.h>
  #include <string.h>
  #include <errno.h>
  #include <math.h>
_______________________________________________
Tinycc-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/tinycc-devel