tinygo-org / tinygo

Go compiler for small places. Microcontrollers, WebAssembly (WASM/WASI), and command-line tools. Based on LLVM.
https://tinygo.org
Other
14.72k stars 858 forks source link

Unable to Build LLVM on Windows with GCC Version 11.2.0 #4298

Open sago35 opened 2 weeks ago

sago35 commented 2 weeks ago

I couldn't build LLVM on Windows. The version of GCC is 11.2.0.

GCC 11.2.0 is the latest version currently available through choco. LLVM 17.0.1 before commit 81ce7fb738142361afba119f1f531cf6ffddc6d1 can be built successfully.

[1/3077] Building CXX object lib/Support/CMakeFiles/LLVMSupport.dir/raw_socket_stream.cpp.obj
FAILED: lib/Support/CMakeFiles/LLVMSupport.dir/raw_socket_stream.cpp.obj
C:\ProgramData\chocolatey\bin\c++.exe -DGTEST_HAS_RTTI=0 -D_FILE_OFFSET_BITS=64 -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -IC:/tinygo/tinygo/llvm-build/lib/Support -IC:/tinygo/tinygo/llvm-project/llvm/lib/Suppor
t -IC:/tinygo/tinygo/llvm-build/include -IC:/tinygo/tinygo/llvm-project/llvm/include -Wa,-mbig-obj -Werror=date-time -fno-lifetime-dse -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedanti
c -Wno-long-long -Wimplicit-fallthrough -Wno-uninitialized -Wno-nonnull -Wno-class-memaccess -Wno-redundant-move -Wno-pessimizing-move -Wno-noexcept-type -Wdelete-non-virtual-dtor -Wsuggest-override -Wno-comment -Wno-misleading-indentation
 -Wctad-maybe-unsupported -ffunction-sections -fdata-sections  -O2 -DNDEBUG -std=c++17  -fno-exceptions -funwind-tables -fno-rtti -MD -MT lib/Support/CMakeFiles/LLVMSupport.dir/raw_socket_stream.cpp.obj -MF lib\Support\CMakeFiles\LLVMSuppo
rt.dir\raw_socket_stream.cpp.obj.d -o lib/Support/CMakeFiles/LLVMSupport.dir/raw_socket_stream.cpp.obj -c C:/tinygo/tinygo/llvm-project/llvm/lib/Support/raw_socket_stream.cpp
C:/tinygo/tinygo/llvm-project/llvm/lib/Support/raw_socket_stream.cpp:27:10: fatal error: afunix.h: No such file or directory
   27 | #include <afunix.h>
      |          ^~~~~~~~~~
compilation terminated.
sago35 commented 2 weeks ago

I was able to successfully build with GCC 13.2.0 installed using the command scoop install gcc. I plan to create a PR for the tinygo-site later.

$ gcc --version
gcc.exe (GCC) 13.2.0
Copyright (C) 2023 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.