[LLVMdev] spec tests + PWD=

Chris Lattner clattner at apple.com
Tue Sep 1 13:08:51 PDT 2009


On Sep 1, 2009, at 12:39 PM, David Goodwin wrote:

> I did make that change to support the following code in  
> ToolRunner.cpp. I found that if I did not explicitly set PWD when  
> invoking bugpoint, then it would not be in the environment. I'm not  
> sure why PWD is not being inherited... perhaps some make  
> weirdness... or bash??? and I don't know how it ever worked before  
> my change.
>
>    // Full path to the binary. We need to cd to the exec directory  
> because
>    // there is a dylib there that the exec expects to find in the CWD
>    char* env_pwd = getenv("PWD");
>    std::string Exec = "cd ";
>    Exec += env_pwd;
>
>
> Perhaps I shouldn't have added it to Makefile.spec? At the least it  
> seems like it should probably move to the beginning of the command,  
> like this:
>
> 	PWD=$(CURDIR)  $(SPEC_SANDBOX) bugpoint-$(RUN_TYPE) $@ $ 
> (REF_IN_DIR) \
> 	    $(LBUGPOINT) -llc-safe ../$*.noopt-llvm.bc -std-compile-opts $ 
> (OPTPASSES) \

I changed Makefile.spec to use 'env' at Shantonu's suggestion and it  
works for me. :)

Thanks David,

-Chris




More information about the llvm-dev mailing list