-
-
Notifications
You must be signed in to change notification settings - Fork 418
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
Add ability to default enable PIC when compiling ponyc #2113
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems reasonable to me, though I don't necessarily have as much context on this issue as some others, so I'll let someone else merge.
More than 1 person has requested this. This is nice. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we also have a --nopic
option for ponyc to disable position-independent code even for force_pic
builds? That seems more flexible to me. If we do take that route I think force_pic
should be renamed to default_pic
as it better conveys the meaning.
@Praetonus Having If others agree that adding |
I feel like |
This commit allows folks compiling from source (for packaging or for their own use) to easily specify that `ponyc` should by default compile programs using Position Independent Code (PIC). The main driving force behind this is a smoother user experience for folks on distributions where PIC is enabled by default so they don't have to always remember to pass `--pic` to `ponyc` when compiling programs. Alpine Edge is one such example. With this change, packaging for Alpine Edge is as simple as `make default_pic=true` and then users of `ponyc` on Alpine Edge don't need to be aware of PIC being enabled by default at all and don't have to remember to pass `--pic` to every invocation of `ponyc`. This commit also adds the ability to specify `--nopic` to disable PIC if `ponyc` was compiled with `default_pic=true`. NOTE: This does not change the default behavior of `ponyc` when not compiling with `default_pic=true` and it is mainly a convenience meant to be used only when the person compiling knows that the toolset being used (gcc on a distro with PIC enabled by default) will cause issues otherwise.
Makes sense. PR updated to add |
@Praetonus does this look good to you? |
This commit allows folks compiling from source (for packaging or
for their own use) to easily specify that
ponyc
should alwayscompile programs using Position Independent Code (PIC). The main
driving force behind this is a smoother user experience for folks
on distributions where PIC is enabled by default so they don't
have to always remember to pass
--pic
toponyc
when compilingprograms. Alpine Edge is one such example. With this change,
packaging for Alpine Edge is as simple as
make force_pic=true
and then users of
ponyc
on Alpine Edge don't need to be awareof PIC being enabled by default at all and don't have to remember
to pass
--pic
to every invocation ofponyc
.NOTE: This does not change the default behavior of
ponyc
whennot compiling with
force_pic=true
and it is mainly a conveniencemeant to be used only when the person compiling knows that the
toolset being used (gcc on a distro with PIC enabled by default)
will cause issues otherwise.
@ponylang/core This is related to #1811 and #1484 where alternate solutions have been discussed. Hopefully this is an acceptable compromise until the longer term solutions previously discussed can be implemented.