Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date: Thu, 3 Dec 2015 00:33:57 +0100
From: Szabolcs Nagy <>
Cc: Rich Felker <>
Subject: Re: Re: MUSL 1.1.10 Static linking issue

* 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 -
> 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

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

you can test the toolchain by

 gcc -v


 gcc -E -dM - </dev/null |grep ARM

shows the predefined arm macros

> I am using scripts 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.

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.