Created attachment 392490 [details] build.log exim fails to build under musl-libc because there are no checks to disable -lnsl and "HAVE_ICONV=yes" in the template Makefile Steps to reproduce: 1. Make a system with musl-libc 2. emerge mail-mta/exim Expected result: Exim should compile, with the flags patched out Actual results: Build fails (see attached build.log) Reproducible: Always
Created attachment 392492 [details, diff] fix_musl_build.patch
Regarding the -lnsl, that's something necessary for Solaris, so I think some logic/detection is wrong, which I'd love to fix instead of slamming it.
Anything that prevents -lnsl being passed when building for sys-libs/musl would be great. I just hacked that patch up without consideration for other platforms, though.
-lnsl is necessary for NIS (but possibly unnecessary when built without NIS support). I would expect the build to fail horribly on elibc_musl with USE=nis because of missing RPC headers,... in musl libc.
NIS isn't supported anyway, so that point is moot. http://wiki.musl-libc.org/wiki/Open_Issues#NIS.2FLDAP.2Fother_user_databases
The point is that very likely exim can be fixed (without breaking anything else) by making it only link with libnsl if NIS (or NIS+) is enabled.
(In reply to Fabian Groffen from comment #2) > Regarding the -lnsl, that's something necessary for Solaris, so I think some > logic/detection is wrong, which I'd love to fix instead of slamming it. I agree this needs better logic before it goes to the main tree. For the time being I've added it to the overlay so people can use it. There is a bug upstream but it doesn't look like they're interested.
If you have a somewhat sane patch that you apply conditional for musl, feel free to apply to the main tree (for the time being). I just haven't had the time (and priority) to come up with something up till now. My main concern is that it looks like the current patch changes the scenario for existing installs, and I don't really like that.
(In reply to Fabian Groffen from comment #8) > If you have a somewhat sane patch that you apply conditional for musl, feel > free to apply to the main tree (for the time being). I just haven't had the > time (and priority) to come up with something up till now. My main concern > is that it looks like the current patch changes the scenario for existing > installs, and I don't really like that. Here's a sane patch which I'll commit in a sec as exim-4.87-r1.ebuild. I don't want to add it directly to exim-4.87.ebuild since the latter is stable, although the patch is totally safe: --- exim-4.87.ebuild 2016-09-19 16:31:30.915281413 -0400 +++ exim-4.87-r1.ebuild 2016-09-19 17:23:43.263334081 -0400 @@ -25,7 +25,7 @@ SLOT="0" LICENSE="GPL-2" -KEYWORDS="alpha amd64 ~arm hppa ia64 ppc ppc64 sparc x86 ~x86-fbsd ~x86-solaris" +KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 ~sparc ~x86 ~x86-fbsd ~x86-solaris" COMMON_DEPEND=">=sys-apps/sed-4.0.5 >=sys-libs/db-3.2:= @@ -128,6 +128,11 @@ -e "s:COMPRESS_COMMAND=.*$:COMPRESS_COMMAND=${EPREFIX}/bin/gzip:" \ src/EDITME > Local/Makefile + if use elibc_musl; then + sed -e 's/^LIBS = -lnsl/LIBS =/g' \ + -i OS/Makefile-Linux + fi + cd Local cat >> Makefile <<- EOC @@ -138,7 +143,7 @@ EOC # if we use libiconv, now is the time to tell so - use !elibc_glibc && echo "EXTRALIBS_EXIM=-liconv" >> Makefile + use !elibc_glibc && use !elibc_musl && echo "EXTRALIBS_EXIM=-liconv" >> Makefile # support for IPv6 if use ipv6; then
i've tested on both glibc and musl. we should be good here.