-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ARM Raspberry pi - "Illegal instruction" #19457
Comments
Can you get a newer version of gcc? That one is... quite old. |
|
|
I think the problem is in
I don't think so, |
Yes, but there are other features V uses that weren't added until gcc-9.3, I believe. Latest version is, of course, 13.2. |
Without
|
In both cases, you're using gcc. The only difference is when the code is optimized, it works. |
But why? Adding -cflags -O3 without prod flag don't work. |
V adds more than |
It's tcc issue. |
If you wish, go ahead, even though you showed it failing with gcc above. |
Describe the bug
$ cat test.v
fn main() {
println ( 'hello wolrd!' )
}
$ v test.v
$ test
Illegal instruction
$ file test
test: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux-armhf.so.3, for GNU/Linux 3.2.0, BuildID[sha1]=bf8649fddea99dfa24b3181c9e481ef975b27354, not stripped
Reproduction Steps
$ v test.v
$ test
Expected Behavior
Generate valid binary
Current Behavior
After executing generated binary got error message "Illegal instruction"
Possible Solution
$ v -prod test.v
$ test
hello wolrd!
Additional Information/Context
No response
V version
V 0.4.1 981f76c
Environment details (OS name and version, etc.)
$ v doctor
Illegal instruction
$ uname -a
Linux raspberrypi 5.10.103+ #1529 Tue Mar 8 12:19:18 GMT 2022 armv6l GNU/Linux
$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/arm-linux-gnueabihf/8/lto-wrapper
Target: arm-linux-gnueabihf
Configured with: ../src/configure -v --with-pkgversion='Raspbian 8.3.0-6+rpi1' --with-bugurl=file:///usr/share/doc/gcc-8/README.Bugs --enable-languages=c,ada,c++,go,d,fortran,objc,obj-c++ --prefix=/usr --with-gcc-major-version-only --program-suffix=-8 --program-prefix=arm-linux-gnueabihf- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-bootstrap --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-libitm --disable-libquadmath --disable-libquadmath-support --enable-plugin --with-system-zlib --with-target-system-zlib --enable-objc-gc=auto --enable-multiarch --disable-sjlj-exceptions --with-arch=armv6 --with-fpu=vfp --with-float=hard --disable-werror --enable-checking=release --build=arm-linux-gnueabihf --host=arm-linux-gnueabihf --target=arm-linux-gnueabihf
Thread model: posix
gcc version 8.3.0 (Raspbian 8.3.0-6+rpi1)
Note
You can vote for this issue using the 👍 reaction. More votes increase the issue's priority for developers.
Take into account that only the 👍 reaction counts as a vote.
Only reactions to the issue itself will be counted as votes, not comments.
The text was updated successfully, but these errors were encountered: