-
Notifications
You must be signed in to change notification settings - Fork 360
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
FreeBSD with LLVM backend: Link error for symbols environ and __progname #501
Comments
Can you know which DSO references 'environ' ? It is not a problem to add these symbols on freebsd, we I'd like to fully understand the issue first. |
Linking without --export-dynamic did not change it. Indeed
And it is mentioned in the FreeBSD libc source code aswell, in
Just adding
to the global section of grt.ver does the trick. |
On 19 Dec 2017, at 23:03, Martin Åberg ***@***.***> wrote:
Linking without --export-dynamic did not change it.
Indeed /lib/libc.so.7 references both environ and __progname which is defined in /usr/lib/crt1.o:
I suppose there must be another reference or an option that trigger this error, as libc is linked in every program.
Have you tried to link without --export-dynamic and grt.ver ?
Just adding
__progname;
environ;
to the global section of grt.ver does the trick.
This could be done in src/grt/Makefile.inc
|
with I tried to follow the linking dependencies with the linker Similar issue in 2015:
I tried it with the vests tests and it passes. |
Similar issue in 2015:
http://ghdl-discuss.gna.narkive.com/ezVsU0Rk/ghdl-0-32rc1-problem-on-freebsd-10-1
The patch proposed in that thread was:
src/grt/Makefile.inc
ifeq ($(filter-out netbsd freebsd% dragonfly%,$(osys)),)
- GRT_EXTRA_LIB=-lm $(GRT_ELF_OPTS)
+ GRT_EXTRA_LIB=-lm
endif
I tried it with the vests tests and it passes.
What about the gna testsuite ? It contains a couple of VPI tests that require grt.ver on linux.
|
I close this issue; any pull request is welcome. |
GHDL with the LLVM back-end builds nicely on FreeBSD 11.1. However, using the generated GHDL does not work out of the box: the linker fails at elaboration.
The problem described in this issue can be solved by adding
environ
and__progname
tosrc/grt/grt.ver
. I choose to add an issue rather than a pull request, since I don't have full understanding of the behavior, and there might be better solutions.The text was updated successfully, but these errors were encountered: