v icon indicating copy to clipboard operation
v copied to clipboard

Compilation fails with bad architecture warning

Open ktrace opened this issue 3 years ago • 3 comments

V full version: V 0.2.4 0699f32 OS: linux, Linux version 5.15.29-calculate (root@localhost) (gcc (Gentoo 11.2.1_p20220115 p4) 11.2.1 20220115, GNU ld (Gentoo 2.37_p1 p2) 2.37) #1 SMP PREEMPT Thu Mar 17 13:22:02 UTC 2022

'./v' -cg -W -o '2048' 'examples/2048/2048.v'

Expect to see normal compiling

See: tmp/v_1001/2048.4357934880370255081.tmp.c:24174: warning: assignment discards qualifiers from pointer target type /lib/libc.so.6: error: bad architecture tcc: error: referenced dll 'libc.so.6' not found /lib/libm.so.6: error: bad architecture tcc: error: /usr/lib64/libm.so: unrecognized file type 0 /usr/lib/libm.so: error: bad architecture /lib/libc.so.6: error: bad architecture tcc: error: referenced dll 'libc.so.6' not found /usr/lib/libXau.so.6: error: bad architecture tcc: error: referenced dll 'libXau.so.6' not found /usr/lib/libxcb.so.1: error: bad architecture tcc: error: referenced dll 'libxcb.so.1' not found /usr/lib/libX11.so: error: bad architecture tcc: error: library 'X11' not found builder error: C error. This should never happen.

ktrace avatar May 06 '22 20:05 ktrace

$ file /lib/libc.so.6
/lib/libc.so.6: ELF 32-bit LSB shared object, Intel 80386, version 1 (GNU/Linux), dynamically linked, interpreter /lib/ld-linux.so.2, for GNU/Linux 3.2.0, stripped

but:

$ file /lib64/libc.so.6
/lib64/libc.so.6: ELF 64-bit LSB shared object, x86-64, version 1 (GNU/Linux), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 3.2.0, stripped

Seems need better lib's detection

ktrace avatar Sep 14 '22 12:09 ktrace

Try compiling with your platform's gcc, i.e. try passing -cc gcc too.

spytheman avatar Sep 14 '22 14:09 spytheman

It's 'make check' after clone repo and 'make'. look like need ./v -cc gcc test-all, but "-cc gcc" just ignored.

ktrace avatar Sep 14 '22 15:09 ktrace

Can you please, explicitly run this exact command: ./v -cc gcc examples/2048/2048.v, and report if it works?

If it works, please also report the results of: gcc -print-search-dir

spytheman avatar Nov 22 '22 14:11 spytheman

Can you please, explicitly run this exact command: ./v -cc gcc examples/2048/2048.v, and report if it works?

Silently build without any warning, executable run successfully.

If it works, please also report the results of: gcc -print-search-dir

$ gcc -print-search-dirs установка: /usr/lib/gcc/x86_64-pc-linux-gnu/11.3.0/ программы: =/usr/libexec/gcc/x86_64-pc-linux-gnu/11.3.0/:/usr/libexec/gcc/x86_64-pc-linux-gnu/11.3.0/:/usr/libexec/gcc/x86_64-pc-linux-gnu/:/usr/lib/gcc/x86_64-pc-linux-gnu/11.3.0/:/usr/lib/gcc/x86_64-pc-linux-gnu/:/usr/lib/gcc/x86_64-pc-linux-gnu/11.3.0/../../../../x86_64-pc-linux-gnu/bin/x86_64-pc-linux-gnu/11.3.0/:/usr/lib/gcc/x86_64-pc-linux-gnu/11.3.0/../../../../x86_64-pc-linux-gnu/bin/ библиотеки: =/usr/lib/gcc/x86_64-pc-linux-gnu/11.3.0/:/usr/lib/gcc/x86_64-pc-linux-gnu/11.3.0/../../../../x86_64-pc-linux-gnu/lib/x86_64-pc-linux-gnu/11.3.0/:/usr/lib/gcc/x86_64-pc-linux-gnu/11.3.0/../../../../x86_64-pc-linux-gnu/lib/../lib64/:/usr/lib/gcc/x86_64-pc-linux-gnu/11.3.0/../../../x86_64-pc-linux-gnu/11.3.0/:/usr/lib/gcc/x86_64-pc-linux-gnu/11.3.0/../../../../lib64/:/lib/x86_64-pc-linux-gnu/11.3.0/:/lib/../lib64/:/usr/lib/x86_64-pc-linux-gnu/11.3.0/:/usr/lib/../lib64/:/usr/lib/gcc/x86_64-pc-linux-gnu/11.3.0/../../../../x86_64-pc-linux-gnu/lib/:/usr/lib/gcc/x86_64-pc-linux-gnu/11.3.0/../../../:/lib/:/usr/lib/

ktrace avatar Nov 22 '22 14:11 ktrace