On Thu, 2021-04-22 at 11:35 -0500, Peng Yu wrote: > On Thu, Apr 22, 2021 at 11:31 AM Xi Ruoyao <xry111@xxxxxxxxxxxxxxxx> > wrote: > > > > On Thu, 2021-04-22 at 11:22 -0500, Peng Yu wrote: > > > These options are quite confusing. I have a hard time > > > understanding > > > the difference they are. Can anybody have a clear explanation (not > > > just how they are used, but also the underlying reasons why it is > > > so) > > > for them? > > > > > > -fpic -fPIC -fpie -fPIE > > > > -fpic and -fPIC has some differences on several architectures, but > > not > > on x86 (32-bit or 64-bit). For the details run "man gcc" in your > > terminal. > > > > Generally, when you get any questions about a command line parameter > > for > > a program named "foo" (for example), you should at first invoke "man > > foo". > > The man is not well written in this and is confusing. It also doesn't > explain the underlying details. If you don't have experience working on a non-x86 platform, you can just consider -fPIC same as -fpic, and -fPIE same as -fpie. Otherwise, the man page is very clear to anyone with such an experience. -- Xi Ruoyao <xry111@xxxxxxxxxxxxxxxx> School of Aerospace Science and Technology, Xidian University