tinycc-devel
[Top][All Lists]
Advanced

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

Re: [Tinycc-devel] bounds checking


From: Christian Jullien
Subject: Re: [Tinycc-devel] bounds checking
Date: Tue, 10 Dec 2019 10:34:24 +0100

Herman,
The error is not from gcc but because the printf format was not correct when 
printing long long:

#define pv(m) printf(sizeof (s->m + 0) == 8 ? "%llx\n" : "%x\n", s->m)

Fixes the issue. If you agree I can push this change.

-----Original Message-----
From: Tinycc-devel [mailto:tinycc-devel-bounces+eligis=address@hidden] On 
Behalf Of Herman ten Brugge via Tinycc-devel
Sent: Tuesday, December 10, 2019 09:09
To: address@hidden; address@hidden
Cc: Herman ten Brugge
Subject: Re: [Tinycc-devel] bounds checking

Oops. You reported 2 problems. The second one I cannot fix because the 
gcc compiler on arm has a bug.

When tcctest.gcc is run on arm the output is (last 2 lines):
0a
0000000000000000
When running this code on x86_64 the output is:
0a
0000000000000014

The x86_64 output is correct.

Perhaps we could disable this test on arm?

Regards,

     Herman


On 2019-12-10 08:47, Herman ten Brugge wrote:
> I hope I fixed this now.
>
> I attached the wine Makefile I used. Could you update sourceforge?
>
> Regards,
>
>     Herman
>
> On 2019-12-10 08:35, Christian Jullien wrote:
>> Hello Herman,
>>
>> === Compiling with your patch on ARM (32bit) gives this error:
>> ------------ test3 ------------
>> ../tcc -B.. -I../include -I.. -I.. 
>> -DCONFIG_TRIPLET="\"arm-linux-gnueabihf\"" -DTCC_CPU_VERSION=7 
>> -DTCC_TARGET_ARM -DTCC_ARM_EABI -DTCC_ARM_HARDFLOAT -DTCC_ARM_VFP 
>> -run ../tcc.c -B.. -I../include -I.. -I.. 
>> -DCONFIG_TRIPLET="\"arm-linux-gnueabihf\"" -DTCC_CPU_VERSION=7 
>> -DTCC_TARGET_ARM -DTCC_ARM_EABI -DTCC_ARM_HARDFLOAT -DTCC_ARM_VFP 
>> -run ../tcc.c -B.. -I../include -I.. -I.. 
>> -DCONFIG_TRIPLET="\"arm-linux-gnueabihf\"" -DTCC_CPU_VERSION=7 
>> -DTCC_TARGET_ARM -DTCC_ARM_EABI -DTCC_ARM_HARDFLOAT -DTCC_ARM_VFP 
>> -run ../tcc.c -B.. -I../include -I.. -I.. -run tcctest.c > test.out3
>> --- test.ref    2019-12-10 08:31:02.487022330 +0100
>> +++ test.out3   2019-12-10 08:31:03.257006236 +0100
>> @@ -749,4 +749,4 @@
>>   attr: 7 7
>>   attr: 16 16
>>   0a
>> -0000000000000000
>> +0000000000000014
>> make[2]: *** [Makefile:106: test3] Error 1
>>
>>
>> === Compiling with your patch on Aarch64 (AMR64) gives this error:
>> make[1]: Entering directory '/home/jullien/tinycc/lib'
>> ../tcc -c lib-arm64.c -o lib-arm64.o -B.. -g 
>> -Wno-deprecated-declarations
>> ../tcc -c dsohandle.c -o dsohandle.o -B.. -g 
>> -Wno-deprecated-declarations
>> ../tcc -ar rcs ../libtcc1.a lib-arm64.o dsohandle.o
>> ../tcc -ar rcs ../libtccb1.a
>> usage: tcc -ar [rcsv] lib file...
>> create library ([abdioptxN] not supported).
>> make[1]: *** [Makefile:90: ../libtccb1.a] Error 1
>> make[1]: Leaving directory '/home/jullien/tinycc/lib'
>> make: *** [Makefile:246: libtcc1.a] Error 2
>>
>>
>> -----Original Message-----
>> From: Tinycc-devel 
>> [mailto:tinycc-devel-bounces+eligis=address@hidden] On Behalf 
>> Of Herman ten Brugge via Tinycc-devel
>> Sent: Tuesday, December 10, 2019 08:26
>> To: Herman ten Brugge via Tinycc-devel
>> Cc: Herman ten Brugge
>> Subject: [Tinycc-devel] bounds checking
>>
>> I just committed a large patch that fix a lot of bounds checking 
>> problems.
>>
>> I tested the bounds checking code now works on x86_64 and i386 on linux
>> and windows.
>> The test/tests2 directory can now be tested with -b enabled.
>>
>> There are a lot of changes (not complete):
>> - split up bcheck.c from libtcc1.a because I now use dl_sym to redirect
>> malloc and friends.
>>     This was needed because the malloc_hooks are not thread safe.
>>     When compiling with -b now the pthread and dl library are also 
>> included.
>> - Rewrote bcheck.c library to fix a lot of small problems.
>> - Add mmap/munmap support on linux.
>> - Updated tcc.1
>> - Added bound_main_arg to record argv on startup.
>> - Added support for x86_64 on windows.
>> - Moved tcc_add_bcheck from tccelf to i386/x86_64 code.
>> - Added 2 new testcases.
>> - Fixed a lot of bugs:
>>     - conversion problem code with double/long long.
>>     - in gen_bounded_ptr_add move save_regs to top.
>>     - alloca/vla fixes.
>>     - VT_LLOCAL problems when using bounds checking.
>>     - ...
>>
>> Regards,
>>
>>       Herman
>>
>>
>> _______________________________________________
>> 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]