-
Notifications
You must be signed in to change notification settings - Fork 354
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 configure option '--default-pic' to enable '-fPIC' by default #805
Conversation
@tgingold, I believe this is ready for reaview now. A test for this PR is available in #803. Running the script on Moreover, I think that #670 and #804 could be safely reverted with this PR, because the use cases are already covered with the now visible configure option; which is a much clearner solution, I think. |
I have a simple request: don't hijack enable-default-pie, just add a new option like enable-pic
|
I updated it, but I don't know if that is what you mean. EDIT Maybe you meant to add |
Thanks. I will adjust it a little bit so that libgrt is not built with -fpic by default. |
Currently, GHDL can be built as:
Then, sources must be analyzed with
-fPIC
in order to generate a PIE binary. E.g., in VUnit:This PR allows to simplify the commands above to:
CONFIG_OPTS="--enable-default-pie " \ ./dist/travis/build.sh -b llvm -p ghdl-llvm-fPIC
and
I.e., if GHDL is built with
--enable-default-pie
,-fPIC
is implicitly added (by default) to anyghdl -a
orghdl -e
command.This PR sets the default of variable
default_pie
inconfigure
tofalse
. It is enabled automatically if gcc was built withenable-default-pie
, as it is now. The new feature is that it can be explicitly set through--enable-default-pie
.However, this alone is not enough to achieve the desired result.
PIC_FLAGS
must be added toGRT_FLAGS
, in order to force all the objects inlibghdl.a
to be position independent.Note that I changed the values of
default_pie
fromno|yes
tofalse|true
, for coherency.