Skip to content

Commit 134a6d2

Browse files
committed
test
Signed-off-by: Hanno Becker <beckphan@amazon.co.uk>
1 parent cca943c commit 134a6d2

File tree

3 files changed

+43
-6
lines changed

3 files changed

+43
-6
lines changed

.github/workflows/ci.yml

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -677,6 +677,34 @@ jobs:
677677
# verbose: true
678678
# cflags: "-O0"
679679
# secrets: inherit
680+
check_hol_light_bytecode:
681+
strategy:
682+
fail-fast: false
683+
matrix:
684+
target:
685+
- system: macos-latest
686+
nix_shell: hol_light
687+
nix_cache: false
688+
- system: macos-intel
689+
nix_shell: hol_light
690+
nix_cache: false
691+
- system: ubuntu-latest
692+
nix_shell: hol_light-cross-aarch64
693+
nix_cache: true
694+
- system: pqcp-arm64
695+
nix_shell: hol_light
696+
nix_cache: false
697+
runs-on: ${{ matrix.target.system }}
698+
name: Check HOL-Light bytecode ${{ matrix.target.system }}
699+
steps:
700+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
701+
- uses: ./.github/actions/setup-shell
702+
with:
703+
nix-shell: ${{ matrix.target.nix_shell }}
704+
nix-cache: ${{ matrix.target.nix_cache }}
705+
gh_token: ${{ secrets.GITHUB_TOKEN }}
706+
script: |
707+
python3 ./scripts/autogen --dry-run --update-hol-light-bytecode
680708
check_autogenerated_files:
681709
strategy:
682710
fail-fast: false
@@ -688,8 +716,8 @@ jobs:
688716
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
689717
- uses: ./.github/actions/setup-shell
690718
with:
691-
nix-shell: 'hol_light-cross' # Need cross-compiler for ASM simplification
719+
nix-shell: 'ci-cross' # Need cross-compiler for ASM simplification
692720
nix-cache: 'true'
693721
gh_token: ${{ secrets.GITHUB_TOKEN }}
694722
script: |
695-
python3 ./scripts/autogen --dry-run --force-cross --update-hol-light-bytecode
723+
python3 ./scripts/autogen --dry-run --force-cross

flake.nix

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,12 @@
120120
devShells.hol_light-cross = util.mkShell {
121121
packages = builtins.attrValues { inherit (config.packages) linters toolchains hol_light s2n_bignum; };
122122
};
123+
devShells.hol_light-cross-aarch64 = util.mkShell {
124+
packages = builtins.attrValues { inherit (config.packages) linters toolchain_aarch64 hol_light s2n_bignum; };
125+
};
126+
devShells.hol_light-cross-x86_64 = util.mkShell {
127+
packages = builtins.attrValues { inherit (config.packages) linters toolchain_x86_64 hol_light s2n_bignum; };
128+
};
123129
devShells.ci-cross = util.mkShell {
124130
packages = builtins.attrValues { inherit (config.packages) linters toolchains; };
125131
};

proofs/hol_light/arm/Makefile

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,17 +26,20 @@ ARCHFLAGS=-march=armv8.4-a+sha3
2626
# and the proofs checked against the object files (though you won't be able
2727
# to run code without additional emulation infrastructure).
2828

29+
ifeq ($(ARCHTYPE_RESULT)-$(OSTYPE_RESULT),x86_64-Darwin)
30+
ASSEMBLE=as -arch arm64
31+
OBJDUMP=otool -tvV
32+
else
2933
ifeq ($(filter $(ARCHTYPE_RESULT),aarch64 arm64),)
3034
CROSS_PREFIX=aarch64-unknown-linux-gnu-
3135
# Check if cross-toolchain exists
3236
ifeq ($(shell command -v $(ASSEMBLE) >/dev/null 2>&1 && echo yes || echo no),no)
3337
$(error Cross-toolchain not found. Please run in the 'hol_light' nix shell via: nix develop .#hol_light)
3438
endif
3539
endif
36-
3740
ASSEMBLE=$(CROSS_PREFIX)as $(ARCHFLAGS)
3841
OBJDUMP=$(CROSS_PREFIX)objdump -d
39-
COMPILE=$(CROSS_PREFIX)$(CC)
42+
endif
4043

4144
# Add explicit language input parameter to cpp, otherwise the use of #n for
4245
# numeric literals in ARM code is a problem when used inside #define macros
@@ -46,9 +49,9 @@ COMPILE=$(CROSS_PREFIX)$(CC)
4649
# by single-quote characters in comments, so we eliminate // comments first.
4750

4851
ifeq ($(OSTYPE_RESULT),Darwin)
49-
PREPROCESS=sed -e 's/\/\/.*//' | $(COMPILE) -E -xassembler-with-cpp -
52+
PREPROCESS=sed -e 's/\/\/.*//' | $(CC) -E -xassembler-with-cpp -
5053
else
51-
PREPROCESS=$(COMPILE) $(ARCHFLAGS) -E -xassembler-with-cpp -
54+
PREPROCESS=$(CC) -E -xassembler-with-cpp -
5255
endif
5356

5457
# Generally GNU-type assemblers are happy with multiple instructions on

0 commit comments

Comments
 (0)