Re: r245741 (clang as cc) can not build binaries for GEODE processor

From: Lev Serebryakov <lev_at_FreeBSD.org>
Date: Sat, 23 Feb 2013 00:31:50 +0400
Hello, Lev.
You wrote 23 февраля 2013 г., 0:14:45:

LS> Hello, Dimitry.
LS> You wrote 22 февраля 2013 г., 20:14:50:

DA>> As Joerg Sonnenberger mentioned to me, the address 0x10351d6 you show in
DA>> the gdb session seems to be quite high, possibly pointing to some shared
DA>> library.  Maybe you can try to figure out which library it is?
LS> Here  is two long NOPs in output of clang in -CURRENT without "-march"
LS> options:

LS> objdump -d test

LS> 080483a0 <_start1>:
LS> ...
LS>  80483e8:       40                      inc    %eax
LS>  80483e9:       0f 1f 80 00 00 00 00    nopl   0x0(%eax)
LS>  80483f0:       8a 08                   mov    (%eax),%cl
LS> ...
LS>  8048496:       31 ff                   xor    %edi,%edi
LS>  8048498:       0f 1f 84 00 00 00 00    nopl   0x0(%eax,%eax,1)
LS>  804849f:       00 
LS>  80484a0:       8b 04 bd 68 96 04 08    mov    0x8049668(,%edi,4),%eax
  And  sample code is EXACTLY THE SAME with "-march=geode" and crashes the
 same!

 I'm puzzled, why system binaries works in such case!?

 But disassembly of system binaries (for example, /usr/bin/who)
doesn't contains "nopl" at all!

 I've attached disassembly of "start1" form:

 (a) unstripped "who" command built in "make buildworld" stage with
     CPUTYPE=geode set.
 (b) unstripped "Hello world" program, built with simple "cc -o test \
     test.c" (contains "nopl")
 (c) unstripped "Hello world" program, built with simple "cc \
     -march=geode -o test.geode test.c" (contains "nopl" too!)

  Oh, I see... "start1" is linked from startup code like crt0.o, am I
right?

  So, rebuilding only ports with "CPUTYPE=geode" will not help!

  But, in any case, it seems to be bug in clang to generate such
  instructions in "default" case.

-- 
// Black Lion AKA Lev Serebryakov <lev_at_FreeBSD.org>
Received on Fri Feb 22 2013 - 19:31:58 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:40:35 UTC