Bug#868779: clang: produces unusable binaries on armv5tel

Ian Chard ian at chard.org
Wed Jul 19 07:41:15 UTC 2017


#841474 looks like a likely candidate but according to that bug it was 
fixed in 3.8.1-17; I have 3.8.1-24.  Same with #842142.  They both relate 
to NEON insructions being emitted for binaries targeted at systems where 
such instructions are only optionally supported.

The generated binary doesn't die at a NEON instruction -- here's a partial 
disassembly from gdb with the point of the crash marked:

    0x00010448 <+0>:     push    {r11, lr}
    0x0001044c <+4>:     mov     r11, sp
    0x00010450 <+8>:     sub     sp, sp, #8
=> 0x00010454 <+12>:    movw    r0, #1272       ; 0x4f8
    0x00010458 <+16>:    movt    r0, #1
    0x0001045c <+20>:    movw    r1, #0
    0x00010460 <+24>:    str     r1, [sp, #4]
    0x00010464 <+28>:    bl      0x102e8 <printf at plt>
    0x00010468 <+32>:    movw    r1, #0
    0x0001046c <+36>:    str     r0, [sp]
    0x00010470 <+40>:    mov     r0, r1
    0x00010474 <+44>:    mov     sp, r11
    0x00010478 <+48>:    pop     {r11, pc}

Cheers
- Ian

-- 
Ian Chard  <ian at chard.org>
sedimentation fault -- beach dumped

On Wed, 19 Jul 2017, Sylvestre Ledru wrote:

> Can it be related to bugs #841474 or #842142 ?
>
>
> S
>
>
> Le 18/07/2017 à 15:36, Ian Chard a écrit :
>> Package: clang
>> Version: 1:3.8-36
>> Severity: important
>>
>> Dear Maintainer,
>>
>> Every binary I compile on an armv5tel system crashes immediately with
>> 'Illegal instruction'.  I note that the target is given by clang as
>> armv7l; could that be the problem?
>>
>> I tried this with the clang-3.9 package but got the same result.
>>
>> ian at little:~$ cat woo.c
>> #include <stdio.h>
>>
>> int main(void)
>> {
>>         printf("Hello, world!\n");
>>         return 0;
>> }
>> ian at little:~$ clang -o woo woo.c
>> ian at little:~$ ./woo
>> Illegal instruction
>> ian at little:~$ arch
>> armv5tel
>> ian at little:~$ clang -v
>> clang version 3.8.1-24 (tags/RELEASE_381/final)
>> Target: armv7l-unknown-linux-gnueabi
>> Thread model: posix
>> InstalledDir: /usr/bin
>> Found candidate GCC installation:
>> /usr/bin/../lib/gcc/arm-linux-gnueabi/4.8
>> Found candidate GCC installation:
>> /usr/bin/../lib/gcc/arm-linux-gnueabi/4.8.4
>> Found candidate GCC installation:
>> /usr/bin/../lib/gcc/arm-linux-gnueabi/4.9
>> Found candidate GCC installation:
>> /usr/bin/../lib/gcc/arm-linux-gnueabi/4.9.2
>> Found candidate GCC installation:
>> /usr/bin/../lib/gcc/arm-linux-gnueabi/6.3.0
>> Found candidate GCC installation: /usr/lib/gcc/arm-linux-gnueabi/4.8
>> Found candidate GCC installation: /usr/lib/gcc/arm-linux-gnueabi/4.8.4
>> Found candidate GCC installation: /usr/lib/gcc/arm-linux-gnueabi/4.9
>> Found candidate GCC installation: /usr/lib/gcc/arm-linux-gnueabi/4.9.2
>> Found candidate GCC installation: /usr/lib/gcc/arm-linux-gnueabi/6.3.0
>> Selected GCC installation: /usr/bin/../lib/gcc/arm-linux-gnueabi/6.3.0
>> Candidate multilib: .;@m32
>> Selected multilib: .;@m32
>> ian at little:~$
>>
>> -- System Information:
>> Debian Release: 9.0
>>   APT prefers stable
>>   APT policy: (500, 'stable')
>> Architecture: armel (armv5tel)
>>
>> Kernel: Linux 4.9.0-3-marvell
>> Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8), LANGUAGE=en_GB:en (charmap=UTF-8)
>> Shell: /bin/sh linked to /bin/dash
>> Init: systemd (via /run/systemd/system)
>>
>> Versions of packages clang depends on:
>> ii  clang-3.8  1:3.8.1-24
>>
>> clang recommends no packages.
>>
>> clang suggests no packages.
>>
>> -- no debconf information
>>
>> _______________________________________________
>> Pkg-llvm-team mailing list
>> Pkg-llvm-team at lists.alioth.debian.org
>> http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-llvm-team
>
>
>


More information about the Pkg-llvm-team mailing list