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

Explicitly add -fPIC for static library #39

Closed
wants to merge 1 commit into from
Closed

Explicitly add -fPIC for static library #39

wants to merge 1 commit into from

Conversation

gjtorikian
Copy link

I'm not very well acquainted with how cmake works. Many resources online indicate that -fPIC is set by default when building a static library.

However, I'm finding that's not the case. When trying to natively calls some Houdini methods in gjtorikian/commonmarker#5, the CI runs into linking issues. Setting this flag explicitly resolves these issues.

Perhaps when COMPILE_FLAGS is redefined it overrides the default -fPIC setting?

@gjtorikian
Copy link
Author

CMAKE_C_FLAGS worked for me.

@gjtorikian gjtorikian closed this May 27, 2015
@gjtorikian gjtorikian deleted the add-fpic branch May 27, 2015 21:14
@omasanori
Copy link
Contributor

Debian 8.x (jessie) with CMake 3.0.2 was released, so we can use POSITION_INDEPENDENT_CODE now, or we should wait until Debian 7.x EOL (2016-04-25)?
(BTW, we have already required 2.8.9, so it should be available AFAIK)

@jgm
Copy link
Member

jgm commented Jul 16, 2015

It looks like you can conditionalize on cmake version.
http://www.cmake.org/cmake/help/v3.0/variable/CMAKE_VERSION.html
So maybe we could add the feature if the user has a recent enough cmake to support it?

@jgm
Copy link
Member

jgm commented Jul 16, 2015

Ah, you're right, we are requiring 2.8.9 now. So, no reason not to just add this.

jgm added a commit that referenced this pull request Jul 16, 2015
PKRoma pushed a commit to PKRoma/cmark that referenced this pull request Aug 19, 2018
A UBSAN warning can be triggered when handling a long sequence of backticks:

src/commonmark.c:98:20: runtime error: left shift of 1 by 31 places cannot be represented in type 'int'

which can be triggered by:

```
| a | b |
| --- | --** `c```````````````````````````````- |
| c | `|d` \| e |
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants