riscvarchive / riscv-fesvr

RISC-V Frontend Server
Other
62 stars 83 forks source link

Building on OS X fails #18

Closed ghost closed 7 years ago

ghost commented 8 years ago

Have macOS Sierra 10.12.1 official. On priv-1.9 branch of riscv-tools Getting this error:

../fesvr/tsi.cc:34:7: error: use of undeclared identifier 'abort'
      abort();
      ^

Output for gcc -v:

Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/usr/include/c++/4.2.1
Apple LLVM version 8.0.0 (clang-800.0.38)
Target: x86_64-apple-darwin16.1.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
ghost commented 8 years ago

Using CC=gcc-4.8 CXX=g++-4.8 ./build-rv32ima.sh:

Starting RISC-V Toolchain build process

Removing existing riscv-fesvr/build directory
Configuring project riscv-fesvr
configure: error: in `/Volumes/Macintosh HD/Users/alex_mech/work/riscv/riscv-tools/riscv-fesvr/build':
configure: error: C compiler cannot create executables
See `config.log' for more details

Using simple ./build-rv32ima.sh grants this error

colinschmidt commented 8 years ago

These issues seem separate.

For the first issue what if you add

#include <stdlib.h>

to the top of tsi.cc?

ghost commented 8 years ago

@colinschmidt I've just clarified issue conditions. When adding #include <stdlib.h>, the error in riscv-isa-sim following:

Building project riscv-isa-sim
clang: error: treating 'c-header' input as 'c++-header' when in C++ mode, this behavior is deprecated

So fesvr error is gone, can we continue in this thread or I shall open another in isa-sim project?