From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/15115 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Alexander Scherbatiy Newsgroups: gmane.linux.lib.musl.general Subject: Re: gnu autoconf AC_CANONICAL_BUILD returns linux-gnu build_os on Alpine Linux 3.10.3 Date: Fri, 10 Jan 2020 15:34:13 +0300 Message-ID: <31026f85-b5af-ec92-8ec4-4fb3b9f98b6c@bell-sw.com> References: <1504261577705096@sas1-0ef7a84b6a92.qloud-c.yandex.net> <20191230165408.GF30412@brightrain.aerifal.cx> Reply-To: musl@lists.openwall.com Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="70032"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.2.2 To: musl@lists.openwall.com, Rich Felker Original-X-From: musl-return-15131-gllmg-musl=m.gmane-mx.org@lists.openwall.com Fri Jan 10 13:37:52 2020 Return-path: Envelope-to: gllmg-musl@m.gmane-mx.org Original-Received: from mother.openwall.net ([195.42.179.200]) by blaine.gmane.org with smtp (Exim 4.89) (envelope-from ) id 1iptUv-000rap-1Y for gllmg-musl@m.gmane-mx.org; Fri, 10 Jan 2020 13:34:41 +0100 Original-Received: (qmail 20333 invoked by uid 550); 10 Jan 2020 12:34:36 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Original-Received: (qmail 20309 invoked from network); 10 Jan 2020 12:34:35 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bell-sw.com; s=mail; t=1578659664; bh=MLL13CxsCrXvaai84WlJYL6Ys/CPH3vs2z4TpcNTUpE=; h=In-Reply-To:From:Date:References:To:Subject:Message-ID; b=UyYqR3Qzvvg0tdXABFCsm/L7A5vaEXW0FwvVZy8/yPHttlQ5ny94PNu8alI07igO/ nGh3J/AhSSw5omQBbqTqlI/ZJU3RyPklF+65p93DShgeNrNm5hLbiIO4M/beHK/gzS ahiN4T8Nf+S7B2ENMbGkOIG65JGJUqpgmSm+5vII= Authentication-Results: mxback5g.mail.yandex.net; dkim=pass header.i=@bell-sw.com In-Reply-To: <20191230165408.GF30412@brightrain.aerifal.cx> Content-Language: en-US Xref: news.gmane.org gmane.linux.lib.musl.general:15115 Archived-At: On 30.12.2019 19:54, Rich Felker wrote: > On Mon, Dec 30, 2019 at 02:24:56PM +0300, Scherbatiy Alexander wrote: >> Hello, >> >> gnu autoconf AC_CANONICAL_BUILD returns linux-gnu build_os variable on Alpine Linux 3.10.3. >> >> Here is a snippet from the configure.ac file which I tested in docker alpine:3.10.3 >> ---------------- >> AC_CANONICAL_BUILD >> AC_MSG_NOTICE([build_os=$build_os]) >> ---------------- >> Output: >> ---------------- >> checking build system type... x86_64-pc-linux-gnu >> configure: build_os=linux-gnu >> ---------------- >> >> The same code on Alpine 3.8.4 (docker alpine:3.8 ) returns: >> ---------------- >> checking build system type... x86_64-pc-linux-musl >> configure: build_os=linux-musl >> ---------------- >> >> Is it expected that build_os is detected as linux-gnu instead of linux-musl on Alpine 3.0.3? > Where was autoconf run to generate the configure script? Production of > linux-musl tuples is a new behavior in recent autoconf, and whether it > happens depends on what version of autoconf was used to build the > configure script, not what versions of software are present where the > configure script runs. Below are outputs of running autoconf on Alpine Linux in docker. The used autoconf (GNU Autoconf) version is 2.69. Alpine Linux 3.10.3: ---------- > docker run --rm -it alpine:3.10.3 > apk add autoconf automake fetch http://dl-cdn.alpinelinux.org/alpine/v3.10/main/x86_64/APKINDEX.tar.gz fetch http://dl-cdn.alpinelinux.org/alpine/v3.10/community/x86_64/APKINDEX.tar.gz (1/5) Installing m4 (1.4.18-r1) (2/5) Installing libbz2 (1.0.6-r7) (3/5) Installing perl (5.28.2-r1) (4/5) Installing autoconf (2.69-r2) (5/5) Installing automake (1.16.1-r0) Executing busybox-1.30.1-r2.trigger OK: 47 MiB in 19 packages > autoreconf -i > ./configure ... configure: build_os=linux-gnu ---------- Alpine Linux 3.8.4: ---------- > docker run --rm -it alpine:3.8.4 > apk add autoconf automake fetch http://dl-cdn.alpinelinux.org/alpine/v3.8/main/x86_64/APKINDEX.tar.gz fetch http://dl-cdn.alpinelinux.org/alpine/v3.8/community/x86_64/APKINDEX.tar.gz (1/5) Installing m4 (1.4.18-r1) (2/5) Installing libbz2 (1.0.6-r7) (3/5) Installing perl (5.26.3-r0) (4/5) Installing autoconf (2.69-r2) (5/5) Installing automake (1.16.1-r0) Executing busybox-1.28.4-r3.trigger OK: 45 MiB in 18 packages > autoreconf -i > ./configure ... configure: build_os=linux-musl ---------- > Use of this result is almost certainly a bug/misuse of configure. Run > a configure test for whatever property you're depending on, not > whether the name is linux-musl vs linux-gnu. The port of OpenJDK to Alpine Linux project Portola uses AC_CANONICAL_BUILDĀ  autoconf property to set HOTSPOT_LIBC property [1]. What is the right way to define which libc should be used in this case? [1] https://hg.openjdk.java.net/portola/portola/file/c4a7cf80a3bd/make/autoconf/platform.m4#l209 Thanks, Alexander. > Rich