SRI-CSL / whole-program-llvm

A toolkit for building whole-program LLVM bitcode files
MIT License
73 stars 11 forks source link

enable more flexible options for compiler selection #6

Closed dddejan closed 9 years ago

dddejan commented 9 years ago

In order to use different versions in non-default locations.

For example, replace: cstring == 'clang' with cstring.endswith('clang'):

in driver/utils.py:614

ianamason commented 9 years ago

paths are already allowable, rtfm.

I think what you want would better be described as "some leeway in the name of the compiler" right?

clang-3.4 clang-2.7

right? The cc hack was just a quick fix, yes?

dddejan commented 9 years ago

right.

dddejan commented 9 years ago

actually, I'd like to use it as described above too, and im not sure rtfm applies.

dejan@raven:~/workspace/souper/yices2$ export LLVM_COMPILER_PATH=/home/dejan/workspace/souper/third_party/llvm/Release/bin
dejan@raven:~/workspace/souper/yices2$ export LLVM_COMPILER=/home/dejan/workspace/souper/third_party/llvm/Release/bin/clang
dejan@raven:~/workspace/souper/yices2$ /home/dejan/workspace/whole-program-llvm/wllvm
CRITICAL:LLVM_COMPILER=/home/dejan/workspace/souper/third_party/llvm/Release/bin/clang : Invalid compiler type
Traceback (most recent call last):
  File "/home/dejan/workspace/whole-program-llvm/wllvm", line 18, in <module>
    builder = getBuilder(cmd, False)
  File "/home/dejan/workspace/whole-program-llvm/driver/utils.py", line 625, in getBuilder
    raise Exception(errorMsg)
Exception: LLVM_COMPILER=/home/dejan/workspace/souper/third_party/llvm/Release/bin/clang : Invalid compiler type
ianamason commented 9 years ago

I'm currently hacking in LLVM_CC_NAME and LLVM_CXX_NAME support.

So the use case would be:

export LLVM_COMPILER=clang                                   #this is the type of compiler
export LLVM_COMPILER_PATH=/usr/local/llvm/bin
export LLVM_CC_NAME=clang-3.6
export LLVM_CXX_NAME=clang++-3.6

Make sense?

ianamason commented 9 years ago

Try that. 6c965f71a3d8ae76a4af9

Let me know if it works for you.

ianamason commented 9 years ago

Great another happy user ...

dddejan commented 9 years ago

im quite happy

ianamason commented 9 years ago

excellent glad to increase euphoria rather than entropy.