tinycc-devel
[Top][All Lists]
Advanced

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

Re: [Tinycc-devel] riscv64 feedback


From: Michael Matz
Subject: Re: [Tinycc-devel] riscv64 feedback
Date: Tue, 26 May 2020 20:21:50 +0200 (CEST)
User-agent: Alpine 2.21 (LSU 202 2017-01-01)

Hello,

On Tue, 26 May 2020, Christian Jullien wrote:

Tcc is configured with: ./configure --with-selinux

Does it work without selinux? I've not tried that for riscv, my qemu userspace (debian) isn't selinux enabled, and as the symptom you see is related to mapping executable memory that might be it.

While compiling tcc (2020-05-mob) I get very few warnings:

tccrun.c:844:2: warning: #warning add arch specific rt_get_caller_pc()
[-Wcpp]

#warning add arch specific rt_get_caller_pc()

Yeah, that's by intention to remind us that some functionality is missing (riscv64 qemu user-linux emulation is unfortunately incorrect in one aspect of setting up the signal frame, so implementing the above needs to be done on real hardware, or at least on a full kernel emulation, which I don't often have access to).

riscv64-gen.c: In function ‘load_symofs’:

riscv64-gen.c:161:71: warning: format ‘%llx’ expects argument of type ‘long
long unsigned int’, but argument 2 has type ‘uint64_t’ {aka ‘long unsigned
int’} [-W

format=]

               tcc_error("unimp: large addend for global address (0x%llx)",
sv->c.i);

Ah, that's more recent, since tcc_warning/tcc_error got printf-like format checking. Fixed in mob.

But test suite unfortunately fails because of map memory error.

Please note that I was also unable to mmap OpenLisp memory on this VM but, in this case, OpenLisp uses malloc.

If it's not just selinux but generic mmap() that doesn't quite work on this type of VM then tcc -run can't be used. Even if we were to fallback to malloc we still would need to be able to mark the allocated memory as executable, and if mmap doesn't work then mprotect most probably doesn't work either.

If it's only selinux we probably can find a way, so please first test if tcc starts working without.


Ciao,
Michael.

reply via email to

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