Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
boinc
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
einsteinathome
boinc
Commits
174c9d1b
Commit
174c9d1b
authored
4 years ago
by
Charlie Fenton
Browse files
Options
Downloads
Patches
Plain Diff
Mac: Update OpenSSL build script to build arm64 and x86_64 Universal binary
parent
5222682f
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
mac_build/buildopenssl.sh
+41
-13
41 additions, 13 deletions
mac_build/buildopenssl.sh
with
41 additions
and
13 deletions
mac_build/buildopenssl.sh
+
41
−
13
View file @
174c9d1b
...
...
@@ -34,7 +34,7 @@
# Updated 9/10/16 for openssl-1.1.0
# Updated 1/25/18 for bulding openssl 1.1.0g (updated comemnts only)
# Updated 1/23/19 use libc++ instead of libstdc++ for Xcode 10 compatibility
# Updated
8
/2
2
/20 T
O
build Apple Silicon / arm64 and x86_64 Universal binary
# Updated
10
/2
0
/20 T
o
build Apple Silicon / arm64 and x86_64 Universal binary
#
## This script requires OS 10.8 or later
#
...
...
@@ -116,6 +116,42 @@ if [ "${doclean}" != "yes" ]; then
fi
fi
## openssl 1.1.0g does not have a configure option for darwin arm64,
## so we patch Configurations/10-main.conf to add it.
## Derived from https://github.com/openssl/openssl/pull/12369/files
## and https://cutecoder.org/programming/compile-open-ssl-apple-silicon/
##
## Note: setting perlasm_scheme to "ios64" tells configure to use
## the correct assembler instructions for Apple Silicon. Setting
## it to "macosx" causes it to use x86_64 assembler instructions.
##
if
[
!
-f
Configurations/10-main.conf.orig
]
;
then
cat
>>
/tmp/0-main_conf_diff
<<
ENDOFFILE
--- 10-main.conf 2017-11-02 07:29:01.000000000 -0700
+++ 10-main_patched.con2020-10-19 01:34:06.000000000 -0700
@@ -1614,6 +1614,14 @@
perlasm_scheme => "macosx",
shared_ldflag => "-arch x86_64 -dynamiclib",
},
+ "darwin64-arm64-cc" => {
+ inherit_from => [ "darwin-common", asm("aarch64_asm") ],
+ CFLAGS => add("-Wall"),
+ cflags => add("-arch arm64"),
+ lib_cppflags => add("-DL_ENDIAN"),
+ bn_ops => "SIXTY_FOUR_BIT_LONG",
+ perlasm_scheme => "ios64",
+ },
#### iPhoneOS/iOS
#
ENDOFFILE
patch
-bfi
/tmp/0-main_conf_diff Configurations/10-main.conf
rm
-f
/tmp/0-main_conf_diff
else
echo
"Configurations/10-main.conf already patched"
fi
echo
""
GPPPATH
=
`
xcrun
-find
g++
`
if
[
$?
-ne
0
]
;
then
echo
"ERROR: can't find g++ compiler"
...
...
@@ -185,20 +221,13 @@ if [ $GCC_can_build_arm64 == "yes" ]; then
export
SDKROOT
=
"
${
SDKPATH
}
"
export
MACOSX_DEPLOYMENT_TARGET
=
10.7
## TEMPORARY WORKAROUNDS because OpenSSL 1.1.0g has no configure option for
## darwin arm64
if
[
"x
${
lprefix
}
"
!=
"x"
]
;
then
./configure
--prefix
=
${
lprefix
}
no-shared
ios64-cross
./configure
--prefix
=
${
lprefix
}
no-shared
darwin64-arm64-cc
if
[
$?
-ne
0
]
;
then return
1
;
fi
else
./configure no-shared
ios64-cross
./configure no-shared
darwin64-arm64-cc
if
[
$?
-ne
0
]
;
then return
1
;
fi
fi
## Patch the ios64-cross makefile to build for a Mac instead of iOS device
sed
-i
""
's:-arch arm64:-target arm64-apple-macos10.7 -stdlib=libc++:g'
Makefile
sed
-i
""
's:-mios-version-min=7.0.0:-DMAC_OS_X_VERSION_MAX_ALLOWED=1070:g'
Makefile
sed
-i
""
's:-isysroot $(CROSS_TOP)/SDKs/$(CROSS_SDK):-isysroot ${SDKROOT}:g'
Makefile
## END OF TEMPORARY WORKAROUNDS
# save x86_64 lib for later use
mv
-f
libcrypto.a libcrypto_x86_64.a
...
...
@@ -232,9 +261,8 @@ if [ $GCC_can_build_arm64 == "yes" ]; then
rm
-f
libcrypto_x86_64.a libcrypto_arm64.a
rm
-f
libssl_x86_64.a libssl_arm64.a
## openssl 1.1.0g does not have a configure option for darwin arm64, so we use
## the same configure as for ios64-cross with some patches and hope it works
## properly.
## openssl 1.1.0g does not have a configure option for darwin arm64, so we
## patched Configurations/10-main.conf to add it.
## NOTE: At the time of writing, I do not have an arm64 Mac to test with.
# Revisit this if a newer version of openssl becomes available.
#
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment