tinycc-devel
[Top][All Lists]
Advanced

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

Re: [Tinycc-devel] test failure on x86-64 linux


From: Henry Kroll
Subject: Re: [Tinycc-devel] test failure on x86-64 linux
Date: Mon, 06 Dec 2010 16:30:15 -0800

Added the -m32 option for cross compilers on x86_64 host. This should
make some odd multi-arch projects compile and might even be a step
towards compiling wine.

http://repo.or.cz/w/tinycc.git/commitdiff/bb7bb37fe2eb47a35edcb4a5d4de62c044aafabf

The -v options shows which program was called by -m32 option.

todo: -m64 option for 32 to invoke 64 bit cross, if available

The following tests ran:

----------------------Linux Tests-------------------------

$ ./configure --enable-cross && make
$ sudo make install

 #linux64 host -> win64 target
$ ./x86_64-win32-tcc -v -m32 win32/ex*/fib.c
tcc version 0.9.25
x86_64-win32-tcc->i386-win32-tcc # -m32 invokes i386-win32-tcc
$ file fib.exe
fib.exe: PE32 executable for MS Windows (console) Intel 80386 32-bit

 #linux64 host -> linux64 target
$ ./tcc -v -m32 -Iinclude -B./lib/i386 win32/ex*/fib.c
tcc version 0.9.25
tcc->i386-tcc                   # -m32 invokes i386-tcc
$ file a.out
fib.exe: PE32 executable for MS Windows (console) Intel 80386 32-bit

 #test for missing cross compiler
$ rm i386-win32-tcc /usr/bin/i386-win32-tcc
$ ./x86_64-win32-tcc -Wwarn -v -m32 -Bwin32 -I./include -Iwin32/include
win32/ex*/fib.c -Lwin32/lib -Llib/x86_64-win32
tcc version 0.9.25
x86_64-win32-tcc->i386-win32-tcc
tcc: error: cross compiler not found!

 #test for pebcak errors :)
$ sudo rm /usr/local/bin/i386-tcc
$ sudo ln -s /usr/local/bin/tcc /usr/local/bin/i386-tcc
$ file `which i386-tcc`
/usr/local/bin/i386-tcc: symbolic link to `/usr/local/bin/tcc'

$ ./i386-tcc -v -m32 -Iinclude -B./lib/i386 win32/ex*/fib.c
tcc version 0.9.25
i386-tcc->i386-tcc
tcc: warning: -m32 infinite loop prevented
-> win32/examples/fib.c
<- a.out

-----------------------Windows Tests------------------------

 (performed on Linux, using wine)

Note since we didn't "install it to windows" absolute link paths were
used to get libtcc1.a

$ ./configure --enable-mingw32 --enable-cross && make -j1

 #win32 host -> win64 target
$ wine x86_64-win32-tcc -v -m32 -Bwin32 -Iinclude -L. win32/ex*/fib.c
tcc version 0.9.25
x86_64-win32-tcc.exe->tcc.exe   # -m32 invokes tcc.exe
$ file fib.exe
fib.exe: PE32 executable for MS Windows (console) Intel 80386 32-bit

 #win64 host -> win32 target doesn't exist (use win32 host)





reply via email to

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