diff --git a/repos/base-hw/src/bootstrap/init.cc b/repos/base-hw/src/bootstrap/init.cc index d8d266fd4f..e29fe4b91b 100644 --- a/repos/base-hw/src/bootstrap/init.cc +++ b/repos/base-hw/src/bootstrap/init.cc @@ -28,8 +28,16 @@ __attribute__((aligned(get_page_size()))); Bootstrap::Platform & Bootstrap::platform() { - static Bootstrap::Platform platform { }; - return platform; + /* + * Don't use static local variable because cmpxchg cannot be executed + * w/o MMU on ARMv6. + */ + static long _obj[(sizeof(Bootstrap::Platform)+sizeof(long))/sizeof(long)]; + static Bootstrap::Platform *ptr; + if (!ptr) + ptr = construct_at(_obj); + + return *ptr; }