diff --git a/repos/libports/src/lib/lwip/platform/sys_arch.cc b/repos/libports/src/lib/lwip/platform/sys_arch.cc index 61e4c298c..c3b7087f3 100644 --- a/repos/libports/src/lib/lwip/platform/sys_arch.cc +++ b/repos/libports/src/lib/lwip/platform/sys_arch.cc @@ -48,7 +48,7 @@ namespace Lwip { Sys_timer(Genode::Timeout_scheduler &timer) : timer(timer) { } }; - static Genode::Constructible _sys_timer; + static Sys_timer *sys_timer_ptr; void genode_init(Genode::Allocator &heap, Genode::Timeout_scheduler &timer) { @@ -56,7 +56,10 @@ namespace Lwip { !heap.need_size_for_free()); _heap = &heap; - _sys_timer.construct(timer); + + static Sys_timer sys_timer(timer); + sys_timer_ptr = &sys_timer; + lwip_init(); } } @@ -93,7 +96,7 @@ extern "C" { } u32_t sys_now(void) { - return Lwip::_sys_timer->timer.curr_time().trunc_to_plain_ms().value; } + return Lwip::sys_timer_ptr->timer.curr_time().trunc_to_plain_ms().value; } void genode_memcpy(void *dst, const void *src, size_t len) { Genode::memcpy(dst, src, len); }