Skip to content

Commit 098085f

Browse files
committed
Use an older version of binutils on Mac, required to produce valid libraries.
1 parent acaad3b commit 098085f

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

.github/workflows/cpp-packaging.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,9 @@ on:
2222
env:
2323
# Packaging prerequisites
2424
# Binutils 2.35.1 released Sep 19, 2020
25-
binutilsVer: "2.35.1"
25+
binutilsVerLinux: "2.35.1"
26+
# On Mac, use an older Binutils to avoid corrupted libraries.
27+
binutilsVerDarwin: "2.28.1"
2628
# Demumble 1.1.0 released Nov 13, 2018
2729
demumbleVer: "1.1.0"
2830
# Use SHA256 for hashing files.
@@ -67,8 +69,10 @@ jobs:
6769
include:
6870
- os: ubuntu-latest
6971
tools_platform: linux
72+
binutils_version: ${{ env.binutilsVerLinux }}
7073
- os: macos-latest
7174
tools_platform: darwin
75+
binutils_version: ${{ env.binutilsVerDarwin }}
7276
steps:
7377
- name: setup Xcode version (macos)
7478
if: runner.os == 'macOS'
@@ -81,13 +85,13 @@ jobs:
8185
# Github runners.
8286
for retry in {1..10} error; do
8387
if [[ $retry == "error" ]]; then exit 5; fi
84-
curl -L https://ftpmirror.gnu.org/binutils/binutils-${{ env.binutilsVer }}.tar.xz --output binutils.tar.xz && break
88+
curl -L https://ftpmirror.gnu.org/binutils/binutils-${{ matrix.binutils_version }}.tar.xz --output binutils.tar.xz && break
8589
sleep 300
8690
done
8791
set -e
8892
8993
tar -xf binutils.tar.xz
90-
mv ./binutils-${{ env.binutilsVer }} ./binutils-src
94+
mv ./binutils-${{ matrix.binutils_version }} ./binutils-src
9195
cd binutils-src
9296
./configure --enable-targets=all --prefix=/tmp/binutils
9397
make

CMakeLists.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,11 @@ if(DESKTOP)
250250

251251
add_external_library(uWebSockets)
252252

253-
set(websockets_additional_defines "")
253+
# Binutils on Mac doesn't support thread-local storage (required by
254+
# websockets), but because we only use websockets via the scheduler,
255+
# we don't need it.
256+
257+
set(websockets_additional_defines "-D__thread=")
254258

255259
# uWebSockets does not come with a CMakeLists file, so define the target.
256260
# Note that since it depends on OpenSSL, only do so if that was found.

0 commit comments

Comments
 (0)