Fixes compilation under musl
This patch is adepted from the original published here https://patchwork.yoctoproject.org/project/oe/patch/1677927799-22851-5-git-send-email-wangmy@fujitsu.com/
This patch is adepted from the original published here https://patchwork.yoctoproject.org/project/oe/patch/1677927799-22851-5-git-send-email-wangmy@fujitsu.com/