From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/8954 Path: news.gmane.org!not-for-mail From: Szabolcs Nagy Newsgroups: gmane.linux.lib.musl.general Subject: Re: Re: MUSL 1.1.10 Static linking issue Date: Thu, 3 Dec 2015 00:33:57 +0100 Message-ID: <20151202233356.GS23362@port70.net> References: Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1449099265 10821 80.91.229.3 (2 Dec 2015 23:34:25 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 2 Dec 2015 23:34:25 +0000 (UTC) Cc: Rich Felker To: musl@lists.openwall.com Original-X-From: musl-return-8967-gllmg-musl=m.gmane.org@lists.openwall.com Thu Dec 03 00:34:12 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 1a4GuZ-00072h-OK for gllmg-musl@m.gmane.org; Thu, 03 Dec 2015 00:34:11 +0100 Original-Received: (qmail 7911 invoked by uid 550); 2 Dec 2015 23:34:09 -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 7890 invoked from network); 2 Dec 2015 23:34:08 -0000 Mail-Followup-To: musl@lists.openwall.com, Rich Felker Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) Xref: news.gmane.org gmane.linux.lib.musl.general:8954 Archived-At: * N Jain [2015-12-02 16:37:33 -0500]: > > Can you show the actual error you're getting? > > I am getting run time failure and the issue is in __set_thread_area.c file > > int __set_thread_area(void *p) > { > #if !__ARM_ARCH_7A__ && !__ARM_ARCH_7R__ && __ARM_ARCH < 7 > if (__hwcap & HWCAP_TLS) { > ..... > } > } else { > *int ver = *(int *)0xffff0ffc;* > * SET(gettp, kuser);* > * SET(cas, kuser);* > * SET(barrier, kuser);* > * if (ver < 2) a_crash();* > * if (ver < 3) SET(barrier, oldkuser);* > } > #endif > return __syscall(0xf0005, p); > } > > I used debugger to root cause and found that while generating toolchain > __ARM_ARCH_7A option is not getting configured correctly. > I am reaching to "else" part and getting abort at 0xffff0ffc. > you compiled musl for < armv7-a (musl keeps compatibility so the binary should work on >=armv7-a too). the kernel did not report tls support in hwcap, nor it had the kernel helper pages. sounds like a broken kernel to me. dumping the auxv and /proc/cpuinfo could be useful, (but dont know how to display the auxv easily). > I am trying to compile an ARM OS user application using generated toolchain > (I am following link - > https://github.com/GregorR/musl-cross). > > I can generate the toolchain successfully though not sure what > configuration options I am missing during toolchain generation as passing > " -mcpu=cortex-a15" to compiler is not configuring __ARM_ARCH_7A__ macro ? > in musl-cross you need something like TRIPLE=arm-linux-musleabihf GCC_BOOTSTRAP_CONFFLAGS="--with-arch=armv7-a --with-float=hard --with-fpu=vfpv3-d16" GCC_CONFFLAGS="--with-arch=armv7-a --with-float=hard --with-fpu=vfpv3-d16" for more gcc options see http://gcc.gnu.org/install/configure.html you can test the toolchain by gcc -v and gcc -E -dM - I am using scripts config.sh but only configuring "ARCH=arm". I need > toolchain for cortex-a15 but there is no option to do so ? > pass the -m* options in CFLAGS when configuring musl if you want further control over code generation. http://gcc.gnu.org/onlinedocs/gcc/ARM-Options.html