[MacPorts] #20933: gcc42, gcc43 on snow leopard: in libmpfr.dylib, libgmp.dylib, libiconv.dylib, file is not of required architecture
MacPorts
noreply at macports.org
Mon Sep 14 01:34:47 PDT 2009
#20933: gcc42, gcc43 on snow leopard: in libmpfr.dylib, libgmp.dylib,
libiconv.dylib, file is not of required architecture
------------------------------+---------------------------------------------
Reporter: ram@… | Owner: mww@…
Type: defect | Status: new
Priority: Normal | Milestone:
Component: ports | Version:
Keywords: snowleopard | Port: gcc42, gcc43
------------------------------+---------------------------------------------
Comment(by akim.demaille@…):
For what it's worth, I seem to have been asking for troubles by myself.
For instance, I could not compile simple boost programs:
{{{
$ cat conftest.cc
#include <boost/test/unit_test.hpp>
using boost::unit_test::test_suite;
test_suite* init_unit_test_suite(int argc, char ** argv)
{
return NULL;
}
int
main ()
{
BOOST_CHECK(2 == 2);
return 0;
}
$ i686-apple-darwin10-g++-4.2.1 -o conftest -isystem /opt/local/include
-L/opt/local/lib -L/opt/local/lib conftest.cc -lboost_unit_test_framework-
mt
ld: warning: in /opt/local/lib/libboost_unit_test_framework-mt.dylib, file
is not of required architecture
Undefined symbols:
"vtable for boost::unit_test::unit_test_log_t", referenced from:
__ZTVN5boost9unit_test15unit_test_log_tE$non_lazy_ptr in cccVDvae.o
"boost::test_tools::tt_detail::check_impl(boost::test_tools::predicate_result
const&, boost::unit_test::lazy_ostream const&,
boost::unit_test::basic_cstring<char const>, unsigned long,
boost::test_tools::tt_detail::tool_level,
boost::test_tools::tt_detail::check_type, unsigned long, ...)", referenced
from:
_main in cccVDvae.o
"boost::unit_test::unit_test_log_t::set_checkpoint(boost::unit_test::basic_cstring<char
const>, unsigned long, boost::unit_test::basic_cstring<char const>)",
referenced from:
_main in cccVDvae.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
}}}
I have always used completely qualified compiler names, because I use
distcc, and I even used it with PPC/Intel machines cross-compiling for the
other arch.
It turns out that if I under-specify the compiler I want use, it works.
{{{
$ g++-4.2 -o conftest -isystem /opt/local/include -L/opt/local/lib
-L/opt/local/lib conftest.cc -lboost_unit_test_framework-mt
$
}}}
So in my case I just have to change my scripts from using {{{i686-apple-
darwin10-g++-4.2.1}}} to using {{{g++-4.2}}}. Both are from the same
suite though.
{{{
$ which i686-apple-darwin10-g++-4.2.1
$ i686-apple-darwin10-g++-4.2.1 --version
i686-apple-darwin10-g++-4.2.1 (GCC) 4.2.1 (Apple Inc. build 5646)
Copyright (C) 2007 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE.
$ which g++-4.2
/usr/bin/g++-4.2
$ g++-4.2 --version
i686-apple-darwin10-g++-4.2.1 (GCC) 4.2.1 (Apple Inc. build 5646)
Copyright (C) 2007 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE.
$
}}}
--
Ticket URL: <http://trac.macports.org/ticket/20933#comment:26>
MacPorts <http://www.macports.org/>
Ports system for Mac OS
More information about the macports-tickets
mailing list