diff options
| author | Lakshmi Shanmugam | 2020-12-02 17:21:58 +0000 |
|---|---|---|
| committer | Lakshmi P Shanmugam | 2021-01-19 14:04:11 +0000 |
| commit | a7100cf4af4223827c96b9019fad260986084e93 (patch) | |
| tree | a6a4973c0b9e582ebb21f8604814393e3d15ce85 | |
| parent | cd2b67d8e046f1a305f8d5c6571eb4af3b79b0a9 (diff) | |
| download | eclipse.platform.swt-a7100cf4af4223827c96b9019fad260986084e93.tar.gz eclipse.platform.swt-a7100cf4af4223827c96b9019fad260986084e93.tar.xz eclipse.platform.swt-a7100cf4af4223827c96b9019fad260986084e93.zip | |
Bug 565887 - Build SWT Mac libraries with XCode 12
Changes for building for mac arm64 architecture:
1. Check MODEL for arm64 and x86_64 in build.sh
2. objc_msgSend_stret and objc_msgSendSuper_stret are not available on
arm64, replace with objc_msgSend and objc_msgSendSuper respectively.
3. Remove i386 and ppc code from os.h.
4. Add comments for STRUCT_SIZE_LIMIT
Change-Id: I995d433283fbbaa87b00bb7c960220d736bf3ce7
| -rw-r--r-- | bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/library/build.sh | 7 | ||||
| -rw-r--r-- | bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/library/os.h | 24 |
2 files changed, 17 insertions, 14 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/library/build.sh b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/library/build.sh index ec1635a62f..2b3114e29b 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/library/build.sh +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/library/build.sh @@ -31,8 +31,13 @@ if [ "x${MODEL}" = "xx86_64" ]; then else export CHROMIUM_HEADERS=$CHROMIUM_OUTPUT_DIR/../../../../eclipse.platform.swt/bundles/org.eclipse.swt.browser.chromium/common/rust-library/chromium_subp/cef_macosx fi +elif [ "x${MODEL}" = "xarm64" ]; then + export ARCHS="-arch arm64" + if [ "x${OUTPUT_DIR}" = "x" ]; then + export OUTPUT_DIR=../../../org.eclipse.swt.cocoa.macosx.arm64 + fi fi export MACOSX_DEPLOYMENT_TARGET=10.10 -make -f make_macosx.mak $1 $2 $3 $4 $5 $6 $7 $8 $9 +make -f make_macosx.mak $1 $2 $3 $4 $5 $6 $7 $8 $9
\ No newline at end of file diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/library/os.h b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/library/os.h index 30a5228ede..ffc668cfd9 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/library/os.h +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/library/os.h @@ -35,25 +35,23 @@ extern jint CPSSetProcessName(void *, jlong); #define objc_msgSendSuper_bool objc_msgSendSuper #define objc_msgSend_floatret objc_msgSend_fpret -#ifndef __i386__ -#define objc_msgSend_fpret objc_msgSend -#endif /* The structure objc_super defines "class" in i386/ppc and "super_class" in x86_64 */ -#ifdef __i386__ -#define swt_super_class class -#elif __ppc__ -#define swt_super_class class -#elif __x86_64__ +#ifdef __x86_64__ +#define swt_super_class super_class +#elif __arm64__ #define swt_super_class super_class #endif -#ifdef __i386__ -#define STRUCT_SIZE_LIMIT 8 -#elif __ppc__ -#define STRUCT_SIZE_LIMIT 4 -#elif __x86_64__ +/* STRUCT_SIZE_LIMIT is the maximum size of struct that can be returned using registers */ +/* When sizeof(struct) is greater than this limit, objc_msgSend*_stret call is used */ +/* objc_msgSend*_stret methods are not available on arm64 architecture, so objc_msgSend* calls are always used */ +#ifdef __x86_64__ #define STRUCT_SIZE_LIMIT 16 +#elif __arm64__ +#define STRUCT_SIZE_LIMIT 64 +#define objc_msgSendSuper_stret objc_msgSendSuper +#define objc_msgSend_stret objc_msgSend #endif #ifdef DEBUG_EXCEPTIONS |
