[cfe-dev] Why -fno-pic and -fPIC gives the same results?

Peng Yu via cfe-dev cfe-dev at lists.llvm.org
Thu Jan 24 08:08:11 PST 2019


> On many targets the instructions needed for an empty function won't
> need to refer to an address at all, so will always be position
> independent, hence no difference in code-generation. If you make the
> example a bit more complex, such as using a global variable then
> you'll see some code-generation differences between -fPIC and
> -fno-pic.

Could you help make a minimal example? I used some global variables.
But the results are still the same. Thanks.

-- 
Regards,
Peng


More information about the cfe-dev mailing list