public inbox for elfutils@sourceware.org
 help / color / mirror / Atom feed
From: "luizluca at gmail dot com" <sourceware-bugzilla@sourceware.org>
To: elfutils-devel@sourceware.org
Subject: [Bug general/21002] Incompatible with MUSL libc
Date: Sat, 10 Mar 2018 02:23:00 -0000	[thread overview]
Message-ID: <bug-21002-10460-pxcy9QDbSl@http.sourceware.org/bugzilla/> (raw)
In-Reply-To: <bug-21002-10460@http.sourceware.org/bugzilla/>

https://sourceware.org/bugzilla/show_bug.cgi?id=21002

--- Comment #7 from Luiz Angelo Daros de Luca <luizluca at gmail dot com> ---
I'm back with news.

I manage to compile all elfutils for OpenWrt, not just libs.

As expected, obstack and fts were missing. I managed to build using:
https://github.com/pullmoll/musl-obstack
https://github.com/pullmoll/musl-fts

I created patches for elfutils allowing it to look for a libfts.so or
libobstack.so. It builds but I feel I got too much/too little usage of both in
linking.

https://raw.githubusercontent.com/luizluca/openwrt/elfutils-full/package/libs/elfutils/patches/101-musl-fts.patch
https://github.com/luizluca/openwrt/blob/elfutils-full/package/libs/elfutils/patches/102-musl-obstack.patch

At least for obstack, I need to merge some Makefile.am changes that got into
another patch
(https://github.com/luizluca/openwrt/blob/elfutils-full/package/libs/elfutils/patches/103-musl_elftools_full).
I'll update soon.

As expected, the error_message_count used in some programs did break the build.
They are very few cases, most of them looks like could be replaced even with a
local variable. Maybe it would be better to simply get rid of it.

Some missing macros: ACCESSPERMS, ALLPERMS, DEFFILEMODE.

qsort_r() is not provided in MUSL

Some elfutils programs (arlib, elfcmp, elfcompress, findtextrel, unstrip, ) do
not include system.h. So, all ifdefs that solves some musl incompatibility
where not present. I simply added them.

fnmatch() does not support FNM_EXTMATCH in musl (just 3 uses).

src/unstrip.c:void warn (const char *msg) might be using a too generic name. It
collides with err.h warn. I simply renamed it.

Almost there!

-- 
You are receiving this mail because:
You are on the CC list for the bug.

  parent reply	other threads:[~2018-03-10  2:23 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <bug-21002-10460@http.sourceware.org/bugzilla/>
2016-12-29 23:38 ` mark at klomp dot org
2016-12-30 21:29 ` luizluca at gmail dot com
2016-12-30 23:56 ` luizluca at gmail dot com
2016-12-31 15:20 ` mjw at redhat dot com
2018-03-09 23:20 ` mark at klomp dot org
2018-03-10  2:23 ` luizluca at gmail dot com [this message]
2018-03-11 14:22 ` mark at klomp dot org
2021-02-05 14:49 ` mark at klomp dot org
2021-08-27 17:13 ` mark at klomp dot org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-21002-10460-pxcy9QDbSl@http.sourceware.org/bugzilla/ \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=elfutils-devel@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).