Opened 3 years ago

Last modified 4 months ago

#46287 assigned defect

harfbuzz-icu @0.9.37_0: cc1plus: error: unrecognized command line option "-std=c++0x"

Reported by: bK4gYuRo Owned by: ryandesign (Ryan Schmidt)
Priority: Normal Milestone:
Component: ports Version: 2.3.3
Keywords: lion Cc: tim@…, desmith@…
Port: harfbuzz-icu icu

Description (last modified by ryandesign (Ryan Schmidt))

harfbuzz-icu build fails with this error:

libtool: compile:  /usr/bin/llvm-g++-4.2 -DHAVE_CONFIG_H -I. -I.. -D_THREAD_SAFE -pthread -I./hb-ucdn -I/opt/local/include -pipe -Os -arch x86_64 -fno-rtti -fno-exceptions -Wcast-align -fvisibility-inlines-hidden --std=c++0x -MT libharfbuzz_la-hb-blob.lo -MD -MP -MF .deps/libharfbuzz_la-hb-blob.Tpo -c hb-blob.cc  -fno-common -DPIC -o .libs/libharfbuzz_la-hb-blob.o
cc1plus: error: unrecognized command line option "-std=c++0x"

I am not sure if complier complains about extra "-" in --std=c++0x.

Attachments (1)

main.log (30.1 KB) - added by bK4gYuRo 3 years ago.

Download all attachments as: .zip

Change History (14)

Changed 3 years ago by bK4gYuRo

comment:1 Changed 3 years ago by bK4gYuRo

  • Cc macports@… added

Cc Me!

comment:2 Changed 3 years ago by jmroot (Joshua Root)

  • Cc macports@… removed
  • Owner changed from macports-tickets@… to ryandesign@…

Please remember to Cc the maintainer when you create a ticket.

comment:3 Changed 3 years ago by ryandesign (Ryan Schmidt)

  • Description modified (diff)

comment:4 follow-up: Changed 3 years ago by ryandesign (Ryan Schmidt)

What version of Xcode are you using? Most (all?) versions of Xcode on Lion should be using clang, not llvm-gcc-4.2.

comment:5 Changed 3 years ago by ryandesign (Ryan Schmidt)

  • Port icu added

--std=c++0x does not appear in the harfbuzz source code, but does appear in the pkg-config files installed by the icu port. You're right, that extra leading hyphen does look suspicious.

comment:6 follow-up: Changed 3 years ago by ryandesign (Ryan Schmidt)

But llvm-g++-4.2 probably just doesn't support the C++11 standard that -std=c++0x calls for.

It seems wrong that icu is putting that flag in its pkg-config files. icu cannot know whether the compiler used to compile something using those pkg-config files supports C++11 or not.

Last edited 3 years ago by ryandesign (Ryan Schmidt) (previous) (diff)

comment:7 in reply to: ↑ description Changed 3 years ago by ryandesign (Ryan Schmidt)

The typo in the argument (--std should be -std) is already reported upstream: http://bugs.icu-project.org/trac/ticket/11413

comment:8 in reply to: ↑ 6 Changed 3 years ago by ryandesign (Ryan Schmidt)

Replying to ryandesign@…:

It seems wrong that icu is putting that flag in its pkg-config files. icu cannot know whether the compiler used to compile something using those pkg-config files supports C++11 or not.

I have reported this problem upstream: http://bugs.icu-project.org/trac/ticket/11455

comment:9 in reply to: ↑ 4 ; follow-up: Changed 3 years ago by bK4gYuRo

Replying to ryandesign@…:

What version of Xcode are you using? Most (all?) versions of Xcode on Lion should be using clang, not llvm-gcc-4.2.

Xcode 4.2.1
Build version 4D502

comment:10 in reply to: ↑ 9 ; follow-up: Changed 3 years ago by ryandesign (Ryan Schmidt)

Replying to macports@…:

Replying to ryandesign@…:

What version of Xcode are you using?

Xcode 4.2.1
Build version 4D502

You should update to Xcode 4.6.3.

Most (all?) versions of Xcode on Lion should be using clang, not llvm-gcc-4.2.

I had forgotten that Xcode 4.1 was the first version for Lion, which did not include clang, so it defaulted to llvm-gcc-4.2. In addition, in r118085 we changed the default compiler in MacPorts for Xcode 4.2.x from clang to llvm-gcc-4.2. This was meant to help Snow Leopard, where Xcode 4.2 is an unusual configuration, not well tested, and the only one that was defaulting to clang, and a very old version of clang at that.

comment:11 in reply to: ↑ 10 Changed 3 years ago by ryandesign (Ryan Schmidt)

Replying to ryandesign@…:

I had forgotten that Xcode 4.1 was the first version for Lion, which did not include clang, so it defaulted to llvm-gcc-4.2.

Well, that's wrong: clang existed in Xcode 4.1, we just weren't defaulting to it because it was still early in clang's development and at that time llvm-gcc-4.2 still worked better.

comment:12 Changed 22 months ago by ryandesign (Ryan Schmidt)

  • Cc tim@… desmith@… added
  • Keywords lion added
  • Status changed from new to assigned
  • Summary changed from harfbuzz-icu 0.9.37_0 build fails on 10.7.5 to harfbuzz-icu @0.9.37_0: cc1plus: error: unrecognized command line option "-std=c++0x"

Has duplicates #48719, #50254, #50695. As mentioned above, this is an icu bug. The upstream bug report has not yet been closed, so updating icu to 56.1 probably won't help. I can try to patch icu to fix this.

This problem should only affect users of Xcode versions 4.0 through 4.2 inclusive, which are the only ones where MacPorts defaults to using llvm-g++-4.2. On Snow Leopard, it is recommended to use Xcode 3.2.6, and on Lion it is recommended to use Xcode 4.6.3; neither of those should experience this problem.

comment:13 Changed 4 months ago by kencu (Ken)

Given that harfbuzz and harfbuzz-icu build without issue on 10.7.5 now, it would seem this ticket could be closed:

$ port -v installed | grep harf
  harfbuzz @1.4.6_0 platform='darwin 11' archs='x86_64' date='2017-07-16T01:29:03+0200'
  harfbuzz @1.4.7_0 (active) platform='darwin 11' archs='x86_64' date='2017-07-24T18:38:21+0200'
  harfbuzz-icu @1.4.6_0 platform='darwin 11' archs='x86_64' date='2017-07-16T01:44:47+0200'
  harfbuzz-icu @1.4.7_0 (active) platform='darwin 11' archs='x86_64' date='2017-07-24T18:38:23+0200'
Note: See TracTickets for help on using tickets.