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

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Jul 10 05:36:11 PDT 2015


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

--- Comment #9 from Ting-Wei Lan <lantw44 at gmail.com> ---
crt1.o contains the entrypoint of a C program, _start function. _start function makes argc, argv, environ and possibly other initialization works, and calls main function. environ global variable is in crt1.o on FreeBSD.

crt1.c, the file containing _start function:
http://svn.freebsd.org/base/releng/10.1/lib/csu/amd64/crt1.c

ignore_init.c, the file included by crt1.c and containing environ variable:
http://svn.freebsd.org/base/releng/10.1/lib/csu/common/ignore_init.c


When using a C compiler driver to make an executable, crt1.o and other crt*.o files are automatically added to the linker arguments. This can be found by running 'cc -v'.

gtest doesn't link to it because it is a shared library. It is not an executable and it does not have a vaild entrypoint.

-- 
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/20150710/bbb49900/attachment.html>


More information about the webkit-unassigned mailing list