Re: [Tinycc-devel] tcc port to cygwin

2016-05-22 Thread Chris Marshall
First, I would like to apologize for my random speculation that the 
bcheck.c compile problems from my posix cygwin port was a possible bug 
in tcc.  Now that I'm further up the learning curve on tcc/compiling I 
think the most likely issue is include file compatability which results 
in invalid code getting to the tcc parsing routines.  I did not mean to 
insult the active development effort that continues to improve tcc 
features and performance.


Second, what would be the best way (when, where, how...) to get the 
cygwin work into tcc upstream?  I've sort of assumed that the mob branch 
is the true master from the activity on the mailing list.  Is that 
true?  In the meantime, I plan to set up a mirror on my github so that I 
can stand up a separate branch for the cygwin work for other developers 
to access in the meantime.


Third, any suggestions on how to diagnose and debug the problems of the 
cygwin system includes for gcc to use as simply as possible with tcc 
compilation?



--Chris


Second:
On 5/20/2016 11:10, Chris Marshall wrote:
Gives me the clue that the problem may be in the parsing rather the pp 
stuff.

The output when PARSE_DEBUG is set definitely shows the problem area.
Maybe someone more knowledgeable can figure this out. Unfortunately, I've
used up my available tcc debug time for the week.  I did manage to 
port COS
to build on cygwin and am starting on some of the PDL Next Gen stuff 
there.


The connection with tcc is that I would like to use it to JIT so that 
the COS/C

stuff can be updated at runtime for dynamic operation---such as applying a
computational role to a pdl operation.

Cheers,
Chris

On Fri, May 20, 2016 at 11:02 AM, Chris Marshall 
> wrote:


Hi David-

Ack!  I was only looking at the tccpp.c since the problem was with
the includes.

I think if you select the Devel all you'll get alot of things
which should be enough.
Off the top of my head, the specifics would be gmake/make, gcc,
and maybe git + your choice of editor.
Sorry I can't be more specific but the cygwin setup.exe is not
really easy to determine what is needed.
In the past, when I've had problems, I search for the problem file
or whatever using this page:

https://cygwin.com/cgi-bin2/package-grep.cgi

Then you install and iterate until things work. Unfortunately, I
would help you with this but
the cygwin setup program is too smart for me to make it think I'm
doing a clean install.
If you determine the needed packages, that would be great to
know---personally and for
any potential Alien::TCC stuff on cygwin.

--Chris


On Fri, May 20, 2016 at 9:17 AM, David Mertens
> wrote:

Hello Chris,

According to ack, "skip(')')" shows up all over the place in
tccgen.c. What does line 196 of your sys/reent.h look like?

Also, if I started from a pristine Windows installation with a
core Cygwin installation, which Cygwin packages would I need
to install to get to where you are?

David

On Fri, May 20, 2016 at 8:24 AM, Chris Marshall
> wrote:

Atttached is a first cut port of the TinyCC build to the
cygwin platform.

The mains problems seem to be from managing the different
include files.
I hand added some defines to libtcc1.c for __INTPTR_TYPE__
and a few
others to get that to build.

However, it is now failing to build bcheck.c with:

>  ../tcc -B.. -c bcheck.c -o x86_64/bcheck.o -I.. -Wall
-g -O0 -Wdeclaration-after-statement
-Wno-deprecated-declarations -Wno-strict-aliasing
-Wno-pointer-sign -Wno-sign-compare -Wno-unused-result
-Wno-uninitialized -fno-strict-aliasing -fPIC
-DTCC_TARGET_X86_64
>  In file included from bcheck.c:20:
>  In file included from /usr/include/stdlib.h:18:
> /usr/include/sys/reent.h:196: error: ')' expected (got "*")
> Makefile:116: recipe for target 'x86_64/bcheck.o' failed
>  make[1]: *** [x86_64/bcheck.o] Error 1

Looking at the origin of the error message in the skip()
routine
in tccpp.c, I could not find any place that skip() was
called with
an argument of ')'.  Is there some other place that message
could be coming from.  Seems like it might be a possible
problem in the preprocessing

--Chris



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




-- 

[Tinycc-devel] [BUG] assertion failure when compiling initialization of array of structs on x86_64

2016-05-22 Thread Eric Biggers
Hello,

When I tried compiling some of my code with tcc, I encountered an assertion
failure, which I have reduced to the following minimal example:

struct S {
long a;
};

void f(struct S *x)
{
struct S y[1] = { *x };
}

$ tcc -c bug.c
tcc: x86_64-gen.c:418: load: Assertion `((ft & VT_BTYPE) == VT_INT) || ((ft & 
VT_BTYPE) == VT_LLONG) || ((ft & VT_BTYPE) == VT_PTR) || ((ft & VT_BTYPE) == 
VT_ENUM) || ((ft & VT_BTYPE) == VT_FUNC)' failed.
Aborted (core dumped)

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