Opened 4 years ago

Last modified 8 months ago

#46287 assigned defect

icu @58.2, icu-lx @58.2: .pc files and -config scripts contain -std= flags

Reported by: bK4gYuRo Owned by: ryandesign (Ryan Schmidt)
Priority: Normal Milestone:
Component: ports Version: 2.3.3
Keywords: Cc: tim@…, desmith@…
Port: 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 4 years ago.

Download all attachments as: .zip

Change History (15)

Changed 4 years ago by bK4gYuRo

Attachment: main.log added

comment:1 Changed 4 years ago by bK4gYuRo

Cc: macports@… added

Cc Me!

comment:2 Changed 4 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 4 years ago by ryandesign (Ryan Schmidt)

Description: modified (diff)

comment:4 Changed 4 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 4 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 Changed 4 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 4 years ago by ryandesign (Ryan Schmidt) (previous) (diff)

comment:7 in reply to:  description Changed 4 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 4 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 ; Changed 4 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 ; Changed 4 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 4 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 3 years ago by ryandesign (Ryan Schmidt)

Cc: tim@… desmith@… added
Keywords: lion added
Status: newassigned
Summary: harfbuzz-icu 0.9.37_0 build fails on 10.7.5harfbuzz-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 15 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'

comment:14 in reply to:  13 Changed 8 months ago by ryandesign (Ryan Schmidt)

Keywords: lion removed
Port: harfbuzz-icu removed
Summary: harfbuzz-icu @0.9.37_0: cc1plus: error: unrecognized command line option "-std=c++0x"icu @58.2, icu-lx @58.2: .pc files and -config scripts contain -std= flags

Replying to kencu:

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

No. The bug is that icu puts -std=... flags in its .pc files and -config script. icu @58.2 still does that. We have not updated to newer versions of icu because they require C++11. Now that we have the cxx11 1.1 portgroup, maybe it would be ok to update icu to a newer version, but I don't know if that would fix this bug; the upstream ticket is still open.

The originally reported build failure of harfbuzz-icu with llvm-gcc-4.2 won't happen anymore because the harfbuzz port now blacklists llvm-gcc-4.2.

Note: See TracTickets for help on using tickets.