Re: [Tinycc-devel] tcc -ar c inserts wrong size

2022-12-27 Thread Herman ten Brugge via Tinycc-devel

On 12/28/22 03:20, noneofyourbusiness wrote:

it incorrectly reports 51 in the created index instead of 52 bytes when 
inserting attached daemonize.o (plan9port libthread compiled for musl)
i.e.
tcc -ar c libthread.a daemonize.o
ar t daemonize.o


Just fixed it.
tcc -ar t should now work.

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


Re: [Tinycc-devel] Large files causes infinite loop on mac

2022-12-27 Thread Herman ten Brugge via Tinycc-devel

On 12/27/22 07:58, Herman ten Brugge wrote:

On 12/27/22 05:45, Levo D wrote:
I'm messing around with tcc. I don't need this to be fixed, I just 
thought someone may want the report. I'm trying to figure out how 
fast the tcc backend is for my compiler.
I seem to hit an infinite loop on mac osx venture. I built tcc 
earlier this month (Dec 2022). I suspect it's an overflow bug. Here's 
how to reproduce, on linux x86-64 it errors out at a smaller number.


Run the following python script (I copied it below) 
https://bolinlang.com/genc.py


python3 ./genc.py 220 4

Create object files then try to link. It'll loop forever

tcc -c *.c
tcc *.o

You can try building it straight which will build but won't execute

$ tcc *.c
$ ./a.out
dyld[4330]: dyld cache '(null)' not loaded: syscall to map cache into 
shared region failed

dyld[4330]: Library not loaded: /usr/lib/libSystem.B.dylib
   Referenced from:  /private/tmp/t/test/a.out
   Reason: tried: '/usr/lib/libSystem.B.dylib' (no such file), 
'/System/Volumes/Preboot/Cryptexes/OS/usr/lib/libSystem.B.dylib' (no 
such file), '/usr/lib/libSystem.B.dylib' (no such file, no dyld 
cache), '/usr/local/lib/libSystem.B.dylib' (no such file)

Abort trap: 6

Using a smaller number everything works fine. I'll repeat that I'm 
just playing around and don't need this to work. Here's a copy paste 
of the python script

I fixed the forever loop.
The code now compiles but does not run. I get:

dyld[74088]: dyld cache 
'/System/Library/dyld/dyld_shared_cache_arm64e' not loaded: syscall to 
map cache into shared region failed

dyld[74088]: Library not loaded: '/usr/lib/libSystem.B.dylib'
  Referenced from: '/Users/hermantb/tinycc/tst/a.out'
  Reason: tried: '/usr/lib/libSystem.B.dylib' (no such file), 
'/usr/local/lib/libSystem.B.dylib' (no such file)

Abort trap: 6

Probably because the bss section is larger then 4G.

I also tried to compile you code with gcc/clang on fedora(x86_64) and 
also get overflow reports when compiling.

So probably there is a limit some where. I did not check.

So if gcc/clang cannot compile the code tcc can fail as well.



I updated the python script. I can now run:

$ python3 ./genc.py 1 100
$ tcc -bench -c *.c
* 78156 idents, 1157015 lines, 28090333 bytes
* 91.295 s, 12673 lines/s, 0.3 MB/s
* text 11784304, data.rw 0, data.ro 0, bss 400 bytes
$ tcc -bench *.o
* 0 idents, 0 lines, 1 bytes
* 3.383 s, 0 lines/s, 0.0 MB/s
* text 0, data.rw 0, data.ro 0, bss 0 bytes

updated lines in script:
29c29
< file.write(f"\tstatic int array[{nextFunctionIndex}];\n")
---
> file.write(f"\tstatic int 
array[{nextFunctionIndex-functionStartIndex}];\n")

33c33
< r = math.floor(random.random()*nextFunctionIndex)
---
> r = 
math.floor(random.random()*(nextFunctionIndex-functionStartIndex))





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


Re: [Tinycc-devel] randomly failing tests

2022-12-27 Thread Vincent Lefevre
On 2022-12-27 08:30:52 +0100, Herman ten Brugge via Tinycc-devel wrote:
> Are you using parallel build?

Yes, I have a shell function "make" that uses the -j option
(with the number of available cores).

> This does not work for the testsuite .

If this doesn't work for the testsuite, why not disabling the parallel
build of the testsuite?

-- 
Vincent Lefèvre  - Web: 
100% accessible validated (X)HTML - Blog: 
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)

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