From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/14178 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Rich Felker Newsgroups: gmane.linux.lib.musl.general Subject: Re: Illegal instruction in __copy_tls() Date: Wed, 5 Jun 2019 14:37:42 -0400 Message-ID: <20190605183742.GK1506@brightrain.aerifal.cx> References: Reply-To: musl@lists.openwall.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="267487"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Mutt/1.5.21 (2010-09-15) Cc: musl@lists.openwall.com To: "tenspd137 ." Original-X-From: musl-return-14194-gllmg-musl=m.gmane.org@lists.openwall.com Wed Jun 05 20:38:01 2019 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.89) (envelope-from ) id 1hYanR-0017PU-53 for gllmg-musl@m.gmane.org; Wed, 05 Jun 2019 20:38:01 +0200 Original-Received: (qmail 28347 invoked by uid 550); 5 Jun 2019 18:37:58 -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 28329 invoked from network); 5 Jun 2019 18:37:58 -0000 Content-Disposition: inline In-Reply-To: Original-Sender: Rich Felker Xref: news.gmane.org gmane.linux.lib.musl.general:14178 Archived-At: On Wed, Jun 05, 2019 at 12:16:39PM -0600, tenspd137 . wrote: > Hi all > > I am using musl 1.1.22 with in a cross toolchain to create static > binaries on my machine. I am running gentoo linux and used their > crossdev tool to create the cross compiler (x86_64-pc-linux-musl). I > created a small hello world app: > > #include > int main(int argc, char **argv) > {printf("Hello MUSL\n");} > > and compiled with: > > x86_64-pc-linux-musl-gcc -v -static -Os -g hello.c > > Built and runs fine on local machine, but when I put the binary on > another machine, it dumped the core with an ilegal instruction. gdb > claims illegal instruction in __copy_tls(). > > I have been able to compile this program after building the musl-gcc > wrapper and it works on both machines, but I need the cross toolchain > for C++ support. The -v in the commandline above prints messages that > indicate it is using musl from what I can tell. > > Can anyone point me in the right direction or help me figure out what > I am missing? Can you show the gdb backtrace, disassembly at the point of crash, and an strace leading up to it? My best guess is that your toolchain is producing binaries for some non-baseline level of x86_64 ISA, and the machine you're trying to run it on does not support some of the instructions used. Rich