diff --git a/core/rawdb/databases_64bit.go b/core/rawdb/databases_64bit.go
index 139ce7d34..73bfeb208 100644
--- a/core/rawdb/databases_64bit.go
+++ b/core/rawdb/databases_64bit.go
@@ -14,7 +14,7 @@
// You should have received a copy of the GNU Lesser General Public License
// along with the go-ethereum library. If not, see
-//go:build arm64 || amd64
+//go:build (arm64 || amd64) && !openbsd
package rawdb
diff --git a/core/rawdb/databases_non64bit.go b/core/rawdb/databases_non64bit.go
index b8ab2ecad..1f10c2f52 100644
--- a/core/rawdb/databases_non64bit.go
+++ b/core/rawdb/databases_non64bit.go
@@ -14,7 +14,7 @@
// You should have received a copy of the GNU Lesser General Public License
// along with the go-ethereum library. If not, see .
-//go:build !(arm64 || amd64)
+//go:build !((arm64 || amd64) && !openbsd)
package rawdb
diff --git a/ethdb/pebble/pebble.go b/ethdb/pebble/pebble.go
index 1f331fa33..4e374c9e2 100644
--- a/ethdb/pebble/pebble.go
+++ b/ethdb/pebble/pebble.go
@@ -14,7 +14,7 @@
// You should have received a copy of the GNU Lesser General Public License
// along with the go-ethereum library. If not, see .
-//go:build arm64 || amd64
+//go:build (arm64 || amd64) && !openbsd
// Package pebble implements the key-value database layer based on pebble.
package pebble
diff --git a/ethdb/pebble/pebble_test.go b/ethdb/pebble/pebble_test.go
index c773967dc..590d5bf03 100644
--- a/ethdb/pebble/pebble_test.go
+++ b/ethdb/pebble/pebble_test.go
@@ -14,7 +14,7 @@
// You should have received a copy of the GNU Lesser General Public License
// along with the go-ethereum library. If not, see .
-//go:build arm64 || amd64
+//go:build (arm64 || amd64) && !openbsd
package pebble