From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/8563 Path: news.gmane.org!not-for-mail From: Szabolcs Nagy Newsgroups: gmane.linux.lib.musl.general Subject: Re: Problems? compiling musl toolchain Date: Thu, 24 Sep 2015 17:15:36 +0200 Message-ID: <20150924151536.GJ10551@port70.net> References: <5604077E.3080507@bluewin.ch> <20150924150001.GJ17773@brightrain.aerifal.cx> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1443107757 8472 80.91.229.3 (24 Sep 2015 15:15:57 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 24 Sep 2015 15:15:57 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-8575-gllmg-musl=m.gmane.org@lists.openwall.com Thu Sep 24 17:15:50 2015 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1Zf8FR-0000WA-Vi for gllmg-musl@m.gmane.org; Thu, 24 Sep 2015 17:15:50 +0200 Original-Received: (qmail 5398 invoked by uid 550); 24 Sep 2015 15:15:48 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Original-Received: (qmail 5377 invoked from network); 24 Sep 2015 15:15:48 -0000 Mail-Followup-To: musl@lists.openwall.com Content-Disposition: inline In-Reply-To: <20150924150001.GJ17773@brightrain.aerifal.cx> User-Agent: Mutt/1.5.23 (2014-03-12) Xref: news.gmane.org gmane.linux.lib.musl.general:8563 Archived-At: * Rich Felker [2015-09-24 11:00:01 -0400]: > On Thu, Sep 24, 2015 at 04:23:58PM +0200, Ruben Winist=F6rfer wrote: > > First: Compiling GCC 5.2.0 (and also 4.9.3) with musl 1.1.11 > > toolchain I get a lot of warnings about missing sentinels in > > function calls. Compiling GCC (same versions) with glibc toolchain > > there's no such warning at all. > > Replacing the function call sentinels 'NULL' with '(char *)NULL' in > > the affected source code of GCC makes the warnings disappear. >=20 > This warning is correct; the GCC code is wrong. NULL is not a valid > way to pass a null pointer to a variadic function, especially not in > C++ code. >=20 > > My question: Does the reason for these warnings have some impact on > > the health of the toolchain (is there something wrong?) or are they > > just a byproduct of the correctness and standards-conformance of > > musl? >=20 > musl has arranged things so that this will work ok (and won't blow up) > at runtime, but what GCC's source is doing formally incorrect and > should be fixed. >=20 the glibc definition, __null (gcc builtin), is not strictly conforming. in c++11 it is possible to define NULL in such a way that it does not warn, std::nullptr, but even that's not correct to use in variadic functions unless the argument type is (void*) or (char*), so probably the warning is a good thing. > > Second: Compiling with a musl 1.1.11, GCC 5.2.0 (and 4.9.3), > > Binutils 2.25.1 toolchain I get the following info (warning) over an > > over again: > >=20 > > ....ld: copy reloc against protected `stdout' is dangerous > > ....ld: copy reloc against protected `stdin' is dangerous > > ....ld: copy reloc against protected `stderr' is dangerous > >=20 > > Same can be seen in Alpine Linux build logs: e.g. http://build.alpineli= nux.org/buildlogs/build-edge-x86_64/main/patchutils/patchutils-0.3.4-r0.log > >=20 > > Reason for these "warnings" seems to be a change in the linker from > > binutils version 2.25 to 2.25.1. > > Lines 2677 to 2680 in 'binutils-2.25.1/bfd/elflink.c' are new and in > > my opinion the source of the issued warning. > > My C knowledge is minimal but as far as I can tell this means that > > the problem - if there is one at all - was already there before > > binutils version 2.25.1, the linker just did not print the > > "warning". > >=20 > > I haven't seen this warning before using glibc. So i guess it has to > > be musl-related. > >=20 > > What do you think? Is there a problem or can I ignore these warnings? >=20 > You can safely ignore them. I do plan to find a way to make them go > away in the next release though, since they're confusing and > concerning to many users. the warning is disabled on targets that has extern_protected_data handling since http://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;a=3Dcommit;h=3D88= 9c2a67967f7047c245779a0a0fd8ba8796846e but binutils has a yearly release cycle so we will have to wait.