0

MacPorts を使用して、GCC 4.7.2 のユニバーサル ビルドをセットアップしています。その依存関係の 1 つは、libstdcxxビルドしてから削除する というサブポートです。

再構築後にスタティック ライブラリが削除されないように、portfileのlibstdcxxエントリを編集しました。gcc47libstdc++.a

ただし、スタティック ライブラリは 64 ビット ( x86_64) ファイルです。

$ sudo port -n upgrade --force libstdcxx +universal
--->  Computing dependencies for libstdcxx
...
$ 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

i386また、このファイルにアーキテクチャのサポートを追加したいと思います。

ファットな静的libstdc++ライブラリを構築するには、どのような追加手順に従う必要がありますか? または、これは MacPorts では不可能ですか? GCC 4.7.2 全体を 2 回 (両方i386x86_64アーキテクチャのサポートを取得するために) 再配布してコンパイルし、アプリケーションのソースと共に、この 1 つの静的ライブラリにリンクするための唯一の他のオプションはありますか?

追加 - 2013 年 3 月 27 日

Brett Hale の提案はうまくいかなかったようです。ビルド プロセスが失敗しました。エラー ログのスニペットを次に示します。

:notice:configure --->  Configuring libstdcxx
:debug:configure Using compiler 'Mac OS X clang'
:debug:configure Executing proc-pre-org.macports.configure-configure-0
:debug:configure Executing org.macports.configure (libstdcxx)
:debug:configure Environment: CPATH='/opt/local/include' CXXFLAGS='-pipe -O2' CPPFLAGS='-I/opt/local/include' CFLAGS='-pipe -O2' AS_FOR_TARGET='/opt/local/bin/as' LIBRARY_PATH='/opt/local/lib' MACOSX_DEPLOYMENT_TARGET='10.8' CXX='g++ -arch x86_64 i386' CPP='gcc -arch x86_64 i386 -E\
' CC_PRINT_OPTIONS_FILE='/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_lang_gcc47/libstdcxx/work/.CC_PRINT_OPTIONS' F90FLAGS='-pipe -O2' LD_FOR_TARGET='/opt/local/bin/ld' RANLIB_FOR_TARGET='/opt/local/bin/ranlib' LDFLAGS='-L\
/opt/local/lib' OBJDUMP_FOR_TARGET='/opt/local/bin/objdump' OTOOL='/opt/local/bin/otool' FCFLAGS='-pipe -O2' OBJC='/usr/bin/clang' INSTALL='/usr/bin/install -c' AR_FOR_TARGET='/opt/local/bin/ar' NM_FOR_TARGET='/opt/local/bin/nm' FFLAGS='-pipe -O2' OBJCFLAGS='-pipe -O2' CC_PRINT_OPT\
IONS='YES' STRIP_FOR_TARGET='/opt/local/bin/strip' CC='gcc -arch x86_64 i386' OTOOL64='/opt/local/bin/otool'
:debug:configure Assembled command: 'cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_lang_gcc47/libstdcxx/work/build" && ../gcc-4.7.2/configure --prefix=/opt/local --build=x86_64-apple-darwin12 --includedir=/opt/local/incl\
ude/gcc47 --infodir=/opt/local/share/info --mandir=/opt/local/share/man --datarootdir=/opt/local/share/gcc-4.7 --with-libiconv-prefix=/opt/local --with-local-prefix=/opt/local --with-system-zlib --disable-nls --program-suffix=-mp-4.7 --with-gxx-include-dir=/opt/local/include/gcc47/\
c++/ --with-gmp=/opt/local --with-mpfr=/opt/local --with-mpc=/opt/local --with-ppl=/opt/local --with-cloog=/opt/local --enable-cloog-backend=isl --disable-cloog-version-check --enable-stage1-checking --enable-lto --enable-libstdcxx-time --with-as=/opt/local/bin/as --with-ld=/opt/lo\
cal/bin/ld --with-ar=/opt/local/bin/ar --with-bugurl=https://trac.macports.org/newticket --disable-ppl-version-check --enable-languages=c++ --disable-bootstrap --with-pkgversion="MacPorts gcc47 4.7.2_2+universal"'
:debug:configure Executing command line:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_lang_gcc47/libstdcxx/work/build" && ../gcc-4.7.2/configure --prefix=/opt/local --build=x86_64-apple-darwin12 --includedir=/opt/local\
/include/gcc47 --infodir=/opt/local/share/info --mandir=/opt/local/share/man --datarootdir=/opt/local/share/gcc-4.7 --with-libiconv-prefix=/opt/local --with-local-prefix=/opt/local --with-system-zlib --disable-nls --program-suffix=-mp-4.7 --with-gxx-include-dir=/opt/local/include/g\
cc47/c++/ --with-gmp=/opt/local --with-mpfr=/opt/local --with-mpc=/opt/local --with-ppl=/opt/local --with-cloog=/opt/local --enable-cloog-backend=isl --disable-cloog-version-check --enable-stage1-checking --enable-lto --enable-libstdcxx-time --with-as=/opt/local/bin/as --with-ld=/o\
pt/local/bin/ld --with-ar=/opt/local/bin/ar --with-bugurl=https://trac.macports.org/newticket --disable-ppl-version-check --enable-languages=c++ --disable-bootstrap --with-pkgversion="MacPorts gcc47 4.7.2_2+universal"
:info:configure checking build system type... x86_64-apple-darwin12
:info:configure checking host system type... x86_64-apple-darwin12
:info:configure checking target system type... x86_64-apple-darwin12
:info:configure checking for a BSD-compatible install... /usr/bin/install -c
:info:configure checking whether ln works... yes
:info:configure checking whether ln -s works... yes
:info:configure checking for a sed that does not truncate output... /usr/bin/sed
:info:configure checking for gawk... no
:info:configure checking for mawk... no
:info:configure checking for nawk... no
:info:configure checking for awk... awk
:info:configure checking for libitm support... yes
:info:configure checking for gcc... gcc -arch x86_64 i386
:info:configure checking for C compiler default output file name...
:info:configure configure: error: in `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_lang_gcc47/libstdcxx/work/build':
:info:configure configure: error: C compiler cannot create executables
:info:configure See `config.log' for more details.
:info:configure Command failed:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_lang_gcc47/libstdcxx/work/build" && ../gcc-4.7.2/configure --prefix=/opt/local --build=x86_64-apple-darwin12 --includedir=/opt/local/include/\
gcc47 --infodir=/opt/local/share/info --mandir=/opt/local/share/man --datarootdir=/opt/local/share/gcc-4.7 --with-libiconv-prefix=/opt/local --with-local-prefix=/opt/local --with-system-zlib --disable-nls --program-suffix=-mp-4.7 --with-gxx-include-dir=/opt/local/include/gcc47/c++/\
 --with-gmp=/opt/local --with-mpfr=/opt/local --with-mpc=/opt/local --with-ppl=/opt/local --with-cloog=/opt/local --enable-cloog-backend=isl --disable-cloog-version-check --enable-stage1-checking --enable-lto --enable-libstdcxx-time --with-as=/opt/local/bin/as --with-ld=/opt/local/\
bin/ld --with-ar=/opt/local/bin/ar --with-bugurl=https://trac.macports.org/newticket --disable-ppl-version-check --enable-languages=c++ --disable-bootstrap --with-pkgversion="MacPorts gcc47 4.7.2_2+universal"
:info:configure Exit code: 77
:error:configure org.macports.configure for port libstdcxx returned: configure failure: command execution failed
:debug:configure Error code: NONE
:debug:configure Backtrace: configure failure: command execution failed
    while executing
"$procedure $targetname"
:info:configure Warning: targets not executed for libstdcxx: org.macports.activate org.macports.configure org.macports.build org.macports.destroot org.macports.install
:notice:configure Please see the log file for port libstdcxx for details:
    /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_lang_gcc47/libstdcxx/main.log
4

1 に答える 1

0

gcc コンパイラで gcc をビルドしている場合は、次の-archオプションを使用してユニバーサル オブジェクト/ライブラリを作成することができます。

sudo port -n upgrade --force libstdcxx +universal \
configure.cc="gcc -arch x86_64 i386" configure.cxx="g++ -arch x86_64 i386"
于 2013-03-27T11:41:43.590 に答える