diff --git a/projects/rocr-runtime/runtime/hsa-runtime/core/util/memory.h b/projects/rocr-runtime/runtime/hsa-runtime/core/util/memory.h
index 4c04b59c50..1f98c67904 100644
--- a/projects/rocr-runtime/runtime/hsa-runtime/core/util/memory.h
+++ b/projects/rocr-runtime/runtime/hsa-runtime/core/util/memory.h
@@ -53,7 +53,7 @@
 #include "os.h"
 namespace rocr {
 
-#if defined(__linux__)
+#if defined(__linux__) || defined(__FreeBSD__)
 /// @brief Converts @ref hsa_access_permission_t to mmap memory protection
 ///        flags.
 __forceinline int PermissionsToMmapFlags(hsa_access_permission_t perms) {
