[Webkit-unassigned] [Bug 138420] Undefined reference to `environ' when linking libgtest.so on FreeBSD

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Jul 7 11:05:47 PDT 2015


https://bugs.webkit.org/show_bug.cgi?id=138420

--- Comment #5 from Ting-Wei Lan <lantw44 at gmail.com> ---
(In reply to comment #4)
> Comment on attachment 256294 [details]
> Patch
> 
> This bug should probably be fixed upstream and

The upstream project doesn't have this problem because they don't use -Wl,--no-undefined.

> the fix should probably not leave symbols unresolved.

I leave it unresolved because I can't find other ways to solve the problem. The environ symbol doesn't exist in any shared library, so it can't be resolved by adding -l arguments. I also tried to add crt1.o to the linking arguments, but it also doesn't work.

If I use /usr/lib/crt1.o:
ld: /usr/lib/crt1.o: relocation R_X86_64_32 against `_DYNAMIC' can not be used when making a shared object; recompile with -fPIC
/usr/lib/crt1.o: error adding symbols: Bad value
clang++: error: linker command failed with exit code 1 (use -v to see invocation)

If I use /usr/lib/gcrt1.o:
ld: /usr/lib/gcrt1.o: relocation R_X86_64_32 against `_DYNAMIC' can not be used when making a shared object; recompile with -fPIC
/usr/lib/gcrt1.o: error adding symbols: Bad value
clang++: error: linker command failed with exit code 1 (use -v to see invocation)

If I use /usr/lib/Scrt1.o:
/usr/lib/Scrt1.o: In function `_start':
/usr/src/lib/csu/amd64/crt1.c:(.text+0xa4): undefined reference to `__preinit_array_start'
ld: /usr/lib/Scrt1.o: relocation R_X86_64_PC32 against undefined hidden symbol `__preinit_array_start' can not be used when making a shared object
ld: final link failed: Bad value
clang++: error: linker command failed with exit code 1 (use -v to see invocation)

-- 
You are receiving this mail because:
You are on the CC list for the bug.
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.webkit.org/pipermail/webkit-unassigned/attachments/20150707/1f8ec73d/attachment.html>


More information about the webkit-unassigned mailing list