Skip to content

recipes-core: Add musl OpenHarmony compatibility patches

Add OpenHarmony compatibility patches to musl. This is a port of the OpenHarmony 3.1 patches as found in commit d06ff8b5d165b862298a756799dbc641cb68b1c5 to current musl.

The patches should be harmless. Their effects:

  • Add OpenHarmony's malloc hook mechanism
  • Add stubs for mallinfo() and mallinfo2() [currently not implemented by musl]
  • Mark memory allocated by musl malloc with PR_SET_VMA_ANON_NAME
  • Add a gettid/pthread_gettid_np implementation
  • Increase SHMLBA size
  • Add namespaced dlopen APIs
  • Implement sched_getparam(), sched_getscheduler() and sched_setscheduler() [Linux only]
  • small tweaks and optimizations

The patches don't look like they will cause trouble.

If there is anything that uses mallinfo() or mallinfo2() with autoconf/cmake/meson checks (didn't find anything at a quick look), we might want to disable those stubs - not having those calls is preferable over having them return bogus values).

Signed-off-by: Bernhard Rosenkränzer

Merge request reports