Your message dated Thu, 26 Dec 2013 21:29:31 +1100
with message-id <[email protected]>
and subject line Re: /usr/bin/clang: compilation fails on MIPS due to missing
_MIPS_SZPTR macro
has caused the Debian Bug report #629441,
regarding "libc6-dev: compilation fails with clang on MIPS due to
to be marked as done.
This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.
(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)
--
629441: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=629441
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: clang
Version: 2.7-3
Severity: normal
File: /usr/bin/clang
clang is unable to compile a trivial program on MIPS due to a glibc
dependency on GCC-specific macros. Here is a command that demonstrates the
failure:
$ echo '#include <stdlib.h>' | clang -x c -
clang: warning: unknown platform, assuming -mfloat-abi=soft
In file included from <stdin>:1:
In file included from /usr/include/stdlib.h:320:
In file included from /usr/include/sys/types.h:31:
/usr/include/bits/types.h:128:3: error: #error
The problem is that glibc expects the macro _MIPS_SZPTR to be defined by the
compiler. Clang does not appear to define this macro. Glibc uses _MIPS_SZPTR
to set the value of __WORDSIZE, so you can workaround the compilation issue
like this:
printf "#define _MIPS_SZPTR 32\n#include <stdlib.h>\n" | clang -x c -
The Linux kernel sources mention several other MIPS-related macros that are
specific to GCC and may not be implemented by other compilers [1].
[1] http://www.kneuro.net/cgi-bin/lxr/http/source/include/asm-mips/sgidefs.h#L35
--- End Message ---
--- Begin Message ---
Version: 1:3.2-20
On Thu, Dec 26, 2013 at 09:31:41AM +0100, Aurelien Jarno wrote:
> glibc has workarounded the clang bug, which didn't define correctly
> _MIPS_SZPTR, so it's normal that your test works.
>
> The test to do is the following:
>
> $echo '_MIPS_SZPTR' | clang -E -
> # 1 "<stdin>"
> # 1 "<stdin>" 1
> # 1 "<built-in>" 1
> # 1 "<built-in>" 3
> # 154 "<built-in>" 3
> # 1 "<command line>" 1
> # 1 "<built-in>" 2
> # 1 "<stdin>" 2
> 32
>
> And you can see that _MIPS_SZPTR is correctly defined. So yes this bug
> can be closed now.
I'm closing this bug report.
--- End Message ---