tinycc-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Tinycc-devel] plans to 0.9.27


From: Christian Jullien
Subject: Re: [Tinycc-devel] plans to 0.9.27
Date: Sat, 14 Oct 2017 07:26:07 +0200

Grischka,

First, be sure I don't want to bother you for free. I KNOW for years how to
build and test Windows tcc (both 32/64) from Cygwin32 and Cygwin64 (it was
called win32/Makefile). It allowed anybody to easily test mod changes on
Windows.

My ONLY goal is to let other people to do the same.

So where are we?

Following you procedure I wrote a (long) script that works on Cygwin64 (but
not quite - see script at the end):

This script produces two Windows directories:
W64: which is a x64 version able to generate x64 (-m64 the default) and x86
code (-m32)
W32: which is a x86 version able to generate x86 (-m32 the default) BUT
fails with -m64:
/cygdrive/f/tinycc/W32$ ./tcc -m64 ../foo.c
tcc: error: could not run 'F:\tinycc\W32\x86_64-win32-tcc.exe'

Indeed:

/cygdrive/f/tinycc$ ls W* | more
W32:
doc
examples
include
lib
libtcc
libtcc.dll
tcc.exe

W64:
doc
examples
i386-win32-tcc.exe
include
lib
libtcc
libtcc.dll
tcc.exe

I'm quite OLD :o) but whether it was run on Cygwin32/64

$ cd win32; make all && make test

Was able to produce and test in one line all windows tcc material for
-m32/-m64

i386-win32-tcc.exe
tcc.exe
x86_64-win32-tcc.exe

IMHO, what is still missing is something (configure option, Makefile, script
or whatever) that works ROOTB (I mean very few simple commands) to produce
native Windows tcc that produce 32/64 code from Cygwin.

Don't hesitate to tell me I bother you too much and I'll definitely stop
this thread.

Here is what we must do to produce and test tcc on Windows with both 32/66
bit generated code but is not able to produce a working tcc -m64 version
from Cygwin32 (only from Cygwin64):


rm -r -f $PWD/X $PWD/W32 $PWD/W64

# build a cross-tcc using standard cygwin gcc and install in X:
make distclean
./configure --prefix=$PWD/X
make
make install
make distclean

# configure once for using that, anytime in future:
./configure --cc=$PWD/X/tcc --prefix=$PWD/W64

# build a native windows tcc, optionally with -m32/64, run full tests,
# and install as ready-to-use relocatable tree in W:

make
make cross-i386-win32
make test
make install

# make a i386 cross-compiler, too:
make distclean
./configure --prefix=$PWD/X
make
make cross-i386-win32
make install

# Then build the 32 bit tcc on win64 too:
make distclean
./configure --prefix=$PWD/W32 --cc=$PWD/X/i386-win32-tcc --cpu=i386
make clean
make
make test
make install


-----Original Message-----
From: Tinycc-devel [mailto:address@hidden
On Behalf Of grischka
Sent: vendredi 13 octobre 2017 20:37
To: address@hidden
Subject: Re: [Tinycc-devel] plans to 0.9.27

Christian Jullien wrote:
> But worse, I've also the impression that, after building W/tcc, make 
> test still uses Cygwin version.  Can you please check and tell me if 
> I'm wrong or the way I can run "make test" using W/tcc?

Some tests use the build CC (which normally is gcc) to create the reference
output.  Like .expect files but always fresh.

> Is there a way to detect that and run test two times, once with -m32, 
> once with -m64?

Not really.  However you can create a native 32 bit tcc and test that:

First make a i386 cross-compiler, too:

     ./configure --prefix=$PWD/X && make clean all cross-i386-win32 install

Then you can build the 32 bit tcc on win64 too:

     ./configure --prefix=$PWD/W32 --cc=$PWD/X/i386-win32-tcc --cpu=i386
     make clean all test install
     cd W32 && ./tcc -run examples/hello_win.c

-- gr

> 
> C.
> 
> 
> 
> -----Original Message-----
> From: Tinycc-devel 
> [mailto:address@hidden
> On Behalf Of grischka
> Sent: jeudi 12 octobre 2017 09:32
> To: address@hidden
> Subject: Re: [Tinycc-devel] plans to 0.9.27
> 
> Christian Jullien wrote:
>> Chris,
>>
>> This is precisely why I wrote win32/Makefile which, with only
> Cygwin+native Cygwin gcc, was able to bootstrap a native Windows tcc 
> Cygwin+for x86
> and x86_64 and check that all tests work.
>> Grischka disliked to have this Makefile and insisted to remove it. 
>> HIMO,
> we now lose the ability to very easily build native Windows tcc and 
> test it as there is no replacement atm.
>> I dislike the idea to install mingw on top of Cygwin just to produce 
>> native build while standard gcc is able to do that and works like a 
>> charm
> 
> ONLY for people who not are already TOO OLD to type some configure 
> options or TO TRY something NEW or DIFFERENT, eventually:
> 
> # build a cross-tcc using standard cygwin gcc and install in X:
> 
>      ./configure --prefix=$PWD/X
>      make
>      make install
>      make distclean
> 
> # configure once for using that, anytime in future:
> 
>      ./configure --cc=$PWD/X/tcc --prefix=$PWD/W
> 
> # build a native windows tcc, optionally with -m32/64, run full tests,
>    and install as ready-to-use relocatable tree in W:
> 
>      make
>      make cross-i386-win32  (cross-x86_64-win32 if on 32bits)
>      make test
>      make install
> 
> -- gr
> 
>> Until we have a way to do  that, I'll continue to use my own
> win32/Makefile (now private) copy.
>> Now, you can try to convince Grischka to restore it or ask him to add 
>> the
> logic in main Makefile to produce Windows native tcc for x86/x86_64 
> with just Cygwin+standard Cygwin gcc.
>> If we dream, we should have Canadian-cross compiler with just 
>> configure
> --triplet; make. Where triplet is:
>> System types:
>>   --build=BUILD     configure for building on BUILD [guessed]
>>   --host=HOST       cross-compile to build programs to run on HOST
[BUILD]
>>   --target=TARGET   configure for building compilers for TARGET [HOST]
>>
>> But this is a very huge task to make it work. Until then, I'll 
>> continue to
> use my Makefile on Cygwin which is close to my ideal.
>> Christian
>>
>>
>> -----Original Message-----
>> From: Tinycc-devel
>> [mailto:address@hidden On Behalf 
>> Of Chris Marshall
>> Sent: jeudi 12 octobre 2017 02:54
>> To: address@hidden
>> Subject: Re: [Tinycc-devel] plans to 0.9.27
>>
>> I just confirmed that restoring the "build windows tcc with cygwin"
> win32/Makefile still works.
>> Since there is no posix cygwin build of tcc available, I suggest not
> breaking the cygwin build until there is an actual posix/cygwin tcc 
> build supported.
>> After the 0.9.27 official release, I look forward to contributing
> development of a native posix cygwin tcc.
>> --Chris
>>
>> On 10/11/2017 19:14, Chris Marshall wrote:
>>> I was able to 'make' and 'make test' with the original win32/Makefile.  
>>> I got home and tried the "new" version building with cygwin and now 
>>> it doesn't pass tests because it says -run is not valid for a cross 
>>> compiler.
>>>
>>> I think this is a bug since tcc does not have a posix version for 
>>> cygwin so while tcc is built with a cross compiler, if you are 
>>> running tcc on windows (built with cygwin or otherwise) then you 
>>> have a
>>> *windows* tcc not a "cross-compiler".
>>>
>>> But,.... the win32/Makefile worked like a charm and all tests pass 
>>> with a simple build.
>>>
>>> Cheers,
>>> Chris
>>>
>>>
>>> On 10/11/2017 12:20, grischka wrote:
>>>> grischka wrote:
>>>>> avih wrote:
>>>>>> Two things:
>>>>>> 1. Will the version be 0.9.27 or 0.9.28? 
>>>>> 0.9.27.
>>>>>
>>>>>> 2. On windows in msys2 mingw 64 environment with gcc 7.2.0, 
>>>>>> (building tcc 64 for windows with mingw gcc 64) the build 
>>>>>> completes but some tests fail (see below).
>>>> Now, I fixed that, plus the ARM signed char test, plus some other 
>>>> stuff.
>>>>
>>>> Also, I removed the win32/Makefile (thanks to Christian's OK), and 
>>>> the VIP patch (it is just not how it should work), and the 
>>>> -iwithprefix option (what was the point without -iprefix).
>>>>
>>>> Moreover, there is
>>>> * a patch to tccelf.c to avoid DT_TEXTREL unless really required
>>>> * a nifty one in tccasm.c to avoid the 'p3' forward label from
>>>>   alloca86_64.S being put into dynsym with a relocation (huh?)
>>>> * and the (sig)set variable in tcctest.c was made static to
>>>>   avoid some issue with inline asm that I didn't try to fix
>>>> * no diff -I option anymore to make tests work with busybox
>>>> * a patch to tccrun.c for better selinux support.
>>>>
>>>> With these changes, tcc now seems to build and pass all tests 
>>>> cleanly on Alpine musl x86_64 standard-grsec and vanilla too, 
>>>> configured
> with
>>>>    ./configure --config-musl --with-selinux optionally also with
>>>>    --disable-static and/or --cc=tcc (once it was installed)
>>>>
>>>> Patch is here:
>>>> http://repo.or.cz/tinycc.git/commitdiff/da8c62f75d893449e232944fc62
>>>> 5
>>>> 6
>>>> 6c020b4d010
>>>>
>>>>
>>>> You might realize that I bumped the 'master' branch too, which is 
>>>> meant to mean:
>>>>     "This could be what we could release as 0,9,27, soon"
>>>>
>>>> Say next week or so, last-minute-fixes/features notwithstanding.
>>>>
>>>> Thanks,
>>>>
>>>> -- gr
>>>>
>>>> _______________________________________________
>>>> Tinycc-devel mailing list
>>>> address@hidden
>>>> https://lists.nongnu.org/mailman/listinfo/tinycc-devel
>>
>> _______________________________________________
>> Tinycc-devel mailing list
>> address@hidden
>> https://lists.nongnu.org/mailman/listinfo/tinycc-devel
>>
>>
>> _______________________________________________
>> Tinycc-devel mailing list
>> address@hidden
>> https://lists.nongnu.org/mailman/listinfo/tinycc-devel
>>
> 
> 
> _______________________________________________
> Tinycc-devel mailing list
> address@hidden
> https://lists.nongnu.org/mailman/listinfo/tinycc-devel
> 
> 
> _______________________________________________
> Tinycc-devel mailing list
> address@hidden
> https://lists.nongnu.org/mailman/listinfo/tinycc-devel
> 






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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]