How to get a universal build of libstdcxx

Alex Reynolds alexpreynolds at gmail.com
Mon Mar 25 13:00:55 PDT 2013


After modifying the gcc47 Portfile to prevent deletion of the static libstdc++ library, I rebuilt the libstdcxx dependency, adding the "+universal" variant modifier in order to get a libstdc++ library that can be used on 32- and 64-bit systems.

However, after the build step completed, the lipo tool reports that the resulting library is not universal. 

Here is a transcript of what steps I followed after the Portfile modification:

$ sudo port -n upgrade --force libstdcxx +universal
--->  Computing dependencies for libstdcxx
--->  Cleaning libstdcxx
--->  Unable to uninstall libstdcxx @4.7.2_2+universal, the following ports depend on it:
--->    gcc45 @4.5.4_6
--->    gcc47 @4.7.2_2+universal
Warning: Uninstall forced.  Proceeding despite dependencies.
--->  Deactivating libstdcxx @4.7.2_2+universal
--->  Unable to deactivate libstdcxx @4.7.2_2+universal, the following ports depend on it:
--->    gcc45 @4.5.4_6
--->    gcc47 @4.7.2_2+universal
Warning: Deactivate forced.  Proceeding despite dependencies.
--->  Cleaning libstdcxx
--->  Uninstalling libstdcxx @4.7.2_2+universal
--->  Cleaning libstdcxx
--->  Computing dependencies for libstdcxx
--->  Fetching archive for libstdcxx
--->  Attempting to fetch libstdcxx-4.7.2_2+universal.darwin_12.i386-x86_64.tbz2 from http://packages.macports.org/libstdcxx
--->  Attempting to fetch libstdcxx-4.7.2_2+universal.darwin_12.i386-x86_64.tbz2 from http://mse.uk.packages.macports.org/sites/packages.macports.org/libstdcxx
--->  Attempting to fetch libstdcxx-4.7.2_2+universal.darwin_12.i386-x86_64.tbz2 from http://lil.fr.packages.macports.org/libstdcxx
--->  Attempting to fetch libstdcxx-4.7.2_2+universal.darwin_12.i386-x86_64.tbz2 from http://jog.id.packages.macports.org/macports/packages/libstdcxx
--->  Fetching distfiles for libstdcxx
--->  Verifying checksum(s) for libstdcxx
--->  Extracting libstdcxx
--->  Applying patches to libstdcxx
--->  Configuring libstdcxx
--->  Building libstdcxx
--->  Staging libstdcxx into destroot
--->  Installing libstdcxx @4.7.2_2+universal
--->  Activating libstdcxx @4.7.2_2+universal
--->  Cleaning libstdcxx
--->  Updating database of binaries: 100.0%
--->  Scanning binaries for linking errors: 100.0%
--->  No broken files found.

$ lipo -info /opt/local/lib/libstdc++.a
input file /opt/local/lib/libstdc++.a is not a fat file
Non-fat file: /opt/local/lib/libstdc++.a is architecture: x86_64

Is there an extra step required to get a universal libstdc++ static library? Or is the fat library kept in another location?

Regards,
Alex


More information about the macports-dev mailing list