Open niansa opened 3 years ago
Confirmed; it works fine (musl&glibc) after installing gcc (probably also clang), but their templates are complicated enough that imho the easiest solution would be to depend on one or the other, even if it pulls in some unnecessary dependencies.
If you feel like doing some boring work:
Of course. if you wish not to lose your sanity, do the first step by hand, and then write a script to do the rest!!!
Could try glibc-devel
or musl-devel
.
Using a fresh install, this is what I got...
musl-devel
works, periodglibc-devel
makes "tcc -run" work, while linking works and complains about crt1.o:
$ tcc sleep.c
/usr/lib/crt1.o: error: Invalid relocation entry [14] '.rela.debug_info' @ 000004f6
tcc: error: file 'crt1.o' not found
$ ./a.out 3
# sleeps 3 seconds; ./a.out --help etc work
But that's a separate bug.
Hi, this is still broken and has been broken for quite a while now on VoidLinux glibc.
@hiltjo @niansa
It stayed broken because 99.9% of the people who install tcc also install gcc/clang, which happen to pull in the required dependency :)
Copy/paste the fix from gcc's template:
case "$XBPS_TARGET_MACHINE" in
*-musl) depends+=" musl-devel";;
*) depends+=" glibc-devel";;
esac
and submit a pull request (unless it's troublesome for some reason)
Hi,
Have you tested that fix on Void Linux glibc?
I've had gcc, clang and glibc-devel installed, so that's not the issue I think.
But even if it would be the solution then maybe it should be documented somewhere this file is required. Some distributions show such information when the package is installed (just an idea).
@hiltjo I tried it above in https://github.com/void-linux/void-packages/issues/30630#issuecomment-834266375 except that I tried it by installing musl/glibc void in qemu and installing musl-devel/glibc-devel by hand instead of fixing the template, but I expect that it should work.
@hiltjo wait, I believe we have a miscommunication...
My assumptions:
The template is the file used by the package manager to get the info it needs about the package, in this case its dependencies; adding the dependencies above in an empty install makes tcc work, and those lines are copy/pasted from gcc's dependencies, so adding them to the template (srcpkgs/tcc/template) should fix the bug.
If you or @niansa want to submit a PR, it's pretty much written for you; otherwise @ericonr can you add a "good first issue" label?
This is still broken on the glibc version. I have glibc-devel, clang and gcc installed...
@hiltjo Just to be sure we are seeing the same thing: on a glibc vm I see the crt1.o error and it works anyway, ie tcc helloworld.c && ./a.out
prints "hello world", is it the same for you?
Yeah, the binary seems to work.
The displayed errors are still: /usr/lib/crt1.o: error: Invalid relocation entry [14] '.rela.debug_info' @ 000004f6 tcc: error: file 'crt1.o' not found
@hiltjo The problem is that upstream hasn't made a release in the past years and the package is orphaned... meaning that I have no idea if the upstream is conservative ("every commit could be a release!") or more let's say experimental ("there's a good reason we haven't made a release..."); the latest commit doesn't have this problem (just tested in a vm), so go on, git bisect and submit a pr to fix the crt1.o issue as well.
Before you ask: the package works well enough for me as is, I only use tcc for scripts ("#! /usr/bin/tcc -run"), and that works fine even on void/glibc.
I don't think releases are planned anymore, the development model is a public git branch that basically anyone can send stuff into.
System
Void 5.11.17_1 x86_64 GenuineIntel notuptodate rrmFFF
tcc 0.9.27.20191027.1_1
Expected behavior
Executable file should be generated by tcc
Actual behavior
Steps to reproduce the behavior