Message ID | CA+icZUWHUJg247UTNkton7YxhFiJtj7z0oxbqCSJ1k+KSazOew@mail.gmail.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
On Tue, Feb 26, 2013 at 02:20:26PM +0100, Sedat Dilek wrote: > On Tue, Feb 26, 2013 at 1:58 PM, Chris Wilson <chris@chris-wilson.co.uk> wrote: > > On Tue, Feb 26, 2013 at 01:35:51PM +0100, Sedat Dilek wrote: > >> With xf86-video-intel-git13461a1 [1] I see this: > >> > >> [ build-log ] > >> ... > >> CC sna_cpu.lo > >> 8 warnings generated. > >> CC sna_damage.lo > >> CC sna_display.lo > >> sna_cpu.c:47:2: error: implicit declaration of function '__cpuid' is > >> invalid in C99 [-Werror,-Wimplicit-function-declaration] > >> __cpuid(1, eax, ebx, ecx, edx); > >> ^ > > [snip] > > > >> So, clang should be treated differently? > > > > It doesn't use cpuid.h unless the compiler claims to be gcc >= 4. It > > would appear once again that clang is broken. > > Can you explain why clang is BROKEN in your eyes? Because it claims to be gcc 4, yet fails to provide a function/macro provided by gcc 4. -Chris
On Tue, Feb 26, 2013 at 2:33 PM, Chris Wilson <chris@chris-wilson.co.uk> wrote: > On Tue, Feb 26, 2013 at 02:20:26PM +0100, Sedat Dilek wrote: >> On Tue, Feb 26, 2013 at 1:58 PM, Chris Wilson <chris@chris-wilson.co.uk> wrote: >> > On Tue, Feb 26, 2013 at 01:35:51PM +0100, Sedat Dilek wrote: >> >> With xf86-video-intel-git13461a1 [1] I see this: >> >> >> >> [ build-log ] >> >> ... >> >> CC sna_cpu.lo >> >> 8 warnings generated. >> >> CC sna_damage.lo >> >> CC sna_display.lo >> >> sna_cpu.c:47:2: error: implicit declaration of function '__cpuid' is >> >> invalid in C99 [-Werror,-Wimplicit-function-declaration] >> >> __cpuid(1, eax, ebx, ecx, edx); >> >> ^ >> > [snip] >> > >> >> So, clang should be treated differently? >> > >> > It doesn't use cpuid.h unless the compiler claims to be gcc >= 4. It >> > would appear once again that clang is broken. >> >> Can you explain why clang is BROKEN in your eyes? > > Because it claims to be gcc 4, yet fails to provide a function/macro > provided by gcc 4. Even clang latest-git has same file [1]. Any workaround you can imagine? - Sedat - [1] https://github.com/llvm-mirror/clang/blob/master/lib/Headers/cpuid.h > -Chris > > -- > Chris Wilson, Intel Open Source Technology Centre
On Tue, Feb 26, 2013 at 02:38:14PM +0100, Sedat Dilek wrote: > On Tue, Feb 26, 2013 at 2:33 PM, Chris Wilson <chris@chris-wilson.co.uk> wrote: > > On Tue, Feb 26, 2013 at 02:20:26PM +0100, Sedat Dilek wrote: > >> On Tue, Feb 26, 2013 at 1:58 PM, Chris Wilson <chris@chris-wilson.co.uk> wrote: > >> > On Tue, Feb 26, 2013 at 01:35:51PM +0100, Sedat Dilek wrote: > >> >> With xf86-video-intel-git13461a1 [1] I see this: > >> >> > >> >> [ build-log ] > >> >> ... > >> >> CC sna_cpu.lo > >> >> 8 warnings generated. > >> >> CC sna_damage.lo > >> >> CC sna_display.lo > >> >> sna_cpu.c:47:2: error: implicit declaration of function '__cpuid' is > >> >> invalid in C99 [-Werror,-Wimplicit-function-declaration] > >> >> __cpuid(1, eax, ebx, ecx, edx); > >> >> ^ > >> > [snip] > >> > > >> >> So, clang should be treated differently? > >> > > >> > It doesn't use cpuid.h unless the compiler claims to be gcc >= 4. It > >> > would appear once again that clang is broken. > >> > >> Can you explain why clang is BROKEN in your eyes? > > > > Because it claims to be gcc 4, yet fails to provide a function/macro > > provided by gcc 4. > > Even clang latest-git has same file [1]. > Any workaround you can imagine? && !defined(__clang__) Based on the bug reports I have, I would strongly recommend not to use clang as it is known to miscompile the ddx. My outlook is jaundiced though as people report the failures but not if it ever then succeeds in not exploding during use. -Chris
On Tue, Feb 26, 2013 at 2:50 PM, Chris Wilson <chris@chris-wilson.co.uk> wrote: > On Tue, Feb 26, 2013 at 02:38:14PM +0100, Sedat Dilek wrote: >> On Tue, Feb 26, 2013 at 2:33 PM, Chris Wilson <chris@chris-wilson.co.uk> wrote: >> > On Tue, Feb 26, 2013 at 02:20:26PM +0100, Sedat Dilek wrote: >> >> On Tue, Feb 26, 2013 at 1:58 PM, Chris Wilson <chris@chris-wilson.co.uk> wrote: >> >> > On Tue, Feb 26, 2013 at 01:35:51PM +0100, Sedat Dilek wrote: >> >> >> With xf86-video-intel-git13461a1 [1] I see this: >> >> >> >> >> >> [ build-log ] >> >> >> ... >> >> >> CC sna_cpu.lo >> >> >> 8 warnings generated. >> >> >> CC sna_damage.lo >> >> >> CC sna_display.lo >> >> >> sna_cpu.c:47:2: error: implicit declaration of function '__cpuid' is >> >> >> invalid in C99 [-Werror,-Wimplicit-function-declaration] >> >> >> __cpuid(1, eax, ebx, ecx, edx); >> >> >> ^ >> >> > [snip] >> >> > >> >> >> So, clang should be treated differently? >> >> > >> >> > It doesn't use cpuid.h unless the compiler claims to be gcc >= 4. It >> >> > would appear once again that clang is broken. >> >> >> >> Can you explain why clang is BROKEN in your eyes? >> > >> > Because it claims to be gcc 4, yet fails to provide a function/macro >> > provided by gcc 4. >> >> Even clang latest-git has same file [1]. >> Any workaround you can imagine? > > && !defined(__clang__) > > Based on the bug reports I have, I would strongly recommend not to use > clang as it is known to miscompile the ddx. My outlook is jaundiced > though as people report the failures but not if it ever then succeeds in > not exploding during use. Can you explain what you mean with "miscompilation"? Attached patch lets me compile intel-ddx with clang-3.2. - Sedat - > -Chris > > -- > Chris Wilson, Intel Open Source Technology Centre
On Tue, Feb 26, 2013 at 03:11:50PM +0100, Sedat Dilek wrote: > On Tue, Feb 26, 2013 at 2:50 PM, Chris Wilson <chris@chris-wilson.co.uk> wrote: > > On Tue, Feb 26, 2013 at 02:38:14PM +0100, Sedat Dilek wrote: > >> On Tue, Feb 26, 2013 at 2:33 PM, Chris Wilson <chris@chris-wilson.co.uk> wrote: > >> > On Tue, Feb 26, 2013 at 02:20:26PM +0100, Sedat Dilek wrote: > >> >> On Tue, Feb 26, 2013 at 1:58 PM, Chris Wilson <chris@chris-wilson.co.uk> wrote: > >> >> > On Tue, Feb 26, 2013 at 01:35:51PM +0100, Sedat Dilek wrote: > >> >> >> With xf86-video-intel-git13461a1 [1] I see this: > >> >> >> > >> >> >> [ build-log ] > >> >> >> ... > >> >> >> CC sna_cpu.lo > >> >> >> 8 warnings generated. > >> >> >> CC sna_damage.lo > >> >> >> CC sna_display.lo > >> >> >> sna_cpu.c:47:2: error: implicit declaration of function '__cpuid' is > >> >> >> invalid in C99 [-Werror,-Wimplicit-function-declaration] > >> >> >> __cpuid(1, eax, ebx, ecx, edx); > >> >> >> ^ > >> >> > [snip] > >> >> > > >> >> >> So, clang should be treated differently? > >> >> > > >> >> > It doesn't use cpuid.h unless the compiler claims to be gcc >= 4. It > >> >> > would appear once again that clang is broken. > >> >> > >> >> Can you explain why clang is BROKEN in your eyes? > >> > > >> > Because it claims to be gcc 4, yet fails to provide a function/macro > >> > provided by gcc 4. > >> > >> Even clang latest-git has same file [1]. > >> Any workaround you can imagine? > > > > && !defined(__clang__) > > > > Based on the bug reports I have, I would strongly recommend not to use > > clang as it is known to miscompile the ddx. My outlook is jaundiced > > though as people report the failures but not if it ever then succeeds in > > not exploding during use. > > Can you explain what you mean with "miscompilation"? It generates invalid object code that cause segfaults during use. Besides which as you have also demonstrated, it barely understands C. -Chris
--- a/src/sna/sna_cpu.c +++ b/src/sna/sna_cpu.c @@ -44,7 +44,7 @@ unsigned sna_cpu_detect(void) unsigned int eax, ebx, ecx, edx; unsigned features = 0; - __cpuid(1, eax, ebx, ecx, edx); + __get_cpuid(1, eax, ebx, ecx, edx); if (eax & bit_SSE3) features |= SSE3;