Opened 7 years ago

Closed 6 years ago

#54421 closed defect (fixed)

blackbox @0.70.1 won't build on Snow Leopard, Mac OS X 10.6.8, (cxx_stdlib = libc++) because – Clang 3.9 is too modern?

Reported by: ballapete (Peter "Pete" Dyballa) Owned by:
Priority: Normal Milestone:
Component: ports Version: 2.4.1
Keywords: Cc: ken.cunningham.webuse@…
Port: blackbox

Description

This is a very interesting case…

if /bin/sh ../libtool --tag=CXX --mode=compile /opt/local/bin/clang++-mp-3.9 -DHAVE_CONFIG_H -I. -I. -I..  -DSHAPE -DMITSHM -DXFT  -DNLS -DLOCALEPATH=\"/opt/local/share/blackbox/nls\" -I/opt/local/include -I/opt/local/include -I/usr/local/include -I/opt/local/include  -pipe -Os -stdlib=libc++ -arch x86_64 -I/opt/local/include -I/opt/local/include/freetype2 -I/opt/local/include/libpng16 -I/opt/local/include/freetype2 -I/opt/local/include/libpng16 -MT Menu.lo -MD -MP -MF ".deps/Menu.Tpo" -c -o Menu.lo Menu.cc; \
	then mv -f ".deps/Menu.Tpo" ".deps/Menu.Plo"; else rm -f ".deps/Menu.Tpo"; exit 1; fi
 /opt/local/bin/clang++-mp-3.9 -DHAVE_CONFIG_H -I. -I. -I.. -DSHAPE -DMITSHM -DXFT -DNLS -DLOCALEPATH=\"/opt/local/share/blackbox/nls\" -I/opt/local/include -I/opt/local/include -I/usr/local/include -I/opt/local/include -pipe -Os -stdlib=libc++ -arch x86_64 -I/opt/local/include -I/opt/local/include/freetype2 -I/opt/local/include/libpng16 -I/opt/local/include/freetype2 -I/opt/local/include/libpng16 -MT Menu.lo -MD -MP -MF .deps/Menu.Tpo -c Menu.cc -o Menu.o
 /opt/local/bin/clang++-mp-3.9 -DHAVE_CONFIG_H -I. -I. -I.. -DSHAPE -DMITSHM -DXFT -DNLS -DLOCALEPATH=\"/opt/local/share/blackbox/nls\" -I/opt/local/include -I/opt/local/include -I/usr/local/include -I/opt/local/include -pipe -Os -stdlib=libc++ -arch x86_64 -I/opt/local/include -I/opt/local/include/freetype2 -I/opt/local/include/libpng16 -I/opt/local/include/freetype2 -I/opt/local/include/libpng16 -MT Application.lo -MD -MP -MF .deps/Application.Tpo -c Application.cc -o Application.o
 /opt/local/bin/clang++-mp-3.9 -DHAVE_CONFIG_H -I. -I. -I.. -DSHAPE -DMITSHM -DXFT -DNLS -DLOCALEPATH=\"/opt/local/share/blackbox/nls\" -I/opt/local/include -I/opt/local/include -I/usr/local/include -I/opt/local/include -pipe -Os -stdlib=libc++ -arch x86_64 -I/opt/local/include -I/opt/local/include/freetype2 -I/opt/local/include/libpng16 -I/opt/local/include/freetype2 -I/opt/local/include/libpng16 -MT EWMH.lo -MD -MP -MF .deps/EWMH.Tpo -c EWMH.cc -o EWMH.o
 /opt/local/bin/clang++-mp-3.9 -DHAVE_CONFIG_H -I. -I. -I.. -DSHAPE -DMITSHM -DXFT -DNLS -DLOCALEPATH=\"/opt/local/share/blackbox/nls\" -I/opt/local/include -I/opt/local/include -I/usr/local/include -I/opt/local/include -pipe -Os -stdlib=libc++ -arch x86_64 -I/opt/local/include -I/opt/local/include/freetype2 -I/opt/local/include/libpng16 -I/opt/local/include/freetype2 -I/opt/local/include/libpng16 -MT Display.lo -MD -MP -MF .deps/Display.Tpo -c Display.cc -o Display.o
 /opt/local/bin/clang++-mp-3.9 -DHAVE_CONFIG_H -I. -I. -I.. -DSHAPE -DMITSHM -DXFT -DNLS -DLOCALEPATH=\"/opt/local/share/blackbox/nls\" -I/opt/local/include -I/opt/local/include -I/usr/local/include -I/opt/local/include -pipe -Os -stdlib=libc++ -arch x86_64 -I/opt/local/include -I/opt/local/include/freetype2 -I/opt/local/include/libpng16 -I/opt/local/include/freetype2 -I/opt/local/include/libpng16 -MT Bitmap.lo -MD -MP -MF .deps/Bitmap.Tpo -c Bitmap.cc -o Bitmap.o
 /opt/local/bin/clang++-mp-3.9 -DHAVE_CONFIG_H -I. -I. -I.. -DSHAPE -DMITSHM -DXFT -DNLS -DLOCALEPATH=\"/opt/local/share/blackbox/nls\" -I/opt/local/include -I/opt/local/include -I/usr/local/include -I/opt/local/include -pipe -Os -stdlib=libc++ -arch x86_64 -I/opt/local/include -I/opt/local/include/freetype2 -I/opt/local/include/libpng16 -I/opt/local/include/freetype2 -I/opt/local/include/libpng16 -MT Color.lo -MD -MP -MF .deps/Color.Tpo -c Color.cc -o Color.o
 /opt/local/bin/clang++-mp-3.9 -DHAVE_CONFIG_H -I. -I. -I.. -DSHAPE -DMITSHM -DXFT -DNLS -DLOCALEPATH=\"/opt/local/share/blackbox/nls\" -I/opt/local/include -I/opt/local/include -I/usr/local/include -I/opt/local/include -pipe -Os -stdlib=libc++ -arch x86_64 -I/opt/local/include -I/opt/local/include/freetype2 -I/opt/local/include/libpng16 -I/opt/local/include/freetype2 -I/opt/local/include/libpng16 -MT Image.lo -MD -MP -MF .deps/Image.Tpo -c Image.cc -o Image.o
 /opt/local/bin/clang++-mp-3.9 -DHAVE_CONFIG_H -I. -I. -I.. -DSHAPE -DMITSHM -DXFT -DNLS -DLOCALEPATH=\"/opt/local/share/blackbox/nls\" -I/opt/local/include -I/opt/local/include -I/usr/local/include -I/opt/local/include -pipe -Os -stdlib=libc++ -arch x86_64 -I/opt/local/include -I/opt/local/include/freetype2 -I/opt/local/include/libpng16 -I/opt/local/include/freetype2 -I/opt/local/include/libpng16 -MT Font.lo -MD -MP -MF .deps/Font.Tpo -c Font.cc -o Font.o
if /bin/sh ../libtool --tag=CXX --mode=compile /opt/local/bin/clang++-mp-3.9 -DHAVE_CONFIG_H -I. -I. -I..  -DSHAPE -DMITSHM -DXFT  -DNLS -DLOCALEPATH=\"/opt/local/share/blackbox/nls\" -I/opt/local/include -I/opt/local/include -I/usr/local/include -I/opt/local/include  -pipe -Os -stdlib=libc++ -arch x86_64 -I/opt/local/include -I/opt/local/include/freetype2 -I/opt/local/include/libpng16 -I/opt/local/include/freetype2 -I/opt/local/include/libpng16 -MT Pen.lo -MD -MP -MF ".deps/Pen.Tpo" -c -o Pen.lo Pen.cc; \
	then mv -f ".deps/Pen.Tpo" ".deps/Pen.Plo"; else rm -f ".deps/Pen.Tpo"; exit 1; fi
if /bin/sh ../libtool --tag=CXX --mode=compile /opt/local/bin/clang++-mp-3.9 -DHAVE_CONFIG_H -I. -I. -I..  -DSHAPE -DMITSHM -DXFT  -DNLS -DLOCALEPATH=\"/opt/local/share/blackbox/nls\" -I/opt/local/include -I/opt/local/include -I/usr/local/include -I/opt/local/include  -pipe -Os -stdlib=libc++ -arch x86_64 -I/opt/local/include -I/opt/local/include/freetype2 -I/opt/local/include/libpng16 -I/opt/local/include/freetype2 -I/opt/local/include/libpng16 -MT PixmapCache.lo -MD -MP -MF ".deps/PixmapCache.Tpo" -c -o PixmapCache.lo PixmapCache.cc; \
	then mv -f ".deps/PixmapCache.Tpo" ".deps/PixmapCache.Plo"; else rm -f ".deps/PixmapCache.Tpo"; exit 1; fi
Font.cc:207:26: warning: conversion from string literal to 'char *' is deprecated [-Wc++11-compat-deprecated-writable-strings]
  char **missing, *def = "-";
                         ^
Menu.cc:366:5: error: no matching function for call to 'advance'
    std::advance<ItemList::iterator, signed>(it, index);
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/opt/local/libexec/llvm-3.9/bin/../include/c++/v1/iterator:557:6: note: candidate template ignored: invalid explicitly-specified argument for template parameter '_InputIter'
void advance(_InputIter& __i,
     ^
Menu.cc:517:3: error: no matching function for call to 'advance'
  std::advance<ItemList::iterator, signed>(it, index);
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/opt/local/libexec/llvm-3.9/bin/../include/c++/v1/iterator:557:6: note: candidate template ignored: invalid explicitly-specified argument for template parameter '_InputIter'
void advance(_InputIter& __i,
     ^
Menu.cc:1012:16: warning: 'XKeycodeToKeysym' is deprecated [-Wdeprecated-declarations]
  KeySym sym = XKeycodeToKeysym(_app.XDisplay(), event->keycode, 0);
               ^
/opt/local/include/X11/Xlib.h:1687:15: note: 'XKeycodeToKeysym' has been explicitly marked deprecated here
extern KeySym XKeycodeToKeysym(
              ^
Menu.cc:1038:7: error: no matching function for call to 'advance'
      std::advance<ItemList::const_iterator, signed>(anchor, _active_index);
      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/opt/local/libexec/llvm-3.9/bin/../include/c++/v1/iterator:557:6: note: candidate template ignored: invalid explicitly-specified argument for template parameter '_InputIter'
void advance(_InputIter& __i,
     ^
Menu.cc:1058:7: error: no matching function for call to 'advance'
      std::advance<ItemList::const_reverse_iterator, signed>
      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/opt/local/libexec/llvm-3.9/bin/../include/c++/v1/iterator:557:6: note: candidate template ignored: invalid explicitly-specified argument for template parameter '_InputIter'
void advance(_InputIter& __i,
     ^
1 warning and 4 errors generated.
if /bin/sh ../libtool --tag=CXX --mode=compile /opt/local/bin/clang++-mp-3.9 -DHAVE_CONFIG_H -I. -I. -I..  -DSHAPE -DMITSHM -DXFT  -DNLS -DLOCALEPATH=\"/opt/local/share/blackbox/nls\" -I/opt/local/include -I/opt/local/include -I/usr/local/include -I/opt/local/include  -pipe -Os -stdlib=libc++ -arch x86_64 -I/opt/local/include -I/opt/local/include/freetype2 -I/opt/local/include/libpng16 -I/opt/local/include/freetype2 -I/opt/local/include/libpng16 -MT Rect.lo -MD -MP -MF ".deps/Rect.Tpo" -c -o Rect.lo Rect.cc; \
	then mv -f ".deps/Rect.Tpo" ".deps/Rect.Plo"; else rm -f ".deps/Rect.Tpo"; exit 1; fi
make[2]: *** [Menu.lo] Error 1
make[2]: *** Waiting for unfinished jobs....

When I do port -vd install blackbox configure.compiler=gcc-4.2 the build succeeds…

Attachments (1)

main.log (122.8 KB) - added by ballapete (Peter "Pete" Dyballa) 7 years ago.
main.log with Clang 3.9

Download all attachments as: .zip

Change History (13)

Changed 7 years ago by ballapete (Peter "Pete" Dyballa)

Attachment: main.log added

main.log with Clang 3.9

comment:1 Changed 7 years ago by kencu (Ken)

this smells like one of those situations where it is missing a proper -std=c++11 setting. gcc sets these defaults differently than clang, at present. Google is your friend here -- others may have solved this already for you. Or search for this string in Macports, as it has likely happened in other ports too.

if you can't find anything, try something like configure.cxxflags-append -std=c++11 and see what happens.

BTW - you can't mix libc++ and things built with gcc-4.2 without invoking disaster.

comment:2 Changed 7 years ago by kencu (Ken)

see also 45577 for a duplicate.

comment:3 in reply to:  2 Changed 7 years ago by ballapete (Peter "Pete" Dyballa)

Replying to kencu:

see also 45577 for a duplicate.

Before I start anew I perform a port clean blackbox.

comment:4 Changed 7 years ago by mf2k (Frank Schima)

Keywords: snowleopard removed

Given that in #45577, the user was on Mavericks (10.9), I don't think this is a Snow Leopard only problem.

comment:5 Changed 7 years ago by kencu (Ken)

Looks like Debian failed to build it with clang also. <https://github.com/opencollab/clang.debian.net/blob/master/scanlog-3.3-2013-07-14>.

comment:6 in reply to:  1 Changed 7 years ago by ballapete (Peter "Pete" Dyballa)

Replying to kencu:

this smells like one of those situations where it is missing a proper -std=c++11 setting. gcc sets these defaults differently than clang, at present. Google is your friend here -- others may have solved this already for you. Or search for this string in Macports, as it has likely happened in other ports too.

Sorry, I don't understand the mechanics, rules, or whatever behind this. So I cannot ask a worthwhile question.

if you can't find anything, try something like configure.cxxflags-append -std=c++11 and see what happens.

Same error as without. Could be it's not library but a language problem.

BTW - you can't mix libc++ and things built with gcc-4.2 without invoking disaster.

No, I'm not mixing… I don't know what I am doing wrong, but the stuff I compile works. i take some care in not telling my executables – or compilers – stuff. I just presume that my compilers are clever enough to record inside the executables which shared or dynamic libraries from which places they should use in daily life. I really like that sensible software.

comment:7 Changed 7 years ago by ballapete (Peter "Pete" Dyballa)

I think the cause for the failure is that Clang assumes a modern C++ dialect used for Blackbox. Clang's man page says that -std=c89 or -ansi should bring Clang in the proper mood. It simply does not work to invoke port -vd install blackbox onfigure.cxxflags-append -std=c89 or port -vd install blackbox onfigure.cxxflags-append -ansiPort does not use that addtional setting.

comment:8 Changed 7 years ago by kencu (Ken)

to append flags (c, cxx, or ld) you have to actually write it in to the portfile (as Ryan pointed out to me a few months ago). I thought you could do that on the command line as well, but you can't.

so if you wanted to test your research, stick something like this in the actual Portfile, to see if it works:

configure.cxxflags-append -std=c89

comment:9 Changed 7 years ago by ballapete (Peter "Pete" Dyballa)

Using -std=c89 leads to an error when configure checks whether libiconv is installed ('-std=c89' not allowed with 'C++/ObjC++') and usable.

Since a faulty setting, -stdlib=libc++, is still left

CXXFLAGS='-pipe -Os -ansi -stdlib=libc++ -arch x86_64'
OBJCXXFLAGS='-pipe -Os -ansi -stdlib=libc++ -arch x86_64'

the builds fails at the usual place…

comment:10 Changed 7 years ago by kencu (Ken)

If you look back in the old tickets 23037, you'll see an old report from you about this exact iconv thing in this same port 8 years ago :> I guess you really must like this port! I guess you would have to decide if you want to take your chances with the gcc42-built version that somehow finds iconv (how?), or keep digging for the proper fix to this.

comment:11 in reply to:  10 Changed 7 years ago by ballapete (Peter "Pete" Dyballa)

Replying to kencu:

If you look back in the old tickets 23037, you'll see an old report from you about this exact iconv thing in this same port 8 years ago

But that's not important. -ansi should perform the same, i.e., adapt Clang to an old C++ standard. Without producing the same error. Tested.

From the man page:

       -ansi
           Same as -std=c89.

       -std=language
           Specify the language standard to compile for.

       -stdlib=language
           Specify the C++ standard library to use; supported options are libstdc++ and libc++.

comment:12 Changed 6 years ago by kencu (Ken)

Resolution: fixed
Status: newclosed

fixed somewhere along the way:

$ port -v installed blackbox
The following ports are currently installed:
  blackbox @0.70.1_1 (active) platform='darwin 10' archs='x86_64' date='2018-12-05T17:13:53-0800'

Note: See TracTickets for help on using tickets.