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

Linux: link libvips with -Bsymbolic-functions #60

Closed
kleisauke opened this issue Sep 4, 2020 · 4 comments · Fixed by #62
Closed

Linux: link libvips with -Bsymbolic-functions #60

kleisauke opened this issue Sep 4, 2020 · 4 comments · Fixed by #62

Comments

@kleisauke
Copy link
Collaborator

See kleisauke@41fb70c and kleisauke/net-vips#90 for context. Could possibly resolve lovell/sharp#575 (and other node-canvas related issues).

GLib uses this linker flag by default, so it might make sense to also link libvips with this flag. The above NetVips issue had no issues running this on macOS, so I'm not sure if this flag is needed there as well (Homebrew also seems to avoid any -Bsymbolic* linker flags, probably due to missing support for this in Xcode(?)).

@kleisauke kleisauke changed the title Linux: experiment with linking libvips with -Bsymbolic-functions Linux: experiment linking libvips with -Bsymbolic-functions Sep 4, 2020
@lovell
Copy link
Owner

lovell commented Sep 4, 2020

Nice idea, happy for a PR if you're able. This is an ELF-only feature so should be ignored by linkers for e.g. macOS targets.

@kleisauke kleisauke changed the title Linux: experiment linking libvips with -Bsymbolic-functions Linux: link libvips with -Bsymbolic-functions Sep 5, 2020
@kleisauke
Copy link
Collaborator Author

Great, I'll prepare a PR.

Ah, you're right, this linker flag only applies to ELF binaries and not to Mach-O, for example. I got confused since HarfBuzz seems to configure successfully with -Bsymbolic-functions on macOS, see:

C++ compiler for the host machine: clang++ (clang 11.0.3 "Apple clang version 11.0.3 (clang-1103.0.32.62)")
C++ linker for the host machine: clang++ ld64 556.6
Host machine cpu family: x86_64
Host machine cpu: x86_64
Compiler for C++ supports link arguments -Bsymbolic-functions: YES 

kleisauke added a commit to kleisauke/libvips-packaging that referenced this issue Sep 8, 2020
@lovell lovell closed this as completed in #62 Sep 8, 2020
@lovell lovell reopened this Sep 8, 2020
@lovell
Copy link
Owner

lovell commented Sep 8, 2020

(Re-opening auto-closed issue until we publish a new release.)

@mceachen
Copy link

mceachen commented Sep 16, 2020

At @lovell's suggestion, I've just opened electron/electron#25495 (which may help other native modules).

Please tell me if I should edit the issue in any way to clarify or fix and mistakes.

@lovell lovell closed this as completed Oct 14, 2020
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 a pull request may close this issue.

3 participants