New Ticket     Wiki     Browse Source     Timeline     Roadmap     Bug Reports     Search

Ticket #15750 (closed defect: fixed)

Opened 12 months ago

Last modified 2 months ago

build libxml2 with two-level namespace

Reported by: ricci@… Owned by: ricci@…
Priority: Normal Milestone:
Component: ports Version: 1.6.0
Keywords: Cc: cedric.luthi@…, ryandesign@…, rene@…
Port:

Description

Attached patch makes libxml2 build with two-level namespace (at least for me, on 10.5.3 x86). This will likely fix the problems reported in tickets #14063 and #15263.

Attachments

libxml2.fixTwoLevel.diff (0.6 KB) - added by ricci@… 12 months ago.
patch file for libxml2 Portfile

Change History

Changed 12 months ago by ricci@…

patch file for libxml2 Portfile

  Changed 12 months ago by jmr@…

  • cc cedric.luthi@… added
  • milestone set to Port Bugs

Cc maintainer.

  Changed 12 months ago by cedric.luthi@…

Wow, seems like magic :-) Can you please point out exactly what is the consequence of re-running the autotools that solves tickets #14063 and #15263 ? Have you done a diff of the produced configure and Makefiles that would explain what is fixed ?

  Changed 12 months ago by ricci@…

Well, it is related to auto*/configure/libtool, so it is kinda magic (the dark kind...). Something in the libxml2 package (sorry, I'm not remembering what it was for libxml2, been diving into too many different packages recently) doesn't understand which rev. of Mac OS X (darwin) its running on (and doesn't seem to pick up MACOSX_DEPLOYMENT_TARGET to know), so sets -flat_namespace. This results in binaries linked against MP libxml2 that will pull in both MP libxml2 (via the linking they have) and the system-installed libxml2 (via other libs they use, including system frameworks). Then while running the binary will call functions in the "wrong" libxml2, resulting in crashes. Redoing the autoconf stuff teaches/fixes "it" (configure or libtool I think) to not include -flat_namespace, and all is good. You can check if a dylib is built with two-level namespace with:

otool -hv PATH/TO/LIBRARY

and look in the 'flags' section, there should be a 'TWOLEVEL' word in there if it was built with two-level namespace.

-eric

  Changed 12 months ago by cedric.luthi@…

Thanks for the explanation Eric. Except for the misalignment of "yes" and "autoreconf", the patch is OK for me ;-)

  Changed 12 months ago by ricci@…

Err, 'misalignment' of "yes" and "autoreconf"? Are you saying you'd like the autoreconf.cmd line to be above the use_autoconf line? I can commit the fix if you'd like, let me know.

  Changed 12 months ago by ricci@…

  • owner changed from macports-tickets@… to ricci@…
  • status changed from new to assigned

follow-up: ↓ 10   Changed 12 months ago by ricci@…

  • status changed from assigned to closed
  • resolution set to fixed

committed patch as-is in r38015, please let me know if something should be changed ('misalignment' ?)

  Changed 12 months ago by jmr@…

The misalignment referred to is that the right hand column in the autoconf.cmd and use_autoconf lines is two spaces to the left of the right hand columns in the rest of the file.

  Changed 12 months ago by ricci@…

Ah. Fixed in r38022 (as I said there: (no, I don't know how I didn't see that before, thnx to those who pointed it out))

in reply to: ↑ 7   Changed 12 months ago by ryandesign@…

Replying to ricci@macports.org:

committed patch as-is in r38015

This fixed #15263 as well.

  Changed 12 months ago by ricci@…

  • status changed from closed to reopened
  • resolution fixed deleted

Just helped somebody out w/ building libxml2 - they didn't have libtool installed by macports, and the libxml2 build failed (configure was all sorts of unhappy). Installing libtool (from MP) resolved the problem. Unless there's an objection, I'll add a dependency on libtool to libxml2.

  Changed 12 months ago by cedric.luthi@…

I think libtool should be installed and/or updated by MacPorts itself when a port has use_autoconf yes. I thought it was the case, but it was not (cf your previous message and #15900).

  Changed 12 months ago by ricci@…

  • status changed from reopened to closed
  • resolution set to fixed

fixed in r38175

  Changed 12 months ago by cedric.luthi@…

Wow, not that many time to object. ;-) But in the mean time, adding the dependency is indeed a good idea!

  Changed 12 months ago by ricci@…

Well, it was mostly your clearance I was looking for. With another ticket open on it, no rebuild issues (revision bump or anything like that), and it fixes a build problem for people, it seemed like the right idea. We can always back it out if there's a problem with it.

  Changed 12 months ago by cedric.luthi@…

Yes sure, it was the right thing to do for now. I just meant that ports using use_autoconf yes should not have to explicitly also declare depends_build port:libtool because this should be handled by MacPorts itself. We should file another ticket for that.

  Changed 11 months ago by ryandesign@…

  • cc ryandesign@… added
  • status changed from closed to reopened
  • resolution fixed deleted

I don't know whether libxml2 needs a dependency on libtool. I know that it does need a  build-time dependency on port:autoconf since you're now using the autoreconf command that the autoconf port provides.

  Changed 11 months ago by ryandesign@…

  • status changed from reopened to closed
  • resolution set to fixed

Changed the dependency from libtool to autoconf in r39322.

  Changed 11 months ago by rene@…

  • status changed from closed to reopened
  • resolution fixed deleted

I just installed libxml2 with a fresh MP installation. The port libxml2 failed to build due to the lack of libtool related macros for autoconf. Installing port:libtool fixed it. I think the libtool dependency is required since it provides share/aclocal/libtool.m4.

  Changed 11 months ago by rene@…

  • cc rene@… added

CC me!

  Changed 10 months ago by ryandesign@…

Sorry about that. I won't be able to readd the libtool dependency until tomorrow night. If someone else can commit the change before then, please do.

  Changed 10 months ago by rene@…

  • status changed from reopened to closed
  • resolution set to fixed

Committed in r39551.

  Changed 2 months ago by anonymous

  • milestone Port Bugs deleted

Milestone Port Bugs deleted

Note: See TracTickets for help on using tickets.