| OLD | NEW |
| 1 # Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 # Definitions of symbols that may be needed at runtime but aren't necessarily | 5 # Definitions of symbols that may be needed at runtime but aren't necessarily |
| 6 # present in the SDK chosen for compilation. | 6 # present in the SDK chosen for compilation. |
| 7 # | 7 # |
| 8 # This file provides symbols for _NSConcreteGlobalBlock and | 8 # This file provides symbols for _NSConcreteGlobalBlock and |
| 9 # _NSConcreteStackBlock, normally present in libSystem.dylib and provided by | 9 # _NSConcreteStackBlock, normally present in libSystem.dylib and provided by |
| 10 # by libclosure-38/data.c in Mac OS X 10.6 and later. When using the 10.5 SDK, | 10 # by libclosure-38/data.c in Mac OS X 10.6 and later. It also provides symbols |
| 11 # the symbols are not present. This file's definition can be used with extreme | 11 # for various block runtime functions provided by libclosure-38/runtime.c. |
| 12 # care in an application that needs to use the 10.5 SDK in conjunction with | 12 # When using the 10.5 SDK, the symbols are not present. This file's definition |
| 13 # blocks. | 13 # can be used with extreme care in an application that needs to use the 10.5 |
| 14 # SDK in conjunction with blocks. |
| 14 # | 15 # |
| 15 # This file cooperates with the build system to produce a dynamic library | 16 # This file cooperates with the build system to produce a dynamic library |
| 16 # that, when linked against, causes dependents to look in libSystem for the | 17 # that, when linked against, causes dependents to look in libSystem for the |
| 17 # symbols provided here. It also cooperates with a header that causes | 18 # symbols provided here. It also cooperates with a header that causes |
| 18 # dependents to treat the symbols provided here as weak imports, critical for | 19 # dependents to treat the symbols provided here as weak imports, critical for |
| 19 # the resultant output to be loadable on 10.5. | 20 # the resultant output to be loadable on 10.5. |
| 20 | 21 |
| 21 # To simplify things, this file assumes it's being built with the 10.5 SDK, | 22 # To simplify things, this file assumes it's being built with the 10.5 SDK, |
| 22 # a deployment target of 10.5, and is producing 32-bit x86 code. Other | 23 # a deployment target of 10.5, and is producing 32-bit x86 code. Other |
| 23 # combinations are possible, but not interesting for the time being. See | 24 # combinations are possible, but not interesting for the time being. See |
| 24 # <sys/cdefs.h> for interesting ways that names might be mangled in other | 25 # <sys/cdefs.h> for interesting ways that names might be mangled in other |
| 25 # configurations. | 26 # configurations. |
| 26 | 27 |
| 27 #include <AvailabilityMacros.h> | 28 #include <AvailabilityMacros.h> |
| 28 | 29 |
| 29 #if MAC_OS_X_VERSION_MIN_REQUIRED != MAC_OS_X_VERSION_10_5 || \ | 30 #if MAC_OS_X_VERSION_MIN_REQUIRED != MAC_OS_X_VERSION_10_5 || \ |
| 30 MAC_OS_X_VERSION_MAX_ALLOWED != MAC_OS_X_VERSION_10_5 || \ | 31 MAC_OS_X_VERSION_MAX_ALLOWED != MAC_OS_X_VERSION_10_5 || \ |
| 31 !defined(__i386__) | 32 !defined(__i386__) |
| 32 #error This file only supports 32-bit x86 code with both SDK and DT set to 10.5 | 33 #error This file only supports 32-bit x86 code with both SDK and DT set to 10.5 |
| 33 #endif | 34 #endif |
| 34 | 35 |
| 35 #define DEFINE_GLOBAL_SYMBOL(name) \ | 36 #define DEFINE_GLOBAL_SYMBOL(name) \ |
| 36 .globl name ## ;\ | 37 .globl name ## ;\ |
| 37 name ## : | 38 name ## : |
| 38 | 39 |
| 40 .text |
| 41 |
| 42 # Mac OS X 10.6.8 libclosure-38/runtime.c |
| 43 |
| 44 DEFINE_GLOBAL_SYMBOL(__Block_copy) |
| 45 DEFINE_GLOBAL_SYMBOL(__Block_release) |
| 46 DEFINE_GLOBAL_SYMBOL(__Block_object_assign) |
| 47 DEFINE_GLOBAL_SYMBOL(__Block_object_dispose) |
| 48 |
| 39 .section __DATA,__data | 49 .section __DATA,__data |
| 40 | 50 |
| 51 # Mac OS X 10.6.8 libclosure-38/data.c |
| 52 |
| 41 DEFINE_GLOBAL_SYMBOL(__NSConcreteGlobalBlock) | 53 DEFINE_GLOBAL_SYMBOL(__NSConcreteGlobalBlock) |
| 42 DEFINE_GLOBAL_SYMBOL(__NSConcreteStackBlock) | 54 DEFINE_GLOBAL_SYMBOL(__NSConcreteStackBlock) |
| 43 | 55 |
| 44 # When this file is in use, the linker is expected to link things against both | 56 # When this file is in use, the linker is expected to link things against both |
| 45 # this file and the real copy of libSystem present in the SDK. When doing so, | 57 # this file and the real copy of libSystem present in the SDK. When doing so, |
| 46 # the linker is smart enough to produce only one LC_LOAD_DYLIB load command. | 58 # the linker is smart enough to produce only one LC_LOAD_DYLIB load command. |
| 47 # However, it's not smart enough to notice that while this file's dylib only | 59 # However, it's not smart enough to notice that while this file's dylib only |
| 48 # provides weak-imported symbols, the real libSystem's dylib does not. | 60 # provides weak-imported symbols, the real libSystem's dylib does not. |
| 49 # Consequently, it may produce an LC_LOAD_WEAK_DYLIB load command for | 61 # Consequently, it may produce an LC_LOAD_WEAK_DYLIB load command for |
| 50 # libSystem instead of an ordinary LC_LOAD_DYLIB command. LC_LOAD_WEAK_DYLIB | 62 # libSystem instead of an ordinary LC_LOAD_DYLIB command. LC_LOAD_WEAK_DYLIB |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 118 | 130 |
| 119 # Some data-section symbols that might be referenced. | 131 # Some data-section symbols that might be referenced. |
| 120 | 132 |
| 121 .section __DATA,__data | 133 .section __DATA,__data |
| 122 | 134 |
| 123 DEFINE_GLOBAL_SYMBOL(___stdinp) | 135 DEFINE_GLOBAL_SYMBOL(___stdinp) |
| 124 DEFINE_GLOBAL_SYMBOL(___stdoutp) | 136 DEFINE_GLOBAL_SYMBOL(___stdoutp) |
| 125 DEFINE_GLOBAL_SYMBOL(___stderrp) | 137 DEFINE_GLOBAL_SYMBOL(___stderrp) |
| 126 | 138 |
| 127 #undef DEFINE_GLOBAL_SYMBOL | 139 #undef DEFINE_GLOBAL_SYMBOL |
| OLD | NEW |