-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
on OSX, the -fstatic flag should be ignored (or not static link crt0 ) #6771
Comments
Yes, I don't think fully static linking is possible on macOS. But making the effect of |
Very true! You could have that flag also set some cpp flag if on osx and
have a cpp stanza somewhere that has
Ifdef cabal flag static enabled && OS X
#error “unconditional static linking of everything on OS X is not currently
supported, reconfigure your cabal build without -fstatic flag selected”
What do you think ?
…On Mon, Oct 26, 2020 at 12:13 AM John MacFarlane ***@***.***> wrote:
Yes, I don't think fully static linking is possible on macOS.
But making the effect of static flag conditional seems wrong also; we
don't want people thinking that they succeeded in doing a static build when
the flag is silently ignored.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#6771 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAABBQWWBAME6Q7JB3OSZXDSMTZQJANCNFSM4S53PLFQ>
.
|
What about setting Buildable to False if static is selected on macOS? |
anything is definitely better than what it currently does, honestly whatever you feel happiest with, i do think some sort of feedback is better than flags silently being accepted which have never worked before |
I've used the buildable: False approach.
But if I'm not mistaken, that can be done now by using the option
Not sure that's all necessary; I think Will reopen in case anyone wants to comment. |
Ld options static does soemthing very different from building a static
Haskell executable. So if cabal static executable does what you want ...
the ld flag certainly doesn’t ...
I think.
…On Wed, Nov 18, 2020 at 5:48 PM John MacFarlane ***@***.***> wrote:
I've used the buildable: False approach.
But now that I look at it, is there a point to having the 'static' flag
any more? All it does is set
ld-options: -static
But if I'm not mistaken, that can be done now by using the option
--enable-executable-static with cabal (or executable-static: true in
project file). If not, it's always possible to set the linker options on
the command line. (With stack, I think that's the only way.) Currently to
make our static build we us
cabal v2-configure --enable-tests -f-export-dynamic -fstatic -fembed_data_files --enable-executable-static --ghc-options '-optc-Os -optl=-pthread -split-sections' pandoc
Not sure that's all necessary; I think -fstatic is redundant with
--enable-executable-static, and even if it wasn't, we could just add
another -optl=-static to the list.
Will reopen in case anyone wants to comment.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#6771 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAABBQQM6V55NLPK3QB7MATSQRMLRANCNFSM4S53PLFQ>
.
|
Really? The docs for |
woops, i stand corrected! (looked at the cabal docs)
also i'm not sure how that'd work on some platforms, but definitely looks
to be a better fix than the current stuff :)
…On Wed, Nov 18, 2020 at 6:05 PM John MacFarlane ***@***.***> wrote:
Really? The docs for --enable-executable-static say:
"Build fully static executables. This links all dependent libraries into
executables statically, including libc. "
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#6771 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAABBQQRKUBHBMBZBEIE7DDSQROLFANCNFSM4S53PLFQ>
.
|
I think I'll just remove the static flag. |
while having a go at building pandoc with
-fstatic -fembed_data_files
i realized that the former isn't setup correctly / may never work on osx?
it seems like theres a bug / design flaw in
-fstatic
is doneedit: looking at the .cabal file
unconditional -static is definitely wrong
The text was updated successfully, but these errors were encountered: