[MacPorts] #44125: cmake needs to support building against / with a deployment target set (prevents libc++ support on Snow Leopard for cmake projects)

MacPorts noreply at macports.org
Mon Jul 21 11:10:56 PDT 2014


#44125: cmake needs to support building against / with a deployment target set
(prevents libc++ support on Snow Leopard for cmake projects)
---------------------------+--------------------------------
  Reporter:  mojca@…       |      Owner:  macports-tickets@…
      Type:  defect        |     Status:  closed
  Priority:  Normal        |  Milestone:
 Component:  ports         |    Version:
Resolution:  fixed         |   Keywords:
      Port:  cmake libcxx  |
---------------------------+--------------------------------

Comment (by mojca@…):

 I have found the old emails about why the extra SDK flags were needed for
 tex binaries. The software was using autotools to determine the
 properties.

 I first used just
 {{{
 export MACOSX_DEPLOYMENT_TARGET=10.4
 }}}
 on 64-bit 10.6, cross-compiling for PPC and i386 Tiger. But at some point
 (when updating to a newer version) this stopped working.

 The configure tests ended up with:
 {{{
 /* Define to 1 if you have the `stat64' function. */
 #define HAVE_STAT64 1
 }}}
 when they should have failed when compiling for Tiger.

 The test was trying to figure out if `start64()` worked. These were my own
 results:
 {{{
 > cat abc.c
 int main()
 {
         return stat64();
         return 0;
 }

 > gcc -arch i386 -mmacosx-version-min=10.4 abc.c
 [all goes fine]

 > gcc -arch i386 -mmacosx-version-min=10.4 -isysroot
 /Developer/SDKs/MacOSX10.4u.sdk abc.c
 Undefined symbols:
   "_stat64", referenced from:
       _main in ccl8dKsi.o
 ld: symbol(s) not found
 collect2: ld returned 1 exit status

 > gcc -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk abc.c
 ld: library not found for -lcrt1.10.6.o
 collect2: ld returned 1 exit status
 }}}

 The `configure` somehow concluded that `stat64` was supposed to work.

 At the end only `LDFLAGS="-arch $ARCH
 -L/Developer/SDKs/MacOSX10.4u.sdk/usr/lib $LDFLAGS"` solved the problem
 for me (to compile that particular software).

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


More information about the macports-tickets mailing list