diff --git a/core/rawdb/databases_64bit.go b/core/rawdb/databases_64bit.go
index 139ce7d347..73bfeb2083 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 b8ab2ecada..1f10c2f52b 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 1f331fa339..4e374c9e28 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 c773967dc6..590d5bf035 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