From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/13471 Path: news.gmane.org!.POSTED!not-for-mail From: =?utf-8?Q?Ond=C5=99ej?= Jirman Newsgroups: gmane.linux.lib.musl.general Subject: Re: [RFC PATCH] Fix __libc_start_main prototype in [r]crt1.c to match the caller Date: Wed, 21 Nov 2018 17:15:18 +0100 Message-ID: <20181121161518.d2ouey2zovz3gyrx@core.my.home> References: <20181121145150.15500-1-megous@megous.com> <20181121150903.GN21289@port70.net> <20181121152217.GO21289@port70.net> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: blaine.gmane.org 1542816805 27634 195.159.176.226 (21 Nov 2018 16:13:25 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 21 Nov 2018 16:13:25 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-13487-gllmg-musl=m.gmane.org@lists.openwall.com Wed Nov 21 17:13:21 2018 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by blaine.gmane.org with smtp (Exim 4.84_2) (envelope-from ) id 1gPV7x-00074w-4k for gllmg-musl@m.gmane.org; Wed, 21 Nov 2018 17:13:21 +0100 Original-Received: (qmail 7775 invoked by uid 550); 21 Nov 2018 16:15:30 -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 7757 invoked from network); 21 Nov 2018 16:15:30 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=megous.com; s=mail; t=1542816918; bh=LCCHlR79vDTC1NyB7z61zUbHFNsYYxkeBPQw5BSqFFc=; h=Date:From:To:Subject:References:In-Reply-To:From; b=a3OyiaD91UhBTr+T40DM3aR6InZKhCcWlMi6Ntr/vS1oeN8GNv+LyL4WjjbGWAqYu 3D7WMR29OZYjKEXPPAX2EEmzctrapyZU6pw8s8e9+EHKGss9c31C3kOA3wGS2W4ryn +syH/V7tZZpTJHFwl5So7OneJBRg4qFrnEyqEnSM= Mail-Followup-To: musl@lists.openwall.com Content-Disposition: inline In-Reply-To: <20181121152217.GO21289@port70.net> Xref: news.gmane.org gmane.linux.lib.musl.general:13471 Archived-At: On Wed, Nov 21, 2018 at 04:22:17PM +0100, Szabolcs Nagy wrote: > * Szabolcs Nagy [2018-11-21 16:09:04 +0100]: > > > * megous@megous.com [2018-11-21 15:51:50 +0100]: > > > From: Ondrej Jirman > > > > > > __libc_start_main function is not using the last three arguments. > > > GCC in LTO mode complains about mismatch. > > > > fix it in the other way then. > > > > > - __libc_start_main(main, argc, argv, _init, _fini, 0); > > > + __libc_start_main(main, argc, argv); > > > > you just completely broke everything there didnt you? > > > > sorry the _init, _fini there is only needed for glibc compat > (i.e. executable linked with musl crt1.o, but using glibc > to run it, which should not be a common use case) I had a hunch that there was some reason outside of musl for these arguments, therefore just the RFC. I guess, it's better to ignore the patch then. I just saw a difference of prototypes, so I sent the patch. > > how will the _init/_fini code of executables with > > DT_INIT, DT_FINI dynamic tags run? > > > > i think gcc still havent fixed weak object symbol alias > > bugs with lto so e.g. you will get incorrect environ if > > you lto link the libc. > > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69271 > > these lto issues still apply. I'm attempting a static build, for which this issue should not apply, AFAIK. Though, I'm trying on mips, and it leads to GOT related error. So LTO of musl+my code doesn't work anyway, because ld fails. I'll try with some other target just to see if I can get something that works, without the limitations of mips arch. regards, o.