in reply to XML::LibXML fails install on macOS Big Sur

??What is output of ldd -v /Users/root/.cpanm/work/1607108755.33137/XML-LibXML-2.0206/blib/arch/auto/XML/LibXML/LibXML.bundle

?? or otool -L /Users/root/.cpanm/work/1607108755.33137/XML-LibXML-2.0206/blib/arch/auto/XML/LibXML/LibXML.bundle

  • Comment on Re: XML::LibXML fails install on macOS Big Sur

Replies are listed 'Best First'.
Re^2: XML::LibXML fails install on macOS Big Sur
by Skalef (Initiate) on Jan 12, 2021 at 15:14 UTC

    Hi,

    this is my first post ;-)

    I'm a reader for nearly 20 years now, perhaps i can help today ;-)

    Anyhow, the problem originates from the fact, that BigSur provides a native

    XML Library and therefore the cc compiler will always favor the local libxml which differs from the version homebrew is providing.

    homebrew version: '20904'

    Big sur version: '20910'

    How you can get it working: (Assuming you have perl-5.3.32 homebrew package installed)

    1.) install the gcc homebrew package !

    2.) Extract the source

    3.) perl Makefile.PL

    4.) Edit the Makefile

    Change these lines:

    Change the CC binary

     CC = gcc

    Change the LD binary

     LD = gcc

    Change the LDDFLAGS to:

    LDDLFLAGS = -L/usr/local/opt/libxml2/lib -L/usr/local/lib/perl5/5.32.0 +/darwin-thread-multi-2level/CORE -mmacosx-version-min=10.15 -bundle - +fstack-protector- strong -lxml2 -lperl

    Change the LDFLAGS to

    LDFLAGS = -L/usr/local/opt/libxml2/lib -L/usr/local/lib/perl5/5.32.0/darwin-thread-multi-2level/CORE -mmacosx-version-min=10.15 -fstack-protector-strong -lxml2 -lperl

    Change the INC Path to

    INC = -I/usr/local/opt/libxml2/include

    Change the PASSTHROUGH INC

    PASTHRU_INC='-I/usr/local/opt/libxml2/include $(PASTHRU_INC)'

    Then build:

    make

    Check using otool:

    $otool -L blib/arch/auto/XML/LibXML/LibXML.bundle blib/arch/auto/XML/LibXML/LibXML.bundle: /usr/local/opt/libxml2/lib/libxml2.2.dylib (compatibility version +12.0.0, current version 12.10.0) /usr/local/opt/perl/lib/perl5/5.32.0/darwin-thread-multi-2level/CO +RE/libperl.dylib (compatibility version 5.32.0, current version 5.32. +0) /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current v +ersion 1292.60.1) /usr/local/lib/gcc/10/libgcc_s.1.dylib (compatibility version 1.0. +0, current version 1.0.0)
    make test

    (3 tests will fail because the tests favor the native libs, so don't mind

     make install

    Best regards

    Franz

      Welcome to the Monastery!

      This is rather impressive for a first post. Great job, and nice to have you aboard!

        Thx for the flowers,

        but see it as a workaround until the XS bindings have been updated to the newer version of XML::LibXML.

        Apple plugs all the system libs into libSystem so CC will always favor the builtin libs.

        Kind regards Franz