From: Maarten t. H. <mth...@us...> - 2013-10-22 23:14:16
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "openMSX (main)". The branch, master has been updated via e97f7029bee5412b8972eff8b4544c2e1155c8b3 (commit) via d62548d46ad1d69e2ee9d64dd4576dc32a4f0d82 (commit) via b94d75c5671b3845df32e8e2146e8b7d693814a0 (commit) from ceb324c7efffeff9244b575ea4bfc74d2bfa58a9 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit e97f7029bee5412b8972eff8b4544c2e1155c8b3 Author: Maarten ter Huurne <ma...@tr...> Date: Wed Oct 23 00:05:47 2013 +0200 Fixed platform Makefile for OS X 10.7 Use xcode-select to acquire SDK path. Use libc++ as the C++ standard library, since the libstdc++ version included in the SDK is from GCC 4.2 and therefore not suitable for C++11. Drop ability to select minimum OS X version and SDK version separately, since that didn't work in practice. Drop ability to compile against libraries installed in /usr/local; no-one I know of is using that. commit d62548d46ad1d69e2ee9d64dd4576dc32a4f0d82 Author: Maarten ter Huurne <ma...@tr...> Date: Sun Oct 20 17:28:03 2013 +0200 Tell Clang that we're compiling C++11 commit b94d75c5671b3845df32e8e2146e8b7d693814a0 Author: Maarten ter Huurne <ma...@tr...> Date: Sat Oct 12 13:09:26 2013 +0200 Added workaround to AlignedBuffer for compilation with Clang ----------------------------------------------------------------------- Summary of changes: build/main.mk | 2 +- build/platform-darwin.mk | 61 +++++++++++++------------------------------- src/utils/AlignedBuffer.hh | 8 +++++- 3 files changed, 26 insertions(+), 45 deletions(-) diff --git a/build/main.mk b/build/main.mk index 8433450..d9091de 100644 --- a/build/main.mk +++ b/build/main.mk @@ -311,7 +311,7 @@ WINDRES?=windres DEPEND_FLAGS:= ifneq ($(filter %clang++,$(CXX))$(filter clang++%,$(CXX)),) # Enable C++11 - COMPILE_FLAGS+=-std=c++0x + COMPILE_FLAGS+=-std=c++11 # Clang does support -Wunused-macros, but it triggers on SDL's headers, # causing way too many false positives that we cannot fix. COMPILE_FLAGS+=-Wall -Wextra -Wundef diff --git a/build/platform-darwin.mk b/build/platform-darwin.mk index 54e1eca..766bbff 100644 --- a/build/platform-darwin.mk +++ b/build/platform-darwin.mk @@ -21,57 +21,32 @@ EXEEXT:= LIBRARYEXT:=.so # Select the OS X version we want to be compatible with. -# TODO: When compiling an executable for local use, we could pick the OS X -# version we are running on instead of the oldest version we support. -# But at the moment I don't want to make this more complex than it -# already is. -ifeq ($(OPENMSX_TARGET_CPU),x86_64) -OSX_MIN_VER:=10.6 +# In theory it is possible to compile against an OS X version number lower +# than the SDK version number, but in practice this doesn't seem to work +# since libraries such as libxml2 can change soname between OS X versions. +# Clang as shipped with Xcode requires OS X 10.7 or higher for compiling with +# libc++, when compiling Clang and libc++ from source 10.6 works as well. +OSX_VER:=10.7 +TARGET_FLAGS+=-mmacosx-version-min=$(OSX_VER) + +# Select the SDK to use. +XCODE_PATH:=$(shell xcode-select -print-path) +ifneq ($(XCODE_PATH),) +SDK_PATH:=$(XCODE_PATH)/Platforms/MacOSX.platform/Developer/SDKs/MacOSX$(OSX_VER).sdk else -OSX_MIN_VER:=10.4 -endif -TARGET_FLAGS+=-mmacosx-version-min=$(OSX_MIN_VER) - -# Select the SDK to use. This can be higher than the OS X minimum version. -# The SDK path for Xcode from the Mac App Store: -SDK_PATH:=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.6.sdk/ -ifneq ($(shell [ -d $(SDK_PATH) ] && echo exists)$(filter $(OPENMSX_TARGET_CPU),ppc),exists) # The SDK path for the older stand-alone Xcode: -SDK_PATH:=/Developer/SDKs/MacOSX10.6.sdk -endif +SDK_PATH:=/Developer/SDKs/MacOSX$(OSX_VER).sdk ifneq ($(shell [ -d $(SDK_PATH) ] && echo exists),exists) $(error No Mac OS X SDK found) endif +endif +$(info Using SDK: $(SDK_PATH)) TARGET_FLAGS+=-isysroot $(SDK_PATH) -ifeq ($(OPENMSX_TARGET_CPU),ppc) -# Select an appropriate GCC version. Only PPC doesn't use clang yet. -CXX:=$(SDK_PATH)/../../usr/bin/g++-4.2 -else -# Select clang as the compiler. +# Select Clang as the compiler and libc++ as the standard library. CXX:=clang++ -endif - -ifeq ($(filter 3RD_%,$(LINK_MODE)),) -# Compile against local libs. We assume the binary is intended to be run on -# this Mac only. -# Note that even though we compile for local use, we still have to compile -# against the SDK since OS X 10.3 will have link problems otherwise (the -# QuickTime framework in particular is notorious for this). - -# TODO: Verify whether this is how to do it. -COMPILE_FLAGS+=-I/usr/local/include - -# When NEXT_ROOT is defined, /usr/lib will not be scanned for libraries by -# default, but users might have installed some dependencies there. -LINK_FLAGS+=-L/usr/lib -else -# Compile against 3rdparty libs. We assume the binary is intended to be run -# on different Mac OS X versions, so we compile against the SDKs for the -# system-wide libraries. - -# Nothing to define. -endif +COMPILE_FLAGS+=-stdlib=libc++ +LINK_FLAGS+=-lc++ # Link against CoreMIDI. LINK_FLAGS+=-framework CoreMIDI diff --git a/src/utils/AlignedBuffer.hh b/src/utils/AlignedBuffer.hh index dcd61bb..561c9c2 100644 --- a/src/utils/AlignedBuffer.hh +++ b/src/utils/AlignedBuffer.hh @@ -72,7 +72,13 @@ public: private: uint8_t dat[N]; -}; +} +// Repeat alignment because Clang 3.2svn does not inherit it from an empty +// base class. +#ifndef _MSC_VER +__attribute__((__aligned__((16)))) +#endif +; static_assert(ALIGNOF(AlignedByteArray<13>) == AlignedBuffer::ALIGNMENT, "must be aligned"); static_assert(sizeof(AlignedByteArray<32>) == 32, hooks/post-receive -- openMSX (main) |