diff --git a/compat/compat.gyp b/compat/compat.gyp index 56daa3f8..e2b2df6d 100644 --- a/compat/compat.gyp +++ b/compat/compat.gyp @@ -23,6 +23,7 @@ 'sources': [ 'mac/AvailabilityMacros.h', 'mac/kern/exc_resource.h', + 'mac/mach/i386/thread_state.h', 'mac/mach/mach.h', 'mac/mach-o/getsect.cc', 'mac/mach-o/getsect.h', diff --git a/compat/mac/mach/i386/thread_state.h b/compat/mac/mach/i386/thread_state.h new file mode 100644 index 00000000..de744d64 --- /dev/null +++ b/compat/mac/mach/i386/thread_state.h @@ -0,0 +1,28 @@ +// Copyright 2017 The Crashpad Authors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef CRASHPAD_COMPAT_MAC_MACH_I386_THREAD_STATE_H_ +#define CRASHPAD_COMPAT_MAC_MACH_I386_THREAD_STATE_H_ + +#include_next + +// 10.13 SDK +// +// This was defined as 244 in the 10.7 through 10.12 SDKs, and 144 previously. +#if I386_THREAD_STATE_MAX < 614 +#undef I386_THREAD_STATE_MAX +#define I386_THREAD_STATE_MAX (614) +#endif + +#endif // CRASHPAD_COMPAT_MAC_MACH_I386_THREAD_STATE_H_ diff --git a/compat/mac/mach/mach.h b/compat/mac/mach/mach.h index 9cfe6b62..55f5fdd2 100644 --- a/compat/mac/mach/mach.h +++ b/compat/mac/mach/mach.h @@ -93,6 +93,20 @@ #define x86_AVX_STATE 18 #endif +// 10.13 SDK + +#ifndef x86_AVX512_STATE32 +#define x86_AVX512_STATE32 19 +#endif + +#ifndef x86_AVX512_STATE64 +#define x86_AVX512_STATE64 20 +#endif + +#ifndef x86_AVX512_STATE +#define x86_AVX512_STATE 21 +#endif + #endif // defined(__i386__) || defined(__x86_64__) // diff --git a/util/mach/mig.py b/util/mach/mig.py index a41c4f89..992f3e1a 100755 --- a/util/mach/mig.py +++ b/util/mach/mig.py @@ -111,6 +111,10 @@ def main(args): parser = argparse.ArgumentParser() parser.add_argument('--developer-dir', help='Path to Xcode') parser.add_argument('--sdk', help='Path to SDK') + parser.add_argument('--include', + default=[], + action='append', + help='Additional include directory') parser.add_argument('defs') parser.add_argument('user_c') parser.add_argument('server_c') @@ -124,10 +128,12 @@ def main(args): '-header', parsed.user_h, '-sheader', parsed.server_h, ] - if parsed.sdk is not None: - command.extend(['-isysroot', parsed.sdk]) if parsed.developer_dir is not None: os.environ['DEVELOPER_DIR'] = parsed.developer_dir + if parsed.sdk is not None: + command.extend(['-isysroot', parsed.sdk]) + for include in parsed.include: + command.extend(['-I' + include]) command.append(parsed.defs) subprocess.check_call(command) FixUserImplementation(parsed.user_c) diff --git a/util/util.gyp b/util/util.gyp index 60e41957..6a052273 100644 --- a/util/util.gyp +++ b/util/util.gyp @@ -285,7 +285,11 @@ '<(INTERMEDIATE_DIR)/util/mach/<(RULE_INPUT_ROOT)Server.h', ], 'action': [ - 'python', '<@(_inputs)', '<(RULE_INPUT_PATH)', '<@(_outputs)' + 'python', + '<@(_inputs)', + '<(RULE_INPUT_PATH)', + '<@(_outputs)', + '--include=../compat/mac' ], 'process_outputs_as_sources': 1, },