SRI-CSL/gllvm

C compiler doesn't works

tiedaoxiaotubie opened this issue · 4 comments

Hi, I tried to setup and test gllvm follow the readme, but failed to pass the test with pkg-config.
I am using Ubuntu18.04 server, all the required dependencies are installed I think, but I don't know the test always fail, the following are the output log:

User@51195d5b6a9c:~/pkg-config-0.26$ CC=gclang ./configure
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... no
checking for mawk... mawk
checking whether make sets $(MAKE)... yes
checking whether to enable maintainer-specific portions of Makefiles... no
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking how to print strings... printf
checking for style of include used by make... GNU
checking for gcc... gclang
checking whether the C compiler works... no
configure: error: in `/home/pkg-config-0.26':
configure: error: C compiler cannot create executables
See `config.log' for more details

Take a look at what gsanity-check tells you.

Also take a close look at the config.log

Every thing goes well if I use wllvm to compile, I think gllvm and wllvm share the same dependency, but it's weird gllvm can't work.
Here is the gsanity-check output, which I think is no problem:

User@51195d5b6a9c:~/go/bin$ ./gsanity-check

Version info: gsanity-check version 1.2.7
Released: August 4 2020

Logging output to standard error.
Logging level not set, using default of WARNING.

Logging configuration uses the environment variables:

        WLLVM_OUTPUT_LEVEL and WLLVM_OUTPUT_FILE.

Happily sitting atop "linux" operating system.

The C compiler clang is:

        clang version 10.0.0

The CXX compiler clang++ is:

        clang version 10.0.0

The bitcode linker llvm-link is:

        LLVM version 10.0.0

The bitcode archiver llvm-ar is:

        LLVM version 10.0.0

Not using a bitcode store.

I think the problem may be pointed out in the config.log, but I don't know how to fix it:

configure:3064: checking for gcc
configure:3091: result: gclang
configure:3320: checking for C compiler version
configure:3329: gclang --version >&5
./configure: line 3331: gclang: command not found
configure:3340: $? = 127
configure:3329: gclang -v >&5
./configure: line 3331: gclang: command not found

When we use wllvm, we should type export LLVM_COMPILER=clang before running CC=wllvm ./configure, so is there any similar setting for gllvm?

OK, I have fixed the problem, user should add the $GOPATH/bin to the PATH, or gclang will not be found