Skip to content

Commit

Permalink
Clang armel needs libatomic (#40)
Browse files Browse the repository at this point in the history
* Clang armel needs libatomic

* Typo

* makeflags
  • Loading branch information
andrjohns authored May 30, 2024
1 parent 5c136a0 commit 53ace69
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 7 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/R-CMD-check-asan.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ jobs:
container: "ghcr.io/r-hub/containers/valgrind:latest",
git-install: dnf check-update && dnf install -y git }

env:
MAKEFLAGS: -j4
steps:
- name: Install git
run: ${{ matrix.config.git-install }}
Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/R-CMD-check-cross.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,11 @@ jobs:
- uses: actions/checkout@v4
with:
submodules: true
- uses: docker/setup-qemu-action@v2
- uses: docker/setup-qemu-action@master
- uses: addnab/docker-run-action@v3
with:
image: andrjohns/quickjsr-cross-tests
options: -v ${{ github.workspace }}:/quickjsr --platform=${{ matrix.config.platform }}
options: -v ${{ github.workspace }}:/quickjsr --platform=${{ matrix.config.platform }} -e MAKEFLAGS=-j4
run: |
R CMD build /quickjsr
R CMD check --output=/quickjsr --as-cran --no-manual QuickJSR_*.tar.gz
1 change: 1 addition & 0 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ jobs:
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
R_KEEP_PKG_SOURCE: yes
MAKEFLAGS: -j4

steps:
- uses: actions/checkout@v4
Expand Down
8 changes: 4 additions & 4 deletions src/Makevars
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ ifneq (,$(CLANG_CHECK))
ifeq ($(shell expr $(CC_MAJOR) \< 4), 1)
PKG_CPPFLAGS += -DDISABLE_ATOMICS
endif
# Clang on armel can error with atomics, so check and disable if not supported
# Clang on armel needs libatomic
ifeq ($(shell uname -m), armv7l)
ATOMIC_SIZE_CHECK := $(shell echo | $(CC) -dM -E - | grep -i __CLANG_ATOMIC_BOOL_LOCK_FREE | cut -d' ' -f3)
ifneq ($(ATOMIC_SIZE_CHECK), 2)
PKG_CPPFLAGS += -DDISABLE_ATOMICS
CC_TARGET := $(shell $(CC) -v 2>&1 | grep Target | cut -d ' ' -f 2)
ifeq ($(findstring gnueabihf,$(CC_TARGET)),)
PKG_LIBS += -latomic
endif
endif
else
Expand Down

0 comments on commit 53ace69

Please sign in to comment.