Skip to content

Linux: link libvips with -Bsymbolic-functions #60

Closed

Description

@kleisauke

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(?)).

Activity

  1. changed the title [-]Linux: experiment with linking libvips with -Bsymbolic-functions[/-] [+]Linux: experiment linking libvips with -Bsymbolic-functions[/+] on Sep 4, 2020
  2. lovell commented on Sep 4, 2020

    @lovell
    Owner

    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.

  3. changed the title [-]Linux: experiment linking libvips with -Bsymbolic-functions[/-] [+]Linux: link libvips with -Bsymbolic-functions[/+] on Sep 5, 2020
  4. kleisauke commented on Sep 5, 2020

    @kleisauke
    CollaboratorAuthor

    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 
    
  5. added a commit that references this issue on Sep 8, 2020
    c4e3a67
  6. reopened this on Sep 8, 2020
  7. lovell commented on Sep 8, 2020

    @lovell
    Owner

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

  8. mceachen commented on Sep 16, 2020

    @mceachen

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions