Good day,
I was finally able to set up my musl cross-compiler and spent the
evening working on compiling 9base with it.
It has come to my attention, that there seems to be unreachable code
within lib9 at four places silently scourging our efforts to port
9base to musl.
Those places are:
(1) lib9/dirread.c:24
# elif defined(__MUSL__)
(2) lib9/_p9dir.c:64
#elif defined(__linux__) && !defined(__MUSL__)
(3) lib9/readcons.c:5
#ifndef __MUSL__
This came to my attention, because compilation failed due to an
undefined reference to "getdirentries", which is referred to in the
#else-statement following (1) in line 39.
According to the musl-FAQ[1], a __MUSL__-macro doesn't even exist in
the first place. Thus, the macro checks introduced with the last commit
[2] to 9base are predetermined:
(1) always skips to #else, throws an error
(2) and (3) are always true, as __MUSL__ isn't defined
We should remove the unnecessary checks and think about a way to guide
the compiler in the right direction without depending on this
non-existent macro.
The hard thing here probably is finding a way to do that without
breaking other implementations.
Before submitting a trivial patch for the first task, I would like to
hear your ideas on solving this problem, so we can work on one
patch to rule it all.
Cheers
FRIGN
[1]: <
http://wiki.musl-libc.org/wiki/FAQ>, second question
[2]: <
http://git.suckless.org/9base/commit/?id=45d1314a1bd1886c42c1bdaac4a0128f23f50e32>
--
FRIGN <dev_AT_frign.de>
Received on Wed Dec 25 2013 - 17:48:13 CET