<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Sep 29, 2015 at 1:42 AM, Douglas Katzman <span dir="ltr"><<a href="mailto:dougk@google.com" target="_blank">dougk@google.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><span class=""><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">I have two questions:<br>
1. How can I tell clang that these two files are under directory<br>
/opt/extra ? I don't mind write a simple patch to clang, of course,<br>
simpler solutions like build time options or command line options are<br>
much better.<br>
2. Since crtbegin.o/crtend.o are part of a compiler, why don't clang<br>
provide one itself ? Google results showed that these two files seem<br>
to be quite simple, are there any patent/copyright issues related ?<br></blockquote><div><br></div></span><div class="gmail_extra">1. Trying adding "-B/opt/extra" into your clang invocation.</div></div></div></div></blockquote><div>Haven't tried this solution, I'll try it tonight. I figured out one myself: add -DGCC_INSTALL_PREFIX=/opt/extra to cmake will fix this problem. I'm not sure whether it's a hack or standard.<br> <br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div>2. The crt begin/end files are considered part of the standard library, not the compiler.</div></div></div></div>
</blockquote></div>I don't think so, if it's part of the standard, why every GCC installation has a copy of crtbegin/crtend ? I also tried musl libc (<a href="http://www.musl-libc.org">www.musl-libc.org</a>) it installs files like crt1.o, crti.o, crtn.o but *not* crtbegin.o/crtend.o<br></div></div>