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

tcc errors #2329

Closed
bogen85 opened this issue Oct 13, 2019 · 15 comments
Closed

tcc errors #2329

bogen85 opened this issue Oct 13, 2019 · 15 comments
Labels
Bug This tag is applied to issues which reports bugs.

Comments

@bogen85
Copy link
Member

bogen85 commented Oct 13, 2019

V version:

V 0.1.21 b1806b5

OS:

Linux 5.3.5-arch1-1-ARCH #1 SMP PREEMPT 2019 x86_64 GNU/Linux

What did you do?

v up

What did you expect to see?

v to be updated.

What did you see instead?
`
Updating V...
From https://github.com/vlang/v

Background

Over the past day I've updated several times.
Normally I got some tcc errors after I went to use after an update.
Doing an rm -rf /var/tmp/tcc/ after the issues would allow me to use v again.
Now (I've tried it several times), it won't update.

I understand this may be a duplicate, but I could not find this specific tcc error here.

I already had tcc installed on my system and was already using it. I removed it to see if these errors would go away, but they did not. (I've been using v less than 24 hours).

@bogen85 bogen85 added the Bug This tag is applied to issues which reports bugs. label Oct 13, 2019
@spytheman
Copy link
Member

spytheman commented Oct 13, 2019

For a temporary workaround, try:

export VFLAGS='-cc /your/working/bin/tcc'

or even simply

export VFLAGS='-cc tcc'

Please, do tell the result of locate crt1.o (the path is important, so that we can build a tcc that works on most distros).

@spytheman
Copy link
Member

Also, thank you for the bug report.

@bogen85
Copy link
Member Author

bogen85 commented Oct 13, 2019

yeah, well, that update works (with the export)

Updating V...
From https://github.com/vlang/v
branch master -> FETCH_HEAD
Already up to date.
Current branch master is up to date.
make: Entering directory '/home/dwight/scratch/v/v'
rm -rf vc/
git clone --depth 1 --quiet https://github.com/vlang/vc
rm -rf /var/tmp/tcc/
git clone --depth 1 --quiet https://github.com/vmisc/tccbin /var/tmp/tcc
cc -std=gnu11 -w -o v vc/v.c -lm
Self rebuild (b1806b5 => 61af044)
rm -rf vc/
V has been successfully built
make: Leaving directory '/home/dwight/scratch/v/v'

however, when I go to use it, now I get:

v/vlib/builtin/array.v:183:13: ->cap is immutable
182| if arr.cap == 0 {

183| arr.data = calloc(cap * arr.element_size)

         			   ^

184| }

185| else {

As far as my tcc:

$ pacman -Qs tcc local/tcc 0.9.27-3 Tiny C Compiler

and location of crt1.o

/usr/lib/Mcrt1.o /usr/lib/Scrt1.o /usr/lib/crt1.o /usr/lib/gcrt1.o /usr/lib/grcrt1.o /usr/lib/rcrt1.o /usr/lib32/Mcrt1.o /usr/lib32/Scrt1.o /usr/lib32/crt1.o /usr/lib32/gcrt1.o /usr/lib32/grcrt1.o /usr/lib32/rcrt1.o

@bogen85
Copy link
Member Author

bogen85 commented Oct 13, 2019

If I export VFLAGS='-cc clang' then I get past that issue, but now I have other issues (array code that was working before is not working now), I'll see if there is another bug report for that.

@cloutiy
Copy link

cloutiy commented Oct 13, 2019

Just to confirm, I also get similar issue on arch linux.

The output of running "make":

rm -rf vc/
git clone --depth 1 --quiet https://github.com/vlang/vc
rm -rf /var/tmp/tcc/
git clone --depth 1 --quiet https://github.com/vmisc/tccbin /var/tmp/tcc
cc -std=gnu11 -w -o v vc/v.c -lm
Self rebuild (b1806b5 => 61af044)
tcc: error: file 'crt1.o' not found
tcc: error: file 'crti.o' not found
tcc: error: file 'crtn.o' not found
V error: C error. This should never happen. Please create a GitHub issue: https://github.com/vlang/v/issues/new/choose
make: *** [Makefile:26: all] Error 1

@damontic
Copy link

As this was dependant on a pull request in https://github.com/vmisc/tccbin that was merged 40 minutes ago, it is not happening anymore in my Arch Linux machine. Please confirm @bogen85 @cloutiy

@cloutiy
Copy link

cloutiy commented Oct 14, 2019

@damontic All seems fine for me now, thanks!

@medvednikov
Copy link
Member

medvednikov commented Oct 14, 2019

Huge thanks to @spytheman for fixing it!

What's your time v v.v? For me it's 0.25s :)

@bogen85
Copy link
Member Author

bogen85 commented Oct 14, 2019

@damontic it is fixed for me as well. Thanks!

@bogen85 bogen85 closed this as completed Oct 14, 2019
@bogen85
Copy link
Member Author

bogen85 commented Oct 14, 2019

@medvednikov where is this supposed to be run?
time v compiler
V error: compiler doesn't exist!

real 0m0.018s
user 0m0.008s
sys 0m0.011s

@medvednikov
Copy link
Member

@bogen85 v up

@bogen85
Copy link
Member Author

bogen85 commented Oct 14, 2019

@medvednikov alright... I'm in the directory v is cloned in...

$ v up
Updating V...
From https://github.com/vlang/v
branch master -> FETCH_HEAD
Already up to date.
Current branch master is up to date.
make: Entering directory '/home/dwight/scratch/v/v'
rm -rf vc/
git clone --depth 1 --quiet https://github.com/vlang/vc
rm -rf /var/tmp/tcc/
git clone --depth 1 --quiet https://github.com/vlang/tccbin /var/tmp/tcc
cc -std=gnu11 -w -o v vc/v.c -lm
rm -rf vc/
V has been successfully built
make: Leaving directory '/home/dwight/scratch/v/v'

$ time v compiler
V error: compiler doesn't exist!

real 0m0.020s
user 0m0.013s
sys 0m0.007s
``

@medvednikov
Copy link
Member

@bogen85 the command changed:

v v.v :)

@medvednikov
Copy link
Member

I need to update the docs, thanks

@bogen85
Copy link
Member Author

bogen85 commented Oct 14, 2019

@medvednikov
no problem

$ time v v.v

real 0m0.639s
user 0m0.465s
sys 0m0.137s

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug This tag is applied to issues which reports bugs.
Projects
None yet
Development

No branches or pull requests

5 participants