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

Failed to build with LLVM 17 #8

Open
rhanqtl opened this issue Mar 21, 2023 · 0 comments
Open

Failed to build with LLVM 17 #8

rhanqtl opened this issue Mar 21, 2023 · 0 comments

Comments

@rhanqtl
Copy link

rhanqtl commented Mar 21, 2023

I'm compiling the Cpu0 code with LLVM 17, and get below error message:

FAILED: lib/Target/Cpu0/MCTargetDesc/CMakeFiles/LLVMCpu0Desc.dir/Cpu0MCTargetDesc.cpp.o 
/usr/sbin/clang++ -DGTEST_HAS_RTTI=0 -D_DEBUG -D_GLIBCXX_ASSERTIONS -D_GNU_SOURCE -D_LIBCPP_ENABLE_ASSERTIONS -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/root/projects/llvm-project/llvm/build/lib/Target/Cpu0/MCTargetDesc -I/root/projects/llvm-project/llvm/lib/Target/Cpu0/MCTargetDesc -I/root/projects/llvm-project/llvm/lib/Target/Cpu0 -I/root/projects/llvm-project/llvm/build/lib/Target/Cpu0 -I/root/projects/llvm-project/llvm/build/include -I/root/projects/llvm-project/llvm/include -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -Wc++98-compat-extra-semi -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wno-comment -Wstring-conversion -Wmisleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -g -fvisibility=hidden  -fno-exceptions -funwind-tables -fno-rtti -std=c++17 -MD -MT lib/Target/Cpu0/MCTargetDesc/CMakeFiles/LLVMCpu0Desc.dir/Cpu0MCTargetDesc.cpp.o -MF lib/Target/Cpu0/MCTargetDesc/CMakeFiles/LLVMCpu0Desc.dir/Cpu0MCTargetDesc.cpp.o.d -o lib/Target/Cpu0/MCTargetDesc/CMakeFiles/LLVMCpu0Desc.dir/Cpu0MCTargetDesc.cpp.o -c /root/projects/llvm-project/llvm/lib/Target/Cpu0/MCTargetDesc/Cpu0MCTargetDesc.cpp
In file included from /root/projects/llvm-project/llvm/lib/Target/Cpu0/MCTargetDesc/Cpu0MCTargetDesc.cpp:34:
/root/projects/llvm-project/llvm/build/lib/Target/Cpu0/Cpu0GenSubtargetInfo.inc:74:57: warning: zero size arrays are an extension [-Wzero-length-array]
extern const llvm::SubtargetSubTypeKV Cpu0SubTypeKV[] = {
                                                        ^
/root/projects/llvm-project/llvm/build/lib/Target/Cpu0/Cpu0GenSubtargetInfo.inc:105:73: error: use of undeclared identifier 'None'
  return new Cpu0GenMCSubtargetInfo(TT, CPU, TuneCPU, FS, std::nullopt, None, 
                                                                        ^
1 warning and 1 error generated.

I've tried to solve it by myself, but as a newbie, it's really hard.

What should I do to fix the "use of undeclared identifier" issue? Seems there is something missing.

Configuration and compilation commands (the working directory is llvm-project/llvm):

$ cmake -S . -B build -G Ninja -DCMAKE_EXPORT_COMPILE_COMMANDS=1 -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_BUILD_TYPE=Debug
$ cmake --build build --target all
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant