Skip to content

Commit a3d77a4

Browse files
authored
Merge pull request #14664 from NixOS/fix-i686-asan
libstore: Align LocalFSStore to 8 bytes even on i686-linux
2 parents ad07be0 + 7c76a81 commit a3d77a4

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

src/libstore/include/nix/store/binary-cache-store.hh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,9 @@ struct BinaryCacheStoreConfig : virtual StoreConfig
6565
* @note subclasses must implement at least one of the two
6666
* virtual getFile() methods.
6767
*/
68-
struct BinaryCacheStore : virtual Store, virtual LogStore
68+
struct alignas(8) /* Work around ASAN failures on i686-linux. */
69+
BinaryCacheStore : virtual Store,
70+
virtual LogStore
6971
{
7072
using Config = BinaryCacheStoreConfig;
7173

src/libstore/include/nix/store/local-fs-store.hh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,10 @@ public:
6666
this, rootDir.get() ? *rootDir.get() + "/nix/store" : storeDir, "real", "Physical path of the Nix store."};
6767
};
6868

69-
struct LocalFSStore : virtual Store, virtual GcStore, virtual LogStore
69+
struct alignas(8) /* Work around ASAN failures on i686-linux. */
70+
LocalFSStore : virtual Store,
71+
virtual GcStore,
72+
virtual LogStore
7073
{
7174
using Config = LocalFSStoreConfig;
7275

src/libstore/ssh-store.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@ StoreReference SSHStoreConfig::getReference() const
3737
};
3838
}
3939

40-
struct SSHStore : virtual RemoteStore
40+
struct alignas(8) /* Work around ASAN failures on i686-linux. */
41+
SSHStore : virtual RemoteStore
4142
{
4243
using Config = SSHStoreConfig;
4344

0 commit comments

Comments
 (0)