Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build without KNC and AVX512 is broken on Clang #72

Closed
athre0z opened this issue Nov 8, 2018 · 1 comment
Closed

Build without KNC and AVX512 is broken on Clang #72

athre0z opened this issue Nov 8, 2018 · 1 comment
Labels
C-bug Category: This is a bug (or a fix for a bug, when applied to PRs)

Comments

@athre0z
Copy link
Member

athre0z commented Nov 8, 2018

Building with

cmake -DZYDIS_FEATURE_AVX512=OFF -DZYDIS_FEATURE_KNC=OFF ..

fails with

/tmp/stuff/zydis/src/Generated/InstructionDefinitions.inc:3761:7: error: unknown type name 'ZydisInstructionDefinitionEVEX'; did you
      mean 'ZydisInstructionDefinitionVEX'?
const ZydisInstructionDefinitionEVEX ISTR_DEFINITIONS_EVEX[] =
      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      ZydisInstructionDefinitionVEX
/tmp/stuff/zydis/include/Zydis/Internal/SharedData.h:815:3: note: 'ZydisInstructionDefinitionVEX' declared here
} ZydisInstructionDefinitionVEX;
  ^
In file included from /tmp/stuff/zydis/src/SharedData.c:43:
/tmp/stuff/zydis/src/Generated/InstructionDefinitions.inc:3763:565: warning: excess elements in struct initializer
  ...ZYDIS_REG_CONSTRAINTS_NONE, ZYAN_FALSE ZYDIS_NOTMIN(ZYDIS_IVECTOR_LENGTH_DEFAULT) ZYDIS_NOTMIN(ZYDIS_TUPLETYPE_T1_4X) ZYDIS_NO...
                                                                                                    ^~~~~~~~~~~~~~~~~~~~~
/tmp/stuff/zydis/src/SharedData.c:40:30: note: expanded from macro 'ZYDIS_NOTMIN'
#   define ZYDIS_NOTMIN(x) , x

with the latter warning being repeated a few thousand times.

I imagine that while MSVC seems to be eating it (judging from the PR #71), this might result in corrupted tables and thus incorrect output (due to shifting etc).

@athre0z athre0z added the C-bug Category: This is a bug (or a fix for a bug, when applied to PRs) label Nov 8, 2018
@Mattiwatti
Copy link
Contributor

MSVC does not eat this either, even though it is true in general that MSVC tends to eat a lot more than Clang does (though what actually comes out of the compiler is another matter) 😄

I did not get this error because I additionally had both ZYDIS_DISABLE_EVEX and ZYDIS_DISABLE_MVEX defined. Without those, MSVC gives essentially the same as Clang:

1>  (snip)\instructiondefinitions.inc(3761,38): error C2061:  syntax error: identifier 'ISTR_DEFINITIONS_EVEX'
1>  (snip)\instructiondefinitions.inc(3761,38): error C2061: const ZydisInstructionDefinitionEVEX ISTR_DEFINITIONS_EVEX[] =
1>  (snip)\instructiondefinitions.inc(3761,38): error C2061:                                      ^
1>  (snip)\instructiondefinitions.inc(3761,38): error C2059:  syntax error: ';'
1>  (snip)\instructiondefinitions.inc(3761,38): error C2059: const ZydisInstructionDefinitionEVEX ISTR_DEFINITIONS_EVEX[] =
1>  (snip)\instructiondefinitions.inc(3761,38): error C2059:                                      ^
1>  (snip)\instructiondefinitions.inc(3761,59): error C2059:  syntax error: '['
1>  (snip)\instructiondefinitions.inc(3761,59): error C2059: const ZydisInstructionDefinitionEVEX ISTR_DEFINITIONS_EVEX[] =
1>  (snip)\instructiondefinitions.inc(3761,59): error C2059:                                                           ^
1>  (snip)\instructiondefinitions.inc(6789,38): error C2061:  syntax error: identifier 'ISTR_DEFINITIONS_MVEX'
1>  (snip)\instructiondefinitions.inc(6789,38): error C2061: const ZydisInstructionDefinitionMVEX ISTR_DEFINITIONS_MVEX[] =
1>  (snip)\instructiondefinitions.inc(6789,38): error C2061:                                      ^
1>  (snip)\instructiondefinitions.inc(6789,38): error C2059:  syntax error: ';'
1>  (snip)\instructiondefinitions.inc(6789,38): error C2059: const ZydisInstructionDefinitionMVEX ISTR_DEFINITIONS_MVEX[] =
1>  (snip)\instructiondefinitions.inc(6789,38): error C2059:                                      ^
1>  (snip)\instructiondefinitions.inc(6789,59): error C2059:  syntax error: '['
1>  (snip)\instructiondefinitions.inc(6789,59): error C2059: const ZydisInstructionDefinitionMVEX ISTR_DEFINITIONS_MVEX[] =

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug (or a fix for a bug, when applied to PRs)
Projects
None yet
Development

No branches or pull requests

2 participants