Graphviz Issue Tracker
Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0002509graphvizBuild/Installpublic2015-01-19 19:242015-05-30 22:33
Reporterryandesign 
Assigned To 
PrioritynormalSeverityminorReproducibilityalways
StatusnewResolutionopen 
Platformx86_64OSOS XOS Version10.10.2
Summary0002509: Explicitly links with libstdc++; should allow libc++ if appropriate
DescriptionSeveral files in Graphviz use "-lstdc++" to link with libstdc++:

$ grep lstdc++ -r .
./cmd/dot/Makefile.am:dot_static_LDADD += $(top_builddir)/plugin/lasi/.libs/libgvplugin_lasi_C.a $(LASI_LIBS) -lstdc++
./cmd/dot/Makefile.am:dot_builtins_LDADD += $(top_builddir)/plugin/lasi/libgvplugin_lasi.la $(LASI_LIBS) -lstdc++
./cmd/dot/Makefile.am:dot_static_LDADD += $(top_builddir)/plugin/lasi/.libs/libgvplugin_lasi_C.a $(LASI_LIBS) -lstdc++
./cmd/dot/Makefile.am:dot_builtins_LDADD += $(top_builddir)/plugin/lasi/libgvplugin_lasi.la $(LASI_LIBS) -lstdc++
./cmd/dot/Makefile.in:@[email protected] $(LASI_LIBS) -lstdc++ \
./cmd/dot/Makefile.in:@[email protected] $(LASI_LIBS) -lstdc++
./cmd/dot/Makefile.in:@[email protected] $(LASI_LIBS) -lstdc++ \
./cmd/dot/Makefile.in:@[email protected] $(LASI_LIBS) -lstdc++
./cmd/edgepaint/Makefile.am: $(ANN_LIBS) -lstdc++ -lm
./cmd/edgepaint/Makefile.in: $(ANN_LIBS) -lstdc++ -lm
./cmd/mingle/Makefile.am: $(ANN_LIBS) -lstdc++ -lm
./cmd/mingle/Makefile.in: $(ANN_LIBS) -lstdc++ -lm
./configure: IPSEPCOLA_LIBS='$(top_builddir)/lib/vpsc/libvpsc_C.la -lstdc++'
./configure.ac: IPSEPCOLA_LIBS='$(top_builddir)/lib/vpsc/libvpsc_C.la -lstdc++'
./debian/TODO: * Stop using -lstdc++ and use CXX (not trivial actually).
./plugin/gdiplus/Makefile.am:libgvplugin_gdiplus_la_LIBADD = -lgdi32 -lole32 -lstdc++ -luuid $(top_builddir)/lib/gvc/libgvc.la
./plugin/gdiplus/Makefile.in:libgvplugin_gdiplus_la_LIBADD = -lgdi32 -lole32 -lstdc++ -luuid $(top_builddir)/lib/gvc/libgvc.la

This isn't appropriate on systems where libc++ is the default, including OS X 10.9 and later. In fact the user may wish to switch the C++ library from its default by adding "-stdlib=libc++" or "-stdlib=libstdc++" to CXXFLAGS. This should be supported. Probably Graphviz should not be specifying which C++ library to use and should instead leave it up to the compiler's default or the user-supplied CXXFLAGS.

In MacPorts, we simply replace "-lstdc++" with "-lstdc++" when appropriate, based on MacPorts' determination, but of course that's not the proper solution:

https://trac.macports.org/changeset/115390 [^]
TagsNo tags attached.
AUXILLARY-FILES
DATE-FIXED
FIX-COMMENT
FORMER-ID
INPUT-FILE
OUTPUT-FILE
STATUS-COMMENT
VERSION2.39.20150110.0545
Attached Files

- Relationships

-  Notes
User avatar (0000865)
ellson (administrator)
2015-01-20 10:38

Does ./configure set the appropriate c++ library into postdeps_CXX on Mac Ports?

On Fedora it gets set:
$ grep postdeps_CXX config.status
postdeps_CXX='-lstdc++ -lm -lgcc_s -lc -lgcc_s'

I'm wondering if this is the right replacement for the explicit -lstdc
User avatar (0000943)
ryandesign (reporter)
2015-05-30 22:33
edited on: 2015-05-30 22:34

On OS X 10.10.4:

$ grep postdeps_CXX config.status
postdeps_CXX=''

I don't know about other operating systems but as far as I know there's no need to explicitly link with any C++ library on OS X; just compile the code with a C++ compiler and it will do what's needed.

You can add -stdlib=libc++ or -stdlib=libstdc++ to CXXFLAGS if you want to change the default, but you probably don't want to do that.


- Issue History
Date Modified Username Field Change
2015-01-19 19:24 ryandesign New Issue
2015-01-20 10:38 ellson Note Added: 0000865
2015-05-30 22:33 ryandesign Note Added: 0000943
2015-05-30 22:34 ryandesign Note Edited: 0000943 View Revisions


MantisBT 1.2.5[^]
Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker