Skip to content

Commit

Permalink
Merge branch 'release/1.6.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
mjansson committed Jun 22, 2017
2 parents 0607c5c + c9615c0 commit 314d1df
Show file tree
Hide file tree
Showing 78 changed files with 1,905 additions and 1,613 deletions.
4 changes: 4 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,7 @@
*.PDF diff=astextplain
*.rtf diff=astextplain
*.RTF diff=astextplain

# Ignore build scripts in language stats
build/* linguist-vendored
configure.py linguist-vendored=true
35 changes: 35 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,4 +1,39 @@

1.6.0

Use pthread_exit to terminate threads on POSIX for compatibility with libs overriding
pthread_exit or using pthread_cleanup_push.

Add thread_enter and memory_thread_initialize to provide optional entry points for
memory system per-thread initialization.

Add hint flags to memory reallocation to optionally avoid copying to preserve old content.

Make memory reallocation respect 32bit flag and fall back to alloc and copy.

Fix parsing of negative numbers in JSON/SJSON parser.

Unify macOS/iOS delegate_nswindow and delegate_uiwindow functions to delegate_window.

Support using SetThreadDescription (if present) to set thread name on Windows.

Change MacOSX platform names and identifiers to macOS (FOUNDATION_PLATFORM_MACOS).

Fix race condition in ring buffer streams read/write.

Use C11 atomics for all compilers (except Microsoft) instead of builtin or own implementations.
Add memory order control to all atomic operations.

semaphore_initialize and semaphore_initialize_named now return boolean success/fail indicator

Change object map to use semaphore for write operation instead of atomics. Also change
object map index to 32 bit, and object_t type to 32 bit.

Add a mock system to tests to simulate failing system calls.

Remove flag to memory allocation to allocate in low 32-bit address range on 64-bit systems.


1.5.3

Added thread finalizer to memory system to clean up resources on thread exit.
Expand Down
2 changes: 1 addition & 1 deletion build/ninja/android.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ def initialize_toolchain(self):
self.hostarchname = 'linux-x86_64'
else:
self.hostarchname = 'linux-x86'
elif self.host.is_macosx():
elif self.host.is_macos():
self.hostarchname = 'darwin-x86_64'

def build_toolchain(self):
Expand Down
37 changes: 17 additions & 20 deletions build/ninja/clang.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def initialize(self, project, archs, configs, includepaths, dependlibs, libpaths
self.sysroot = ''
if self.target.is_ios():
self.deploymenttarget = '9.0'
if self.target.is_macosx():
if self.target.is_macos():
self.deploymenttarget = '10.7'

#Command definitions
Expand Down Expand Up @@ -79,7 +79,7 @@ def initialize(self, project, archs, configs, includepaths, dependlibs, libpaths
self.builders['lib'] = self.builder_lib
self.builders['sharedlib'] = self.builder_sharedlib
self.builders['bin'] = self.builder_bin
if self.target.is_macosx() or self.target.is_ios():
if self.target.is_macos() or self.target.is_ios():
self.builders['m'] = self.builder_cm
self.builders['multilib'] = self.builder_apple_multilib
self.builders['multisharedlib'] = self.builder_apple_multisharedlib
Expand Down Expand Up @@ -113,10 +113,10 @@ def parse_prefs(self, prefs):
iosprefs = prefs['ios']
if 'deploymenttarget' in iosprefs:
self.deploymenttarget = iosprefs['deploymenttarget']
if self.target.is_macosx() and 'macosx' in prefs:
macosxprefs = prefs['macosx']
if 'deploymenttarget' in macosxprefs:
self.deploymenttarget = macosxprefs['deploymenttarget']
if self.target.is_macos() and 'macos' in prefs:
macosprefs = prefs['macos']
if 'deploymenttarget' in macosprefs:
self.deploymenttarget = macosprefs['deploymenttarget']
if self.target.is_pnacl() and 'pnacl' in prefs:
pnaclprefs = prefs['pnacl']
if 'sdkpath' in pnaclprefs:
Expand All @@ -130,15 +130,15 @@ def write_variables(self, writer):
writer.variable('cc', self.ccompiler)
writer.variable('ar', self.archiver)
writer.variable('link', self.linker)
if self.target.is_macosx() or self.target.is_ios():
if self.target.is_macos() or self.target.is_ios():
writer.variable('lipo', self.lipo)
if self.target.is_pnacl():
writer.variable('finalize', self.finalizer)
writer.variable('nmf', self.nmfer)
writer.variable('includepaths', self.make_includepaths(self.includepaths))
writer.variable('moreincludepaths', '')
writer.variable('cflags', self.cflags)
if self.target.is_macosx() or self.target.is_ios():
if self.target.is_macos() or self.target.is_ios():
writer.variable('mflags', self.mflags)
writer.variable('carchflags', '')
writer.variable('cconfigflags', '')
Expand All @@ -159,7 +159,7 @@ def write_variables(self, writer):
def write_rules(self, writer):
super(ClangToolchain, self).write_rules(writer)
writer.rule('cc', command = self.cccmd, depfile = self.ccdepfile, deps = self.ccdeps, description = 'CC $in')
if self.target.is_macosx() or self.target.is_ios():
if self.target.is_macos() or self.target.is_ios():
writer.rule('cm', command = self.cmcmd, depfile = self.ccdepfile, deps = self.ccdeps, description = 'CM $in')
writer.rule( 'lipo', command = self.lipocmd, description = 'LIPO $out' )
writer.rule('ar', command = self.arcmd, description = 'LIB $out')
Expand All @@ -176,7 +176,7 @@ def build_toolchain(self):
self.build_windows_toolchain()
elif self.target.is_android():
self.build_android_toolchain()
elif self.target.is_macosx() or self.target.is_ios():
elif self.target.is_macos() or self.target.is_ios():
self.build_xcode_toolchain()
elif self.target.is_pnacl():
self.build_pnacl_toolchain()
Expand Down Expand Up @@ -205,7 +205,7 @@ def build_android_toolchain(self):
self.toolchain = os.path.join('$ndk', 'toolchains', 'llvm', 'prebuilt', self.android.hostarchname, 'bin', '')

def build_xcode_toolchain(self):
if self.target.is_macosx():
if self.target.is_macos():
sdk = 'macosx'
deploytarget = 'MACOSX_DEPLOYMENT_TARGET=' + self.deploymenttarget
self.cflags += ['-fasm-blocks', '-mmacosx-version-min=' + self.deploymenttarget, '-isysroot', '$sysroot']
Expand All @@ -222,10 +222,7 @@ def build_xcode_toolchain(self):
platformpath = subprocess.check_output(['xcrun', '--sdk', sdk, '--show-sdk-platform-path']).strip()
localpath = platformpath + "/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"

if self.target.is_macosx():
self.sysroot = subprocess.check_output(['xcrun', '--sdk', 'macosx', '--show-sdk-path']).strip()
elif self.target.is_ios():
self.sysroot = subprocess.check_output(['xcrun', '--sdk', 'iphoneos', '--show-sdk-path']).strip()
self.sysroot = subprocess.check_output(['xcrun', '--sdk', sdk, '--show-sdk-path']).strip()

self.ccompiler = "PATH=" + localpath + " " + subprocess.check_output(['xcrun', '--sdk', sdk, '-f', 'clang']).strip()
self.archiver = "PATH=" + localpath + " " + subprocess.check_output(['xcrun', '--sdk', sdk, '-f', 'libtool']).strip()
Expand All @@ -239,7 +236,7 @@ def build_xcode_toolchain(self):
self.arcmd = self.rmcmd('$out') + ' && $ar $ararchflags $arflags $in -o $out'
self.lipocmd = '$lipo $in -create -output $out'

if self.target.is_macosx():
if self.target.is_macos():
self.frameworks = ['Cocoa', 'CoreFoundation']
if self.target.is_ios():
self.frameworks = ['CoreGraphics', 'UIKit', 'Foundation']
Expand Down Expand Up @@ -301,7 +298,7 @@ def make_targetarchflags(self, arch, targettype):
elif arch == 'mips64':
flags += ['-target', 'mips64el-none-linux-android']
flags += ['-gcc-toolchain', self.android.make_gcc_toolchain_path(arch)]
elif self.target.is_macosx() or self.target.is_ios():
elif self.target.is_macos() or self.target.is_ios():
if arch == 'x86':
flags += [' -arch x86']
elif arch == 'x86-64':
Expand Down Expand Up @@ -355,7 +352,7 @@ def make_linkarchflags(self, arch, targettype, variables):
flags += ['-Xlinker', '/MACHINE:X86']
elif arch == 'x86-64':
flags += ['-Xlinker', '/MACHINE:X64']
if self.target.is_macosx() and 'support_lua' in variables and variables['support_lua']:
if self.target.is_macos() and 'support_lua' in variables and variables['support_lua']:
flags += ['-pagezero_size', '10000', '-image_base', '100000000']
return flags

Expand Down Expand Up @@ -390,13 +387,13 @@ def make_frameworks(self, frameworks):

def make_configlibpaths(self, config, arch, extralibpaths):
libpaths = [self.libpath, os.path.join(self.libpath, config)]
if not self.target.is_macosx() and not self.target.is_ios():
if not self.target.is_macos() and not self.target.is_ios():
libpaths += [os.path.join(self.libpath, arch)]
libpaths += [os.path.join(self.libpath, config, arch)]
if extralibpaths != None:
libpaths += [os.path.join(libpath, self.libpath) for libpath in extralibpaths]
libpaths += [os.path.join(libpath, self.libpath, config) for libpath in extralibpaths]
if not self.target.is_macosx() and not self.target.is_ios():
if not self.target.is_macos() and not self.target.is_ios():
libpaths += [os.path.join(libpath, self.libpath, arch) for libpath in extralibpaths]
libpaths += [os.path.join(libpath, self.libpath, config, arch) for libpath in extralibpaths]
return self.make_libpaths(libpaths)
Expand Down
32 changes: 16 additions & 16 deletions build/ninja/codesign.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
help = 'Bundle/package to sign')
parser.add_argument('--target', type=str,
help = 'Target',
choices = ['macosx', 'ios', 'android'],
choices = ['macos', 'ios', 'android'],
default = '')
parser.add_argument('--bundle', type=str,
help = 'Bundle identifier (OSX/iOS)',
Expand Down Expand Up @@ -65,13 +65,13 @@

androidprefs = {}
iosprefs = {}
macosxprefs = {}
macosprefs = {}


def parse_prefs( prefsfile ):
global androidprefs
global iosprefs
global macosxprefs
global macosprefs
if not os.path.isfile( prefsfile ):
return
file = open( prefsfile, 'r' )
Expand All @@ -81,8 +81,8 @@ def parse_prefs( prefsfile ):
androidprefs = prefs['android']
if 'ios' in prefs:
iosprefs = prefs['ios']
if 'macosx' in prefs:
macosxprefs = prefs['macosx']
if 'macos' in prefs:
macosprefs = prefs['macos']


def codesign_ios():
Expand Down Expand Up @@ -135,13 +135,13 @@ def codesign_ios():
os.utime( options.file, None )


def codesign_macosx():
if not 'organisation' in macosxprefs:
macosxprefs['organisation'] = options.organisation
if not 'bundleidentifier' in macosxprefs:
macosxprefs['bundleidentifier'] = options.bundle
if not 'provisioning' in macosxprefs:
macosxprefs['provisioning'] = options.provisioning
def codesign_macos():
if not 'organisation' in macosprefs:
macosprefs['organisation'] = options.organisation
if not 'bundleidentifier' in macosprefs:
macosprefs['bundleidentifier'] = options.bundle
if not 'provisioning' in macosprefs:
macosprefs['provisioning'] = options.provisioning

codesign_allocate = subprocess.check_output( [ 'xcrun', '--sdk', 'macosx', '-f', 'codesign_allocate' ] ).strip()
sdkdir = subprocess.check_output( [ 'xcrun', '--sdk', 'macosx', '--show-sdk-path' ] ).strip()
Expand All @@ -150,8 +150,8 @@ def codesign_macosx():
if os.path.isfile( os.path.join( options.file, 'Contents', '_CodeSignature', 'CodeResources' ) ):
os.remove( os.path.join( options.file, 'Contents', '_CodeSignature', 'CodeResources' ) )

if 'signature' in macosxprefs:
os.system( 'export CODESIGN_ALLOCATE=' + codesign_allocate + '; /usr/bin/codesign --force --sign ' + macosxprefs['signature'] + ' ' + options.file )
if 'signature' in macosprefs:
os.system( 'export CODESIGN_ALLOCATE=' + codesign_allocate + '; /usr/bin/codesign --force --sign ' + macosprefs['signature'] + ' ' + options.file )

if os.path.isfile( os.path.join( options.file, 'Contents', '_CodeSignature', 'CodeResources' ) ):
os.utime( os.path.join( options.file, 'Contents', '_CodeSignature', 'CodeResources' ), None )
Expand Down Expand Up @@ -215,7 +215,7 @@ def codesign_android():

if options.target == 'ios':
codesign_ios()
elif options.target == 'macosx':
codesign_macosx()
elif options.target == 'macos':
codesign_macos()
elif options.target == 'android':
codesign_android()
31 changes: 27 additions & 4 deletions build/ninja/msvc.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,12 +109,16 @@ def write_rules(self, writer):

def build_toolchain(self):
if self.toolchain == '':
versions = ['14.0', '13.0', '12.0', '11.0', '10.0']
versions = ['15.0', '14.0', '13.0', '12.0', '11.0', '10.0']
keys = [
'HKLM\\SOFTWARE\\Microsoft\\VisualStudio\\SxS\\VC7',
'HKCU\\SOFTWARE\\Microsoft\\VisualStudio\\SxS\\VC7',
'HKLM\\SOFTWARE\\Microsoft\\VisualStudio\\SxS\\VS7',
'HKCU\\SOFTWARE\\Microsoft\\VisualStudio\\SxS\\VS7',
'HKLM\\SOFTWARE\\Wow6432Node\\Microsoft\\VisualStudio\\SxS\\VC7',
'HKCU\\SOFTWARE\\Wow6432Node\\Microsoft\\VisualStudio\\SxS\\VC7'
'HKCU\\SOFTWARE\\Wow6432Node\\Microsoft\\VisualStudio\\SxS\\VC7',
'HKLM\\SOFTWARE\\Wow6432Node\\Microsoft\\VisualStudio\\SxS\\VS7',
'HKCU\\SOFTWARE\\Wow6432Node\\Microsoft\\VisualStudio\\SxS\\VS7'
]
toolchain = ''
for version in versions:
Expand All @@ -126,8 +130,16 @@ def build_toolchain(self):
except:
continue
if not toolchain == '':
#Thanks MS for making it _really_ hard to find the compiler
if version == '15.0':
tools_basepath = os.path.join(toolchain, 'VC', 'Tools', 'MSVC')
tools_list = [item for item in os.listdir(tools_basepath) if os.path.isdir(os.path.join(tools_basepath, item))]
from distutils.version import StrictVersion
tools_list.sort(key=StrictVersion)
toolchain = os.path.join(tools_basepath, tools_list[-1])
self.includepaths += [os.path.join(toolchain, 'include')]
self.toolchain = toolchain
self.toolchain_version = version
break
if not toolchain == '':
break
Expand Down Expand Up @@ -192,6 +204,11 @@ def make_libpaths(self, libpaths):
return []

def make_arch_toolchain_path(self, arch):
if self.toolchain_version == '15.0':
if arch == 'x86-64':
return os.path.join(self.toolchain, 'bin', 'HostX64', 'x64\\')
elif arch == 'x86':
return os.path.join(self.toolchain, 'bin', 'HostX64', 'x86\\')
if arch == 'x86-64':
return os.path.join(self.toolchain, 'bin', 'amd64\\')
return os.path.join(self.toolchain, 'bin\\')
Expand Down Expand Up @@ -271,14 +288,20 @@ def make_configlibpaths(self, config, arch, extralibpaths):
libpaths += [os.path.join(libpath, self.libpath, config, arch) for libpath in extralibpaths]
if self.sdkpath != '':
if arch == 'x86':
libpaths += [os.path.join(self.toolchain, 'lib')]
if self.toolchain_version == '15.0':
libpaths += [os.path.join(self.toolchain, 'lib', 'x86')]
else:
libpaths += [os.path.join(self.toolchain, 'lib')]
if self.sdkversion == 'v8.1':
libpaths += [os.path.join( self.sdkpath, 'lib', 'winv6.3', 'um', 'x86')]
if self.sdkversion == 'v10.0':
libpaths += [os.path.join(self.sdkpath, 'lib', self.sdkversionpath, 'um', 'x86')]
libpaths += [os.path.join(self.sdkpath, 'lib', self.sdkversionpath, 'ucrt', 'x86')]
else:
libpaths += [os.path.join( self.toolchain, 'lib', 'amd64')]
if self.toolchain_version == '15.0':
libpaths += [os.path.join( self.toolchain, 'lib', 'x64')]
else:
libpaths += [os.path.join( self.toolchain, 'lib', 'amd64')]
if self.sdkversion == 'v8.1':
libpaths += [os.path.join( self.sdkpath, 'lib', 'winv6.3', 'um', 'x64')]
if self.sdkversion == 'v10.0':
Expand Down
10 changes: 5 additions & 5 deletions build/ninja/platform.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import sys

def supported_platforms():
return [ 'windows', 'linux', 'macosx', 'bsd', 'ios', 'android', 'raspberrypi', 'pnacl', 'tizen' ]
return [ 'windows', 'linux', 'macos', 'bsd', 'ios', 'android', 'raspberrypi', 'pnacl', 'tizen' ]

class Platform(object):
def __init__(self, platform):
Expand All @@ -15,9 +15,9 @@ def __init__(self, platform):
if self.platform.startswith('linux'):
self.platform = 'linux'
elif self.platform.startswith('darwin'):
self.platform = 'macosx'
self.platform = 'macos'
elif self.platform.startswith('macos'):
self.platform = 'macosx'
self.platform = 'macos'
elif self.platform.startswith('win'):
self.platform = 'windows'
elif 'bsd' in self.platform:
Expand All @@ -42,8 +42,8 @@ def is_linux(self):
def is_windows(self):
return self.platform == 'windows'

def is_macosx(self):
return self.platform == 'macosx'
def is_macos(self):
return self.platform == 'macos'

def is_bsd(self):
return self.platform == 'bsd'
Expand Down
4 changes: 2 additions & 2 deletions build/ninja/plist.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,9 @@ def replace_var( str, var, val ):
if not options.prodname:
options.prodname = 'unknown'
if not options.target:
options.target = 'macosx'
options.target = 'macos'
if not options.deploymenttarget:
if options.target == 'macosx':
if options.target == 'macos':
options.deploymenttarget = '10.7'
else:
options.deploymenttarget = '6.0'
Expand Down
Loading

0 comments on commit 314d1df

Please sign in to comment.