thepowersgang / mrustc

Alternative rust compiler (re-implementation)
MIT License
2.18k stars 109 forks source link

make -C run_rustc fails with error: ‘numeric_limits’ is not a member of ‘std’ #293

Closed jwaldmann closed 1 year ago

jwaldmann commented 1 year ago

as suggested by this repo's README, I am doing (on x86_64 with Fedora 37, also with Debian 5.10)

make -f minicargo.mk  
make -C run_rustc

first command succeeds, but second fails with

...
make[4]: Entering directory '/home/waldmann/software/compiler/mrustc/rustc-1.29.0-src/build'
[  0%] Building CXX object lib/Demangle/CMakeFiles/LLVMDemangle.dir/ItaniumDemangle.cpp.o   
/home/waldmann/software/compiler/mrustc/rustc-1.29.0-src/src/llvm/lib/Demangle/ItaniumDemang
le.cpp:176:36: error: ‘numeric_limits’ is not a member of ‘std’                             
  176 |   unsigned CurrentPackIndex = std::numeric_limits<unsigned>::max();                 
      |                                    ^~~~~~~~~~~~~~                     
/home/waldmann/software/compiler/mrustc/rustc-1.29.0-src/src/llvm/lib/Demangle/ItaniumDemang
le.cpp:176:51: error: expected primary-expression before ‘unsigned’                         
  176 |   unsigned CurrentPackIndex = std::numeric_limits<unsigned>::max();                 
      |                                                   ^~~~~~~~                
...

the build seems to work (at leasts on my Fedora machine) when I prefix both commands with

env RUSTC_VERSION=1.54.0 MRUSTC_TARGET_VER=1.54 OUTDIR_SUF=-1.54.0
thepowersgang commented 1 year ago

That error is from the building of LLVM (a dependency of rustc) By default, rustc 1.29 is built, so the fact that it works in 1.54 means that there's a problem with that older version LLVM and your system (curious that it's having troubles finding a standard C++ header)