[CMake] Why is -fPIE added to my build?

Schlottke, Michael M.Schlottke at aia.rwth-aachen.de
Tue Jan 21 04:05:00 EST 2014


Hi everyone,

We use CMake to create the build files for our C++ research code. We compile all source files directly into one executable and then link statically to a couple of external libraries.

However, I noticed that CMake adds the '-fPIE' flag to the compilation flags without me asking for it. When I set up a simple dummy C++ CMake project, no '-fPIE' was added to the compilation flags. Do you know what could cause this flag to be added? As far as I know, the -fPIE/-fPIC flags require one additional register to be used for the code locations, thus rendering the code slightly less efficient.

Regards,

Michael


--
Michael Schlottke

SimLab Highly Scalable Fluids & Solids Engineering
Jülich Aachen Research Alliance (JARA-HPC)
RWTH Aachen University
Wüllnerstraße 5a
52062 Aachen
Germany

Phone: +49 (241) 80 95188
Fax: +49 (241) 80 92257
Mail: m.schlottke at aia.rwth-aachen.de<mailto:m.schlottke at aia.rwth-aachen.de>
Web: http://www.jara.org/jara-hpc

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20140121/22679118/attachment.html>


More information about the CMake mailing list