Opened 11 years ago

Closed 6 years ago

#37947 closed defect (fixed)

graphite2 fails to build with libc++

Reported by: jeremyhu (Jeremy Huddleston Sequoia) Owned by: ryandesign (Ryan Carsten Schmidt)
Priority: Normal Milestone:
Component: ports Version: 2.1.3
Keywords: libc++ Cc: mkae (Marko Käning)
Port: graphite2

Description

graphite2 fails to build using libc++

Add the following to graphite2's Portfile to try building it with libc++ (warning, don't try to mix libc++ and libstdc++ based libraries):

configure.cxxflags-append -stdlib=libc++

the build fails with:

[ 84%] Building CXX object tests/featuremap/CMakeFiles/featuremaptest.dir/featuremaptest.cpp.o
cd /opt/local/var/macports/build/_Users_jeremy_src_macports_trunk_dports_graphics_graphite2/graphite2/work/graphite2-1.2.0/tests/featuremap && /usr/bin/clang++   -DGRAPHITE2_STATIC -pipe -O2 -stdlib=libc++ -arch x86_64 -arch i386  -O3 -DNDEBUG -arch x86_64 -arch i386 -I/opt/local/var/macports/build/_Users_jeremy_src_macports_trunk_dports_graphics_graphite2/graphite2/work/graphite2-1.2.0/include -I/opt/local/var/macports/build/_Users_jeremy_src_macports_trunk_dports_graphics_graphite2/graphite2/work/graphite2-1.2.0/src    -o CMakeFiles/featuremaptest.dir/featuremaptest.cpp.o -c /opt/local/var/macports/build/_Users_jeremy_src_macports_trunk_dports_graphics_graphite2/graphite2/work/graphite2-1.2.0/tests/featuremap/featuremaptest.cpp
In file included from /opt/local/var/macports/build/_Users_jeremy_src_macports_trunk_dports_graphics_graphite2/graphite2/work/graphite2-1.2.0/tests/featuremap/featuremaptest.cpp:24:
In file included from /usr/bin/../lib/c++/v1/fstream:169:
In file included from /usr/bin/../lib/c++/v1/ostream:130:
In file included from /usr/bin/../lib/c++/v1/ios:216:
In file included from /usr/bin/../lib/c++/v1/__locale:15:
In file included from /usr/bin/../lib/c++/v1/string:434:
In file included from /usr/bin/../lib/c++/v1/algorithm:593:
/usr/bin/../lib/c++/v1/utility:255:15: error: no viable overloaded '='
        first = __p.first;
        ~~~~~ ^ ~~~~~~~~~
/usr/bin/../lib/c++/v1/__tree:1246:35: note: in instantiation of member function 'std::__1::pair<const graphite2::TtfUtil::Tag, std::__1::pair<const void *, unsigned long> >::operator=' requested here
                __cache->__value_ = *__first;
                                  ^
/usr/bin/../lib/c++/v1/__tree:1187:9: note: in instantiation of function template specialization 'std::__1::__tree<std::__1::pair<const graphite2::TtfUtil::Tag, std::__1::pair<const void *, unsigned long> >, std::__1::__map_value_compare<const graphite2::TtfUtil::Tag, std::__1::pair<const void *, unsigned long>, std::__1::less<const graphite2::TtfUtil::Tag>, true>, std::__1::allocator<std::__1::pair<const graphite2::TtfUtil::Tag, std::__1::pair<const void *, unsigned long> > > >::__assign_multi<std::__1::__tree_const_iterator<std::__1::pair<const graphite2::TtfUtil::Tag, std::__1::pair<const void *, unsigned long> >, const std::__1::__tree_node<std::__1::pair<const graphite2::TtfUtil::Tag, std::__1::pair<const void *, unsigned long> >, void *> *, long> >' requested here
        __assign_multi(__t.begin(), __t.end());
        ^
/usr/bin/../lib/c++/v1/map:766:21: note: in instantiation of member function 'std::__1::__tree<std::__1::pair<const graphite2::TtfUtil::Tag, std::__1::pair<const void *, unsigned long> >, std::__1::__map_value_compare<const graphite2::TtfUtil::Tag, std::__1::pair<const void *, unsigned long>, std::__1::less<const graphite2::TtfUtil::Tag>, true>, std::__1::allocator<std::__1::pair<const graphite2::TtfUtil::Tag, std::__1::pair<const void *, unsigned long> > > >::operator=' requested here
            __tree_ = __m.__tree_;
                    ^
/opt/local/var/macports/build/_Users_jeremy_src_macports_trunk_dports_graphics_graphite2/graphite2/work/graphite2-1.2.0/tests/featuremap/featuremaptest.cpp:167:7: note: in instantiation of member function 'std::__1::map<const graphite2::TtfUtil::Tag, std::__1::pair<const void *, unsigned long>, std::__1::less<const graphite2::TtfUtil::Tag>, std::__1::allocator<std::__1::pair<const graphite2::TtfUtil::Tag, std::__1::pair<const void *, unsigned long> > > >::operator=' requested here
class face_handle
      ^
/opt/local/var/macports/build/_Users_jeremy_src_macports_trunk_dports_graphics_graphite2/graphite2/work/graphite2-1.2.0/src/inc/TtfUtil.h:52:7: note: candidate function (the implicit copy assignment operator) not viable: 'this' argument has type 'const graphite2::TtfUtil::Tag', but method is not marked const
class Tag
      ^
1 error generated.

Change History (7)

comment:1 Changed 11 years ago by jeremyhu (Jeremy Huddleston Sequoia)

I disabled that particular test in r102618, but a better solution would be fixing the code. Sorry, but C++ isn't one of my strong points.

comment:2 in reply to:  description ; Changed 11 years ago by ryandesign (Ryan Carsten Schmidt)

Replying to jeremyhu@…:

graphite2 fails to build using libc++

Why would I use libc++?

The port builds fine as it currently is, right? It did on every system I've tested it on, after the fixes that have already been committed.

comment:3 in reply to:  2 Changed 11 years ago by jeremyhu (Jeremy Huddleston Sequoia)

Replying to ryandesign@…:

Replying to jeremyhu@…:

graphite2 fails to build using libc++

Why would I use libc++?

To test it, and to uncover bugs in projects ;)

The port builds fine as it currently is, right?

Yes, it does build with the default settings (libstdc++)

comment:4 Changed 11 years ago by ryandesign (Ryan Carsten Schmidt)

comment:5 Changed 11 years ago by jeremyhu (Jeremy Huddleston Sequoia)

Thanks, I CC'd myself there as well.

comment:6 Changed 10 years ago by mkae (Marko Käning)

Cc: mk@… added

Cc Me!

comment:7 Changed 6 years ago by ryandesign (Ryan Carsten Schmidt)

Resolution: fixed
Status: newclosed

We've been building graphite2 successfully on libc++ systems for years. (The earliest graphite2 package on our packages server right now is 1.2.4 built successfully with libc++ on Mavericks and El Capitan in December 2013.) I don't know what changed to fix this since Jeremy reported it in February 2013, but it wasn't anything we did, and the upstream bug report was closed invalid because the developer didn't understand the issue or really know what to do about it.

Note: See TracTickets for help on using tickets.