diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 125f31c06..127ebd7fc 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -20,7 +20,7 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu-latest, macos-13, windows-latest] + os: [ubuntu-latest, macos-latest, windows-latest] build_type: [RelWithDebInfo, Debug] release: [stable, HEAD] @@ -43,13 +43,8 @@ jobs: if: runner.os == 'macOS' run: | echo "MACOSX_DEPLOYMENT_TARGET=10.15" >> ${GITHUB_ENV} - # Install Python separately to workround recurring homebrew CI issue. - # See https://github.com/actions/runner-images/issues/9471 for more details. - brew install python@3 || true - brew link --overwrite python@3 - brew install \ + brew install --formula \ ccache \ - cmake \ doxygen \ graphviz diff --git a/src/patches/HEAD/0001-Fix-UBSAN-errors-in-decompiler.patch b/src/patches/HEAD/0001-Fix-UBSAN-errors-in-decompiler.patch index 22f82088c..3fa66117d 100644 --- a/src/patches/HEAD/0001-Fix-UBSAN-errors-in-decompiler.patch +++ b/src/patches/HEAD/0001-Fix-UBSAN-errors-in-decompiler.patch @@ -1,7 +1,7 @@ From 76289be82722d1a076bb9718507ce57748b40543 Mon Sep 17 00:00:00 2001 From: Eric Kilmer Date: Mon, 12 Aug 2024 12:02:35 -0400 -Subject: [PATCH 1/5] Fix UBSAN errors in decompiler +Subject: [PATCH 1/6] Fix UBSAN errors in decompiler Co-authored-by: Alex Cameron --- diff --git a/src/patches/HEAD/0002-Use-stroull-instead-of-stroul-to-parse-address-offse.patch b/src/patches/HEAD/0002-Use-stroull-instead-of-stroul-to-parse-address-offse.patch index 26e97ed16..77ff2df15 100644 --- a/src/patches/HEAD/0002-Use-stroull-instead-of-stroul-to-parse-address-offse.patch +++ b/src/patches/HEAD/0002-Use-stroull-instead-of-stroul-to-parse-address-offse.patch @@ -1,7 +1,7 @@ From 2e4706231191395dac90b764ce29c55de29ca2ce Mon Sep 17 00:00:00 2001 From: Alex Cameron Date: Wed, 3 Aug 2022 20:01:18 +1000 -Subject: [PATCH 2/5] Use `stroull` instead of `stroul` to parse address +Subject: [PATCH 2/6] Use `stroull` instead of `stroul` to parse address offsets --- diff --git a/src/patches/HEAD/0003-Add-missing-index-check-to-prevent-errors-in-Windows.patch b/src/patches/HEAD/0003-Add-missing-index-check-to-prevent-errors-in-Windows.patch index 429709e30..451d31373 100644 --- a/src/patches/HEAD/0003-Add-missing-index-check-to-prevent-errors-in-Windows.patch +++ b/src/patches/HEAD/0003-Add-missing-index-check-to-prevent-errors-in-Windows.patch @@ -1,7 +1,7 @@ From 26a110b55617237c910447b576752fa0acb6a146 Mon Sep 17 00:00:00 2001 From: Eric Kilmer Date: Sat, 30 Mar 2024 18:46:16 -0400 -Subject: [PATCH 3/5] Add missing index check to prevent errors in Windows +Subject: [PATCH 3/6] Add missing index check to prevent errors in Windows Not sure why this only appears when testing on Windows. --- diff --git a/src/patches/HEAD/0004-Use-string-resize-instead-of-reserve.patch b/src/patches/HEAD/0004-Use-string-resize-instead-of-reserve.patch index 16eccecdb..847de0081 100644 --- a/src/patches/HEAD/0004-Use-string-resize-instead-of-reserve.patch +++ b/src/patches/HEAD/0004-Use-string-resize-instead-of-reserve.patch @@ -1,7 +1,7 @@ From d7f7be313580a6e0eef101848a3c86e3a3db4029 Mon Sep 17 00:00:00 2001 From: Eric Kilmer Date: Tue, 29 Oct 2024 15:30:57 -0400 -Subject: [PATCH 4/5] Use string resize instead of reserve +Subject: [PATCH 4/6] Use string resize instead of reserve assign will fix up the size to hold all of what's copied --- diff --git a/src/patches/HEAD/0005-Ignore-floating-point-test-due-to-compilation-differ.patch b/src/patches/HEAD/0005-Ignore-floating-point-test-due-to-compilation-differ.patch index 058e599b3..26f85fbd5 100644 --- a/src/patches/HEAD/0005-Ignore-floating-point-test-due-to-compilation-differ.patch +++ b/src/patches/HEAD/0005-Ignore-floating-point-test-due-to-compilation-differ.patch @@ -1,7 +1,7 @@ From a76b69021f34973973487362cb5f25f7644880b8 Mon Sep 17 00:00:00 2001 From: Eric Kilmer Date: Tue, 29 Oct 2024 17:51:09 -0400 -Subject: [PATCH 5/5] Ignore floating point test due to compilation differences +Subject: [PATCH 5/6] Ignore floating point test due to compilation differences This test fails on macOS and Windows. I'm unsure whether it's an OS or compiler issue. diff --git a/src/patches/HEAD/0006-Allow-positive-or-negative-NAN-in-decompiler-floatin.patch b/src/patches/HEAD/0006-Allow-positive-or-negative-NAN-in-decompiler-floatin.patch new file mode 100644 index 000000000..69ed14c37 --- /dev/null +++ b/src/patches/HEAD/0006-Allow-positive-or-negative-NAN-in-decompiler-floatin.patch @@ -0,0 +1,37 @@ +From ce0148e9dd6d4a9ba92ee44fb50be1f01b7a8858 Mon Sep 17 00:00:00 2001 +From: Eric Kilmer +Date: Wed, 30 Oct 2024 14:26:57 -0400 +Subject: [PATCH 6/6] Allow positive or negative NAN in decompiler floating + point test + +At least on Apple Silicon, this test reports positive NAN. + +Use the regex optional operator '?' to allow for positive or negative +NAN. +--- + .../Decompiler/src/decompile/datatests/floatprint.xml | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/Ghidra/Features/Decompiler/src/decompile/datatests/floatprint.xml b/Ghidra/Features/Decompiler/src/decompile/datatests/floatprint.xml +index f8108d3d32..1060a3e193 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/datatests/floatprint.xml ++++ b/Ghidra/Features/Decompiler/src/decompile/datatests/floatprint.xml +@@ -58,13 +58,13 @@ bbbdd7d9df7cdb3d000000000000f03f + floatv3 = -0.001; + floatv4 = 1e-06; + floatv5 = INFINITY; +-floatv6 = -NAN; ++floatv6 = -?NAN; + floatv7 = 3.141592e-06; + double1 = 0.6666666666666666; + double2 = 2.0; + double3 = -0.001; + double4 = 1e-10; + double5 = INFINITY; +-double6 = -NAN; ++double6 = -?NAN; + double7 = 3.1415926535897933e-06; + +-- +2.47.0 + diff --git a/src/patches/stable/0001-Fix-UBSAN-errors-in-decompiler.patch b/src/patches/stable/0001-Fix-UBSAN-errors-in-decompiler.patch index ebdda1e75..fddf7f4d8 100644 --- a/src/patches/stable/0001-Fix-UBSAN-errors-in-decompiler.patch +++ b/src/patches/stable/0001-Fix-UBSAN-errors-in-decompiler.patch @@ -1,7 +1,7 @@ -From c5a494bcd940fb46ffe90164c5ec0b61d897a892 Mon Sep 17 00:00:00 2001 +From d3de474854d052712217ad731fffcea6334808ff Mon Sep 17 00:00:00 2001 From: Eric Kilmer Date: Mon, 12 Aug 2024 12:02:35 -0400 -Subject: [PATCH 1/5] Fix UBSAN errors in decompiler +Subject: [PATCH 1/6] Fix UBSAN errors in decompiler Co-authored-by: Alex Cameron --- diff --git a/src/patches/stable/0002-Use-stroull-instead-of-stroul-to-parse-address-offse.patch b/src/patches/stable/0002-Use-stroull-instead-of-stroul-to-parse-address-offse.patch index 2be03222b..ab72f4536 100644 --- a/src/patches/stable/0002-Use-stroull-instead-of-stroul-to-parse-address-offse.patch +++ b/src/patches/stable/0002-Use-stroull-instead-of-stroul-to-parse-address-offse.patch @@ -1,7 +1,7 @@ -From 60b1bb423c10b2e53ad72e7b84ac647e56282aca Mon Sep 17 00:00:00 2001 +From 4bbcb71e2c2cf1362628917c26879bbcb4717665 Mon Sep 17 00:00:00 2001 From: Alex Cameron Date: Wed, 3 Aug 2022 20:01:18 +1000 -Subject: [PATCH 2/5] Use `stroull` instead of `stroul` to parse address +Subject: [PATCH 2/6] Use `stroull` instead of `stroul` to parse address offsets --- diff --git a/src/patches/stable/0003-Add-missing-index-check-to-prevent-errors-in-Windows.patch b/src/patches/stable/0003-Add-missing-index-check-to-prevent-errors-in-Windows.patch index a1226bbd0..0e1179b3e 100644 --- a/src/patches/stable/0003-Add-missing-index-check-to-prevent-errors-in-Windows.patch +++ b/src/patches/stable/0003-Add-missing-index-check-to-prevent-errors-in-Windows.patch @@ -1,7 +1,7 @@ -From e853cd1dc018c0f8a76f936de0391bbdf467a907 Mon Sep 17 00:00:00 2001 +From 31c3e037e8104e9060b73c62bb5895a8665efbcb Mon Sep 17 00:00:00 2001 From: Eric Kilmer Date: Sat, 30 Mar 2024 18:46:16 -0400 -Subject: [PATCH 3/5] Add missing index check to prevent errors in Windows +Subject: [PATCH 3/6] Add missing index check to prevent errors in Windows Not sure why this only appears when testing on Windows. --- diff --git a/src/patches/stable/0004-Use-string-resize-instead-of-reserve.patch b/src/patches/stable/0004-Use-string-resize-instead-of-reserve.patch index b85f2ed13..8a37b5a9a 100644 --- a/src/patches/stable/0004-Use-string-resize-instead-of-reserve.patch +++ b/src/patches/stable/0004-Use-string-resize-instead-of-reserve.patch @@ -1,7 +1,7 @@ -From ddd126b14277841a885e824047908fb360e26191 Mon Sep 17 00:00:00 2001 +From 7eb62bb534ac02b723baad0bb0a9cb7d33813972 Mon Sep 17 00:00:00 2001 From: Eric Kilmer Date: Tue, 29 Oct 2024 15:30:57 -0400 -Subject: [PATCH 4/5] Use string resize instead of reserve +Subject: [PATCH 4/6] Use string resize instead of reserve assign will fix up the size to hold all of what's copied --- diff --git a/src/patches/stable/0005-Ignore-floating-point-test-due-to-compilation-differ.patch b/src/patches/stable/0005-Ignore-floating-point-test-due-to-compilation-differ.patch index 3e12c0c28..390b920df 100644 --- a/src/patches/stable/0005-Ignore-floating-point-test-due-to-compilation-differ.patch +++ b/src/patches/stable/0005-Ignore-floating-point-test-due-to-compilation-differ.patch @@ -1,7 +1,7 @@ -From 163be34210f69068f89e20acf89a4fbd50a88b76 Mon Sep 17 00:00:00 2001 +From 9b118da968eac4a5ad910dc51d7d70150bab0408 Mon Sep 17 00:00:00 2001 From: Eric Kilmer Date: Tue, 29 Oct 2024 17:51:09 -0400 -Subject: [PATCH 5/5] Ignore floating point test due to compilation differences +Subject: [PATCH 5/6] Ignore floating point test due to compilation differences This test fails on macOS and Windows. I'm unsure whether it's an OS or compiler issue. diff --git a/src/patches/stable/0006-Allow-positive-or-negative-NAN-in-decompiler-floatin.patch b/src/patches/stable/0006-Allow-positive-or-negative-NAN-in-decompiler-floatin.patch new file mode 100644 index 000000000..e1eb8d166 --- /dev/null +++ b/src/patches/stable/0006-Allow-positive-or-negative-NAN-in-decompiler-floatin.patch @@ -0,0 +1,37 @@ +From f130a89a600a210e12e4505a4533d27ea7b7e4f7 Mon Sep 17 00:00:00 2001 +From: Eric Kilmer +Date: Wed, 30 Oct 2024 14:26:57 -0400 +Subject: [PATCH 6/6] Allow positive or negative NAN in decompiler floating + point test + +At least on Apple Silicon, this test reports positive NAN. + +Use the regex optional operator '?' to allow for positive or negative +NAN. +--- + .../Decompiler/src/decompile/datatests/floatprint.xml | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/Ghidra/Features/Decompiler/src/decompile/datatests/floatprint.xml b/Ghidra/Features/Decompiler/src/decompile/datatests/floatprint.xml +index f8108d3d32..1060a3e193 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/datatests/floatprint.xml ++++ b/Ghidra/Features/Decompiler/src/decompile/datatests/floatprint.xml +@@ -58,13 +58,13 @@ bbbdd7d9df7cdb3d000000000000f03f + floatv3 = -0.001; + floatv4 = 1e-06; + floatv5 = INFINITY; +-floatv6 = -NAN; ++floatv6 = -?NAN; + floatv7 = 3.141592e-06; + double1 = 0.6666666666666666; + double2 = 2.0; + double3 = -0.001; + double4 = 1e-10; + double5 = INFINITY; +-double6 = -NAN; ++double6 = -?NAN; + double7 = 3.1415926535897933e-06; + +-- +2.47.0 + diff --git a/src/setup-ghidra-source.cmake b/src/setup-ghidra-source.cmake index e0e70f9eb..3192967fa 100644 --- a/src/setup-ghidra-source.cmake +++ b/src/setup-ghidra-source.cmake @@ -43,6 +43,7 @@ set(ghidra_patches "${CMAKE_CURRENT_LIST_DIR}/patches/stable/0003-Add-missing-index-check-to-prevent-errors-in-Windows.patch" "${CMAKE_CURRENT_LIST_DIR}/patches/stable/0004-Use-string-resize-instead-of-reserve.patch" "${CMAKE_CURRENT_LIST_DIR}/patches/stable/0005-Ignore-floating-point-test-due-to-compilation-differ.patch" + "${CMAKE_CURRENT_LIST_DIR}/patches/stable/0006-Allow-positive-or-negative-NAN-in-decompiler-floatin.patch" ) # Ghidra pinned commits used for pinning last known working HEAD commit @@ -63,6 +64,7 @@ if("${sleigh_RELEASE_TYPE}" STREQUAL "HEAD") "${CMAKE_CURRENT_LIST_DIR}/patches/HEAD/0003-Add-missing-index-check-to-prevent-errors-in-Windows.patch" "${CMAKE_CURRENT_LIST_DIR}/patches/HEAD/0004-Use-string-resize-instead-of-reserve.patch" "${CMAKE_CURRENT_LIST_DIR}/patches/HEAD/0005-Ignore-floating-point-test-due-to-compilation-differ.patch" + "${CMAKE_CURRENT_LIST_DIR}/patches/HEAD/0006-Allow-positive-or-negative-NAN-in-decompiler-floatin.patch" ) string(SUBSTRING "${ghidra_git_tag}" 0 7 ghidra_short_commit) else()