<html>
    <head>
      <base href="https://bugs.webkit.org/" />
    </head>
    <body>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Undefined reference to `environ' when linking libgtest.so on FreeBSD"
   href="https://bugs.webkit.org/show_bug.cgi?id=138420#c9">Comment # 9</a>
              on <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Undefined reference to `environ' when linking libgtest.so on FreeBSD"
   href="https://bugs.webkit.org/show_bug.cgi?id=138420">bug 138420</a>
              from <span class="vcard"><a class="email" href="mailto:lantw44&#64;gmail.com" title="Ting-Wei Lan &lt;lantw44&#64;gmail.com&gt;"> <span class="fn">Ting-Wei Lan</span></a>
</span></b>
        <pre>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:
<a href="http://svn.freebsd.org/base/releng/10.1/lib/csu/amd64/crt1.c">http://svn.freebsd.org/base/releng/10.1/lib/csu/amd64/crt1.c</a>

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


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.</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are on the CC list for the bug.</li>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>