tinycc-devel
[Top][All Lists]
Advanced

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

[Tinycc-devel] riscv64 feedback


From: Christian Jullien
Subject: [Tinycc-devel] riscv64 feedback
Date: Tue, 26 May 2020 07:43:56 +0200

For Michael,

 

Again, many thanks for riscv64 backend.

I finally found a way to give riscv64 a try … and it is again from Fabrice Bellard solution using jslinux online VM.

 

For that I use the fedora29 risvc64 vm in text mode and raised to 1Gb:

https://bellard.org/jslinux/vm.html?cpu=riscv64&url="">

 

It is very slow but it works well.

 

I started with gcc and my own projects. Now it’s the tcc turn (please be sure I don’t ask you anything to support tcc on this VM).

 

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

 

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()

  ^~~~~~~

gcc -o riscv64-gen.o -c riscv64-gen.c -DCONFIG_LDDIR="\"lib64\"" -DHAVE_SELINUX -DTCC_TARGET_RISCV64       -DONE_SOURCE=0 -Wall -O2 -Wdeclaration-after-statemen

t -fno-strict-aliasing -Wno-pointer-sign -Wno-sign-compare -Wno-unused-result -Wno-format-truncation -I.

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);

                                                                    ~~~^    ~~~~~~~

                                                                    %lx

 

It produces a valid tcc binary which allows me to make “Hello World” compile and run.

 

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.

 

[root@localhost tinycc]# make test

make[1]: Entering directory '/root/tinycc/tests'

------------ hello-exe ------------

Hello World

------------ hello-run ------------

tcc: error: tccrun: could not map memory

+ ../tcc -vv

tcc version 0.9.27 (riscv64 Linux)

install: /usr/local/lib/tcc

include:

  /usr/local/lib/tcc/include

  /usr/local/include

  /usr/include

libraries:

  /usr/lib64

  /lib64

  /usr/local/lib64

libtcc1:

  /usr/local/lib/tcc/libtcc1.a

crt:

  /usr/lib64

elfinterp:

  /lib/ld-linux-riscv64-lp64d.so.1

+ ldd ../tcc

        linux-vdso.so.1 (0x000000200001d000)

        libm.so.6 => /lib64/lp64d/libm.so.6 (0x0000002000030000)

        libpthread.so.0 => /lib64/lp64d/libpthread.so.0 (0x00000020000cf000)

        libdl.so.2 => /lib64/lp64d/libdl.so.2 (0x00000020000eb000)

        libc.so.6 => /lib64/lp64d/libc.so.6 (0x00000020000f0000)

        /lib/ld-linux-riscv64-lp64d.so.1 (0x0000002000000000)

+ exit 1

make[2]: *** [Makefile:82: hello-run] Error 1

make[1]: *** [Makefile:74: all] Error 2

make[1]: Leaving directory '/root/tinycc/tests'

make: *** [Makefile:378: test] Error 2


reply via email to

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