Skip to content

Commit 7d0274d

Browse files
committed
more fix 2
1 parent 0be2137 commit 7d0274d

File tree

2 files changed

+26
-3
lines changed

2 files changed

+26
-3
lines changed

scripts/darwin/setup_vendors.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,13 +55,17 @@ if [ ! -f "build/ssl/libssl.a" ] && [ ! -f "build/libssl.a" ]; then
5555
ARCH=$(uname -m)
5656

5757
# macOS uses Clang
58-
# On ARM64, we need to explicitly set the architecture to avoid x86_64 assembly issues
58+
# On ARM64, we need to disable assembly optimizations since BoringSSL's pre-generated
59+
# x86_64 assembly files cause issues
5960
if [ "$ARCH" = "arm64" ]; then
61+
echo "Detected ARM64 architecture, disabling assembly optimizations..."
6062
cmake -DCMAKE_BUILD_TYPE=Release \
6163
-DCMAKE_POSITION_INDEPENDENT_CODE=ON \
6264
-DCMAKE_OSX_ARCHITECTURES=arm64 \
65+
-DOPENSSL_NO_ASM=1 \
6366
..
6467
else
68+
echo "Detected x86_64 architecture, using assembly optimizations..."
6569
cmake -DCMAKE_BUILD_TYPE=Release \
6670
-DCMAKE_POSITION_INDEPENDENT_CODE=ON \
6771
..

scripts/linux/setup_vendors.sh

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,15 @@ cd "$VENDOR_DIR"
2828
#
2929
echo "==> Setting up BoringSSL..."
3030

31+
# Always ensure clean BoringSSL clone to avoid platform detection issues
32+
if [ -d "boringssl" ]; then
33+
# Check if build exists, if not, remove and re-clone
34+
if [ ! -f "boringssl/build/libssl.a" ]; then
35+
echo "Removing incomplete BoringSSL clone..."
36+
rm -rf boringssl
37+
fi
38+
fi
39+
3140
if [ ! -d "boringssl" ]; then
3241
echo "Cloning BoringSSL..."
3342
git clone --depth 1 https://boringssl.googlesource.com/boringssl
@@ -49,17 +58,27 @@ if [ ! -f "build/libssl.a" ]; then
4958
echo "WARNING: go not found. BoringSSL will build without some tests."
5059
fi
5160

61+
# Clean build directory if it exists (in case of previous failed build)
62+
if [ -d "build" ]; then
63+
echo "Cleaning previous build..."
64+
rm -rf build
65+
fi
66+
5267
mkdir -p build
5368
cd build
5469

5570
# Linux typically uses GCC - disable false positive warning
5671
CMAKE_C_FLAGS="-Wno-maybe-uninitialized"
5772
CMAKE_CXX_FLAGS="-Wno-maybe-uninitialized"
5873

59-
# Explicitly set system name to Linux to prevent cross-platform confusion
74+
# Force CMake to regenerate all platform detection
75+
# Unset any environment variables that might confuse platform detection
76+
unset CMAKE_OSX_ARCHITECTURES
77+
unset CMAKE_OSX_DEPLOYMENT_TARGET
78+
unset CMAKE_OSX_SYSROOT
79+
6080
cmake -DCMAKE_BUILD_TYPE=Release \
6181
-DCMAKE_POSITION_INDEPENDENT_CODE=ON \
62-
-DCMAKE_SYSTEM_NAME=Linux \
6382
-DCMAKE_C_FLAGS="$CMAKE_C_FLAGS" \
6483
-DCMAKE_CXX_FLAGS="$CMAKE_CXX_FLAGS" \
6584
..

0 commit comments

Comments
 (0)