[MacPorts] #45851: port should scan for DYLIB missing the TWOLEVEL flag

MacPorts noreply at macports.org
Fri Nov 14 12:18:37 PST 2014


#45851: port should scan for DYLIB missing the  TWOLEVEL flag
------------------------------------+--------------------------------
  Reporter:  howarth.at.macports@…  |      Owner:  macports-tickets@…
      Type:  enhancement            |     Status:  new
  Priority:  Normal                 |  Milestone:
 Component:  base                   |    Version:
Resolution:                         |   Keywords:
      Port:                         |
------------------------------------+--------------------------------

Comment (by howarth.at.macports@…):

 Replying to [comment:2 larryv@…]:
 > Is is always safe to assume that this state is an error?

 Yes, this is an indicator that either a broken libtool.m4 was used to
 generate the configure files...

 http://lists.gnu.org/archive/html/libtool-patches/2014-09/msg00002.html

 or the software is just erroneously forcing the use of "-flat_namespace"
 with -dynamiclib which is unconventional and can cause runtime issues...

 http://trac.sagemath.org/ticket/17204?cversion=0&cnum_hist=5

 The output from 'otool -hv' can be used to detect this flaw...

 % otool -hv /opt/local/lib/libfftw3.3.dylib
 /opt/local/lib/libfftw3.3.dylib:
 Mach header
       magic cputype cpusubtype  caps    filetype ncmds sizeofcmds
 flags
 MH_MAGIC_64  X86_64        ALL  0x00       DYLIB    14       1704
 NOUNDEFS DYLDLINK TWOLEVEL NO_REEXPORTED_DYLIBS

 where the absence of the "TWOLEVEL" flag in combination with the presence
 of the "DYLIB" filetype is a marker for the use of -flat_namespace.
 Rather than trying to parse out the filetype field, each shared library
 file can be checked with the 'file' command to verify that it isn't a
 bundle
 and for those non-bundle shared libraries, an warning emitted if the
 output of 'otool -hv' for that filename doesn't contain "TWOLEVEL". [[BR]]
 [[BR]]
 The fink project has made the same type of shared library test for -flat-
 namespace a fatal packaging error.

-- 
Ticket URL: <https://trac.macports.org/ticket/45851#comment:4>
MacPorts <https://www.macports.org/>
Ports system for OS X


More information about the macports-tickets mailing list