Skip to content

Commit 735cd14

Browse files
committed
OPTIMIZE: add v3.5.2 libffi submodule and build scripts to autogen libffi.xcframework
1 parent 7790660 commit 735cd14

File tree

18 files changed

+671
-236
lines changed

18 files changed

+671
-236
lines changed

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
[submodule "oc2mango"]
22
path = oc2mango
33
url = https://github.com/SilverFruity/oc2mango.git
4+
[submodule "libffi"]
5+
path = libffi
6+
url = https://github.com/libffi/libffi.git

OCRunner.podspec

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ Execute Objective-C code Dynamically. iOS hotfix SDK.
77
DESC
88
s.homepage = "https://github.com/SilverFruity/OCRunner"
99
s.license = "MIT"
10-
s.author = { "SilverFruity" => "15328044115@163.com" }
11-
s.ios.deployment_target = "9.0"
10+
s.author = { "SilverFruity" => "389185764@qq.com" }
11+
s.ios.deployment_target = "11.0"
1212
s.source = { :git => "https://github.com/SilverFruity/OCRunner.git", :tag => "#{s.version}" }
1313
s.source_files = "OCRunner/*.{h,m,c,mm}", "OCRunner/ORCoreImp/**/*.{h,m,c,mm}", "OCRunner/RunEnv/**/*.{h,m,c,mm}", "OCRunner/Util/**/*.{h,m,c,mm}", "OCRunner/libffi/**/*.{h,m,c,mm}"
1414
s.ios.vendored_frameworks = 'OCRunner/libffi/libffi.xcframework'

OCRunner/libffi/ffi.h

Lines changed: 0 additions & 12 deletions
This file was deleted.

OCRunner/libffi/ffitarget.h

Lines changed: 0 additions & 12 deletions
This file was deleted.

OCRunner/libffi/ffitarget_x86_64.h

Lines changed: 0 additions & 169 deletions
This file was deleted.

OCRunner/libffi/ffi_arm64.h renamed to OCRunner/libffi/libffi.xcframework/ios-arm64/Headers/ffi.h

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
1-
#ifdef __arm64__
2-
31
/* -----------------------------------------------------------------*-C-*-
4-
libffi 3.4.6
2+
libffi 3.5.2
53
- Copyright (c) 2011, 2014, 2019, 2021, 2022, 2024, 2025 Anthony Green
64
- Copyright (c) 1996-2003, 2007, 2008 Red Hat, Inc.
75
@@ -83,7 +81,7 @@ extern "C" {
8381
/* This should always refer to the last type code (for sanity checks). */
8482
#define FFI_TYPE_LAST FFI_TYPE_COMPLEX
8583

86-
#include "ffitarget.h"
84+
#include <ffitarget.h>
8785

8886
#ifndef LIBFFI_ASM
8987

@@ -318,8 +316,8 @@ size_t ffi_java_raw_size (ffi_cif *cif) __attribute__((deprecated));
318316

319317
/* ---- Version API ------------------------------------------------------ */
320318

321-
#define FFI_VERSION_STRING "3.5.1"
322-
#define FFI_VERSION_NUMBER 30501
319+
#define FFI_VERSION_STRING "3.5.2"
320+
#define FFI_VERSION_NUMBER 30502
323321

324322
#ifndef LIBFFI_ASM
325323
/* Return a version string. */
@@ -536,6 +534,3 @@ ffi_status ffi_get_struct_offsets (ffi_abi abi, ffi_type *struct_type,
536534
#endif
537535

538536
#endif
539-
540-
541-
#endif

OCRunner/libffi/ffitarget_arm64.h renamed to OCRunner/libffi/libffi.xcframework/ios-arm64/Headers/ffitarget.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#ifdef __arm64__
2-
31
/* Copyright (c) 2009, 2010, 2011, 2012 ARM Ltd.
42
53
Permission is hereby granted, free of charge, to any person obtaining
@@ -97,6 +95,3 @@ typedef enum ffi_abi
9795
#endif
9896

9997
#endif
100-
101-
102-
#endif
-44.4 KB
Binary file not shown.

OCRunner/libffi/ffi_x86_64.h renamed to OCRunner/libffi/libffi.xcframework/ios-arm64_x86_64-simulator/Headers/ffi.h

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
1-
#ifdef __x86_64__
2-
31
/* -----------------------------------------------------------------*-C-*-
4-
libffi 3.4.6
2+
libffi 3.5.2
53
- Copyright (c) 2011, 2014, 2019, 2021, 2022, 2024, 2025 Anthony Green
64
- Copyright (c) 1996-2003, 2007, 2008 Red Hat, Inc.
75
@@ -52,8 +50,8 @@ extern "C" {
5250
#endif
5351

5452
/* Specify which architecture libffi is configured for. */
55-
#ifndef X86_64
56-
#define X86_64
53+
#ifndef AARCH64
54+
#define AARCH64
5755
#endif
5856

5957
/* ---- System configuration information --------------------------------- */
@@ -63,7 +61,7 @@ extern "C" {
6361
#define FFI_TYPE_INT 1
6462
#define FFI_TYPE_FLOAT 2
6563
#define FFI_TYPE_DOUBLE 3
66-
#if 1
64+
#if 0
6765
#define FFI_TYPE_LONGDOUBLE 4
6866
#else
6967
#define FFI_TYPE_LONGDOUBLE FFI_TYPE_DOUBLE
@@ -83,7 +81,7 @@ extern "C" {
8381
/* This should always refer to the last type code (for sanity checks). */
8482
#define FFI_TYPE_LAST FFI_TYPE_COMPLEX
8583

86-
#include "ffitarget.h"
84+
#include <ffitarget.h>
8785

8886
#ifndef LIBFFI_ASM
8987

@@ -318,8 +316,8 @@ size_t ffi_java_raw_size (ffi_cif *cif) __attribute__((deprecated));
318316

319317
/* ---- Version API ------------------------------------------------------ */
320318

321-
#define FFI_VERSION_STRING "3.5.1"
322-
#define FFI_VERSION_NUMBER 30501
319+
#define FFI_VERSION_STRING "3.5.2"
320+
#define FFI_VERSION_NUMBER 30502
323321

324322
#ifndef LIBFFI_ASM
325323
/* Return a version string. */
@@ -342,7 +340,7 @@ FFI_API size_t ffi_get_closure_size (void);
342340
__declspec(align(8))
343341
#endif
344342
typedef struct {
345-
#if 0
343+
#if 1
346344
void *trampoline_table;
347345
void *trampoline_table_entry;
348346
#else
@@ -395,7 +393,7 @@ ffi_prep_closure_loc (ffi_closure*,
395393
# pragma pack 8
396394
#endif
397395
typedef struct {
398-
#if 0
396+
#if 1
399397
void *trampoline_table;
400398
void *trampoline_table_entry;
401399
#else
@@ -420,7 +418,7 @@ typedef struct {
420418
} ffi_raw_closure;
421419

422420
typedef struct {
423-
#if 0
421+
#if 1
424422
void *trampoline_table;
425423
void *trampoline_table_entry;
426424
#else
@@ -536,6 +534,3 @@ ffi_status ffi_get_struct_offsets (ffi_abi abi, ffi_type *struct_type,
536534
#endif
537535

538536
#endif
539-
540-
541-
#endif

0 commit comments

Comments
 (0)