From: Rich Felker <dalias@libc.org>
To: musl@lists.openwall.com
Subject: Re: ./configure errors witn musl-gcc (zlib library conflict when building openssh)
Date: Fri, 5 Aug 2016 19:33:19 -0400 [thread overview]
Message-ID: <20160805233319.GS15995@brightrain.aerifal.cx> (raw)
In-Reply-To: <66c1b284-a9ae-774f-579f-fac0d1c6193e@gmail.com>
On Fri, Aug 05, 2016 at 06:32:14PM -0400, Assaf Gordon wrote:
> Hello,
>
> I'm trying to build openssh on Ubuntu with musl-gcc, and encountered a problem during "./configure" due to required library (zlib) which causes conflicts between the system's glibc and musl-libc.
>
> There is probably a simple solution, but I couldn't find one.
>
> The system is Ubuntu 14.04 LTS, gcc 4.8.4.
> musl is 1.1.15 built from source, installed to /usr/local/musl .
>
> First, I build zlib using musl-gcc:
>
> wget http://zlib.net/zlib-1.2.8.tar.gz
> tar -xf zlib-1.2.8.tar.gz
> cd zlib-1.2.8
> CC=musl-gcc ./configure
> make
>
> This works well (note I did not install it with 'sudo make install').
>
> Second, I try to build openssh:
>
> git clone https://github.com/openssh/openssh-portable
> cd openssh-portable
> autoreconf -if
> CC=musl-gcc ./configure --without-stackprotect --with-zlib=/home/ubuntu/sources/zlib-1.2.8
> But this fails with:
>
> checking zlib.h usability... yes
> checking zlib.h presence... yes
> checking for zlib.h... yes
> checking for deflate in -lz... yes
> checking for possibly buggy zlib... yes
> configure: error: *** zlib too old - check config.log ***
> Your reported zlib version has known security problems. It's possible your
> vendor has fixed these problems without changing the version number. If you
> are sure this is the case, you can disable the check by running
> "./configure --without-zlib-version-check".
> If you are in doubt, upgrade zlib to version 1.2.3 or greater.
> See http://www.gzip.org/zlib/ for details.
>
> The problem is not that zlib is "too old", but that the wrong shard-object is used (it uses the system's one).
> From config.log:
>
> configure:9002: checking for possibly buggy zlib
> configure:9041: musl-gcc -o conftest -g -O2 -Wall -Wpointer-arith -Wuninitialized -Wsign-compare -Wformat-security -Wsizeof-pointer-memaccess -Wno-pointer-sign -Wno-unused-result -fno-strict-aliasing -D_FORTIFY_SOURCE=2 -ftrapv -fno-builtin-memset -I/home/ubuntu/sources/zlib-1.2.8 -L/home/ubuntu/sources/zlib-1.2.8 -Wl,-z,relro -Wl,-z,now -Wl,-z,noexecstack conftest.c -lz >&5
> configure:9041: $? = 0
> configure:9041: ./conftest
> Error relocating /lib/x86_64-linux-gnu/libz.so.1: __snprintf_chk: symbol not found
> Error relocating /lib/x86_64-linux-gnu/libz.so.1: __vsnprintf_chk: symbol not found
> configure:9041: $? = 127
> configure: program exited with status 127
Ah, I missed that this is a _runtime_ failure, not a linking failure.
The problem is just that you don't have an /etc/ld-musl-x86_64.path
file, so musl is using the default library paths which are only
suitable for a musl-based system. Create that file and put the paths
to your musl-linked libs there. Or, alternatively, use static linking.
Dynamic linking musl is really not ideal when your system libc is
glibc.
Rich
next prev parent reply other threads:[~2016-08-05 23:33 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-05 22:32 Assaf Gordon
2016-08-05 23:08 ` Rich Felker
2016-08-05 23:26 ` Khem Raj
2016-08-05 23:30 ` Rich Felker
2016-08-05 23:33 ` Rich Felker [this message]
2016-08-13 3:57 ` Assaf Gordon
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=20160805233319.GS15995@brightrain.aerifal.cx \
--to=dalias@libc.org \
--cc=musl@lists.openwall.com \
/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.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/musl/
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 NNTP newsgroup(s).