Skip to content
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 support #9284

Closed
FalseDev opened this issue Mar 13, 2021 · 6 comments
Closed

ARM support #9284

FalseDev opened this issue Mar 13, 2021 · 6 comments
Labels
Feature Request This issue is made to request a feature.

Comments

@FalseDev
Copy link

The linux executable is x86 only, I received this error on trying to run it on a raspberry pi

Failed to execute process './v'. Reason:
exec: Exec format error
The file './v' is marked as an executable but could not be run by the operating system.

Trying to build from source bugged out for some reason and tried tcc.exe on a linux machine

make fresh_vc
make[1]: Entering directory '/home/falsedev/v'
rm -rf ./vc
git clone --depth 1 --quiet --single-branch https://github.com/vlang/vc ./vc
make[1]: Leaving directory '/home/falsedev/v'
cd ./vc && git clean -xf && git pull --quiet
cd ./thirdparty/tcc && git clean -xf && git pull --quiet
cc  -g -std=gnu99 -w -o ./v ./vc/v.c -lm -lpthread 
./v self
failed    cmd: "/home/falsedev/v/v"  -g "/home/falsedev/v/cmd/tools/vself.v"
failed   code: 1
V panic: sh: line 1: /home/falsedev/v/thirdparty/tcc/tcc.exe: cannot execute binary file: Exec format error
builder error: 
==================
C error. This should never happen.

If you were not working with C interop, this is a compiler bug, please raise an issue on GitHub:

https://github.com/vlang/v/issues/new/choose

You can also use #help on Discord: https://discord.gg/vlang


                                                        | 0xaaaac5e2a4e0 | ./v(+0x2a4e0) 
                                                        | 0xaaaac5e56d08 | ./v(+0x56d08) 
                                                        | 0xaaaac5f2e540 | ./v(+0x12e540) 
                                                        | 0xaaaac5f39bf8 | ./v(+0x139bf8) 
                                                        | 0xffffa70b7538 | /usr/lib/libc.so.6(__libc_start_main+0xe8) 
                                                        | 0xaaaac5e021e8 | ./v(+0x21e8) 
make: *** [Makefile:86: all] Error 1
@FalseDev FalseDev added the Feature Request This issue is made to request a feature. label Mar 13, 2021
@refrogerator
Copy link
Contributor

the file is only called tcc.exe, it is still an ELF executable
the problem might be that it downloaded the x86_64 version of tcc

@FalseDev
Copy link
Author

the file is only called tcc.exe, it is still an ELF executable
the problem might be that it downloaded the x86_64 version of tcc

Will installing tcc from my system package manager prevent the installer from doing this.

I also already have gcc and g++ installed and on PATH as well

@spaceface777
Copy link
Member

try setting the env variable VFLAGS to -cc gcc.

Will installing tcc from my system package manager prevent the installer from doing this.

Not really - it'll make tcc actually run, but our tcc version contains patches that are most likely not in the system package so you'll hit other errors instead.

@FalseDev
Copy link
Author

make fresh_vc
make[1]: Entering directory '/home/falsedev/v-weekly.2021.10'
rm -rf ./vc
git clone --depth 1 --quiet --single-branch https://github.com/vlang/vc ./vc
make[1]: Leaving directory '/home/falsedev/v-weekly.2021.10'
cd ./vc && git clean -xf && git pull --quiet
make fresh_tcc
make[1]: Entering directory '/home/falsedev/v-weekly.2021.10'
rm -rf ./thirdparty/tcc
git clone --depth 1 --quiet --single-branch --branch thirdparty-linux-arm64 https://github.com/vlang/tccbin ./thirdparty/tcc
make[1]: Leaving directory '/home/falsedev/v-weekly.2021.10'
cd ./thirdparty/tcc && git clean -xf && git pull --quiet
cc  -g -std=gnu99 -w -o ./v ./vc/v.c -lm -lpthread 
./v self
failed    cmd: "/home/falsedev/v-weekly.2021.10/v"  -g "/home/falsedev/v-weekly.2021.10/cmd/tools/vself.v"
failed   code: 1
V panic: V panic: as cast: cannot cast `unknown` to `v.table.Interface`
                                                        | 0xaaaadd2d978c | /home/falsedev/v-weekly.2021.10/v(+0x1978c) 
                                                        | 0xaaaadd39218c | /home/falsedev/v-weekly.2021.10/v(+0xd218c) 
                                                        | 0xaaaadd3aafb8 | /home/falsedev/v-weekly.2021.10/v(+0xeafb8) 
                                                        | 0xaaaadd38fb30 | /home/falsedev/v-weekly.2021.10/v(+0xcfb30) 
                                                        | 0xaaaadd38e8dc | /home/falsedev/v-weekly.2021.10/v(+0xce8dc) 
                                                        | 0xaaaadd3e1b04 | /home/falsedev/v-weekly.2021.10/v(+0x121b04) 
                                                        | 0xaaaadd3e1c58 | /home/falsedev/v-weekly.2021.10/v(+0x121c58) 
                                                        | 0xaaaadd3e20d8 | /home/falsedev/v-weekly.2021.10/v(+0x1220d8) 
                                                        | 0xaaaadd3e9408 | /home/falsedev/v-weekly.2021.10/v(+0x129408) 
                                                        | 0xaaaadd3ef150 | /home/falsedev/v-weekly.2021.10/v(+0x12f150) 
                                                        | 0xaaaadd3f9f74 | /home/falsedev/v-weekly.2021.10/v(+0x139f74) 
                                                        | 0xffffaf361538 | /usr/lib/libc.so.6(__libc_start_main+0xe8) 
                                                        | 0xaaaadd2c21e8 | /home/falsedev/v-weekly.2021.10/v(+0x21e8) 

                                                        | 0xaaaab1d4a59c | ./v(+0x2a59c) 
                                                        | 0xaaaab1d76a7c | ./v(+0x56a7c) 
                                                        | 0xaaaab1e4e868 | ./v(+0x12e868) 
                                                        | 0xaaaab1e59f74 | ./v(+0x139f74) 
                                                        | 0xffff99042538 | /usr/lib/libc.so.6(__libc_start_main+0xe8) 
                                                        | 0xaaaab1d221e8 | ./v(+0x21e8) 
make: *** [Makefile:86: all] Error 1

A different error with the environment variable set and using the weekly release version.

What I noticed:

  • make: *** [Makefile:86: all] Error 1 that it isn't identifying my machine correctly.
  • And from cd ./thirdparty/tcc && git clean -xf && git pull --quiet it seems like it's still trying tcc but it's not an exe now

@medvednikov
Copy link
Member

we will provide arm64 tcc builds soon

@shadowninja55
Copy link
Member

https://github.com/vlang/tccbin/tree/thirdparty-linux-arm64

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature Request This issue is made to request a feature.
Projects
None yet
Development

No branches or pull requests

5 participants