Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compile your code with -fPIC or -fPIE #34

Closed
drizt opened this issue Apr 29, 2019 · 4 comments
Closed

Compile your code with -fPIC or -fPIE #34

drizt opened this issue Apr 29, 2019 · 4 comments
Labels

Comments

@drizt
Copy link
Contributor

drizt commented Apr 29, 2019

I try to build my project with Travis. But with Qt5 there is such error. On my local machine no any problems. Travis has CMake 3.9.2.

@nanoant
Copy link
Owner

nanoant commented Apr 30, 2019

There some explicit handling for -fPIC introduced by @mick-p1982 and POSITION_INDEPENDENT_CODE property is not carried over to PCH target for some reason.

@mick-p1982 Do you remember what was the issue with POSITION_INDEPENDENT_CODE?

@nanoant nanoant assigned nanoant and unassigned nanoant Apr 30, 2019
@nanoant nanoant added the bug label May 1, 2019
@nanoant
Copy link
Owner

nanoant commented May 1, 2019

This is somewhat similar (but not duplicate) to #23. We need to ensure that we properly copy CMAKE_CXX_COMPILE_OPTIONS_PIC to CXXPCH in order to make PIC generation working for PCH.
I try to work on it in near future.

@m-7761
Copy link
Contributor

m-7761 commented May 1, 2019

The high-level feature CMake offers for PIC just don"t get processed normally... CMake must add it later in the pipeline. I"ve never heard of PIE; but I"m sure it can be added. I"m not offering. The PIC variable is injected near the bottom of the main script file.

I should add that the feature isn"t about setting the "-fPIC" flag manually. It"s about the platform-independent feature provided by CMake.

@nanoant
Copy link
Owner

nanoant commented May 3, 2019

Fixed in e17969b

@nanoant nanoant closed this as completed May 3, 2019
nanoant added a commit that referenced this issue May 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants