Skip to content

Commit

Permalink
Fix catch2 failing to build due to alignment
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexandreTunstall committed Apr 2, 2024
1 parent 4c4206d commit a156b11
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
10 changes: 10 additions & 0 deletions overlays/catch2-data-align.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
--- a/src/catch2/benchmark/catch_constructor.hpp
+++ b/src/catch2/benchmark/catch_constructor.hpp
@@ -67,7 +67,7 @@
# pragma GCC diagnostic pop
#endif

- alignas( T ) unsigned char data[sizeof( T )]{};
+ alignas( T, T* ) unsigned char data[sizeof( T )]{};
};
} // namespace Detail
6 changes: 6 additions & 0 deletions overlays/riscv-fixes.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,13 @@ self: super: let
doCheck = false;
});

appendPatches = newPatches: drv: drv.overrideAttrs ({ patches ? [], ... }: {
patches = patches ++ newPatches;
});

in {
catch2_3 = appendPatches [ ./catch2-data-align.patch ] super.catch2_3;

libbsd = dontCheck super.libbsd;
libuv = dontCheck super.libuv;
pixman = dontCheck super.pixman;
Expand Down

0 comments on commit a156b11

Please sign in to comment.