<div dir="ltr"><div dir="ltr"><div class="gmail_default" style="font-family:courier new,monospace;font-size:large">Hi, <br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Jan 24, 2019 at 4:00 AM Peng Yu via cfe-dev <<a href="mailto:cfe-dev@lists.llvm.org">cfe-dev@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi,<br>
<br>
I have the following trace.c file compiled with the following command<br>
with clang.<br>
<br>
$ clang -Wall -pedantic -c -o trace.o trace.c<br>
$ ar cr  libtrace.a trace.o<br>
$ ranlib libtrace.a<br>
<br>
Then, I run configure from a GNU package, which gives the following<br>
error. It asks to recompile the .a with -fPIC. Is it because gcc and<br>
clang has different default on whether -fPIC is enabled? Could anybody<br>
help explain why there is such a difference? Thanks.<br>
<br>
configure:3772: gcc -g -finstrument-functions<br>
-L/root/linux/bin/wrappercomposite/src/xplat/llvmxplat/src/mkvar/bin/Linux<br>
conftest.c -ltrace >&5<br>
/usr/bin/ld: /root/linux/bin/wrappercomposite/src/xplat/llvmxplat/src/mkvar/bin/Linux/libtrace.a(trace.o):<br>
relocation R_X86_64_32S against `.bss' can not be used when making a<br>
PIE object; recompile with -fPIC<br>
/usr/bin/ld: final link failed: Nonrepresentable section on output<br>
<br clear="all"></blockquote></div><br><div style="font-family:courier new,monospace;font-size:large" class="gmail_default">What happens if you run this command with clang instead of gcc ?<br><br></div><div style="font-family:courier new,monospace;font-size:large" class="gmail_default">Csaba</div>-- <br><div dir="ltr" class="gmail_signature">You can get very substantial performance improvements <br>by not doing the right thing. - Scott Meyers, An Effective C++11/14 Sampler<br>So if you're looking for a completely portable, 100% standards-conformat way<br>to get the wrong information: this is what you want. - Scott Meyers (C++TDaWYK) <br></div></div>