<div dir="ltr">I am not sure which one is correct yet,<div>but gcc -mx32 and clang -mx32 are not compatible.<div><br></div></div><div><div><font face="monospace, monospace">       sizeof(gcc_word) (size_t)</font></div><div><font face="monospace, monospace"> clang -m64   8          8</font></div><div><font face="monospace, monospace"> gcc   -m64   8          8</font></div><div><font face="monospace, monospace"> clang -m32   4          4</font></div><div><font face="monospace, monospace"> gcc   -m32   4          4</font></div><div><font face="monospace, monospace"> clang -mx32  4          4</font></div><div><font face="monospace, monospace"> gcc   -mx32  8          4</font></div></div><div><br></div><div>So, for -mx32 targets, even the original emutls.c will have difference layout for gcc_word from gcc and clang. Would it be right to use only gcc or only clang for gcc -mx32? Then, this compiler-rt's emutls.c should be excluded when gcc -mx32 is used.</div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Sep 4, 2015 at 10:10 AM, H.J. Lu <span dir="ltr"><<a href="mailto:hjl.tools@gmail.com" target="_blank">hjl.tools@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Fri, Sep 4, 2015 at 9:53 AM, Chih-hung Hsieh <<a href="mailto:chh@google.com">chh@google.com</a>> wrote:<br>
> What are the compilation flags to trigger that failure?<br>
> It is unexpected that a target integer word is 8 and sizeof(size_t) is 4.<br>
> If that configuration is correct, and also needs emutls, then it cannot use<br>
> both gnu's emutls.c and this one because the layout difference. If that<br>
> platform does not need emutls or compatibility with gcc, then we can skip<br>
> this test for that platform.<br>
><br>
><br>
</span>compiler-rt is compiled by gcc:<br>
<br>
[hjl@gnu-32 bin]$ cat /tmp/i.c<br>
typedef __SIZE_TYPE__ size_t;<br>
<span class="">typedef unsigned int gcc_word __attribute__((mode(word)));<br>
<br>
</span>int foo[sizeof(size_t) == sizeof(gcc_word) ? 1 : -1];<br>
[hjl@gnu-32 bin]$ gcc -S -mx32 /tmp/i.c<br>
/tmp/i.c:4:5: error: size of array ‘foo’ is negative<br>
 int foo[sizeof(size_t) == sizeof(gcc_word) ? 1 : -1];<br>
     ^<br>
[hjl@gnu-32 bin]$<br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
H.J.<br>
</font></span></blockquote></div><br></div>