v8_mac_rel CQ builder and C++11

23 views
Skip to first unread message

Daniel Cheng

unread,
Mar 7, 2016, 2:18:37 PM3/7/16
to v8-...@googlegroups.com, Nico Weber
Who's responsible for maintaining these bots? It looks like v8_mac_rel doesn't understand C++11 constructs still: https://build.chromium.org/p/tryserver.v8/builders/v8_mac_rel/builds/16596

This seems to be related to -mmacosx-version-min=10.5: is there any chance that we'll be dropping support for older OS X in V8 at some point?

Daniel

Adam Klein

unread,
Mar 7, 2016, 2:51:01 PM3/7/16
to v8-...@googlegroups.com, Nico Weber, mache...@chromium.org
+machenbach, who maintains the bots.

--
--
v8-dev mailing list
v8-...@googlegroups.com
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to v8-dev+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Michael Achenbach

unread,
Mar 9, 2016, 2:37:50 AM3/9/16
to v8-...@googlegroups.com, Nico Weber
The bots have all version 10.9.5.

@Nico, what else would be required? Maybe there's something missing in our standalone.gypi?

Jakob Kummerow

unread,
Mar 9, 2016, 4:16:39 AM3/9/16
to v8-...@googlegroups.com, Nico Weber
I think what Daniel was referring to is 'mac_deployment_target%': '10.5' in standalone.gypi, not the OS version that's actually installed on the bots. 

Maybe it's time to bump up the deployment target. Traditionally V8 has supported older OS versions than Chromium, but lacking tools like UMA it's really hard to estimate how important support for any given OS is in practice.

Nico Weber

unread,
Mar 9, 2016, 1:09:42 PM3/9/16
to Jakob Kummerow, v8-...@googlegroups.com
When building on OS X, you tell the compiler what the lowest OS X version is that you want to support – this is the mac_deployment_target thing Jakob mentioned. The SDK then makes certain functionality available only as weak symbols (e.g. if you want to support running all the way back on 10.6, but some function was introduced in 10.8, then that function is a weak symbol and you have to make sure you check it to be non-NULL before you call it). libc++ is the system library, so these weak symbol tricks don't work and you need to explicitly tell the compiler which C++ standard library to use. OS X started shipping a system libc++ in parallel to its very old libstdc++ 4.2 in OS X 10.7. So if your deployment target is older than 10.7, you cannot use the system libc++. If your deployment target is 10.9+ (I think), then the compiler will use libc++ by default. If your deployment target is 10.7 or 10.8 (iirc), you can opt in to libc++ but the default is still libstdc++.

All the C++11 stuff requires libc++, since Apple stopped updating their libstdc++ long ago.

For v8, the best recommendation is probably to drop support for 10.5 and 10.6 (and maybe 10.7 and 10.8 too – Chromium is dropping support for 10.6-10.8 in the next release), if you're able to do this.

In Chromium, we jumped through some hoops to link against libc++ and still target 10.6 for a few releases so we could use C++11 stuff earlier. https://docs.google.com/document/d/1cFVCLYqpVV0pn2aX09SALcE3BN351sFN_rTcPcHRg3U/edit documents the approach, and Chromium's build files show how this was implemented if you want to do that. But easiest is to just up your deployment target to 10.7 and tell the compiler to use libc++. (To do this, in gyp add  'CLANG_CXX_LIBRARY': 'libc++' to your xcode_settings block, and in gn add "-stdlib=libc++" to your cflags_cc and ldflags.)

dch...@chromium.org

unread,
Mar 11, 2016, 7:41:50 PM3/11/16
to v8-dev, jkum...@chromium.org, tha...@chromium.org
@Michael: does dropping support for 10.5 / 10.6 and opting into libc++ make sense? Shall I file a bug to track this?

Daniel
Reply all
Reply to author
Forward
0 new messages