I'm trying to build Coreutils with LLVM, using klee docker based on step 3 on https://klee.github.io/tutorials/testing-coreutils/.
But I found a problem on running:
CC=wllvm ../configure --disable-nls CFLAGS="-g -O1 -Xclang -disable-llvm-passes -D__NO_STRING_INLINES -D_FORTIFY_SOURCE=0 -U__OPTIMIZE__"
it says
checking for gcc... wllvm
checking whether the C compiler works... no
configure: error: in `/home/klee/coreutils-8.0/obj2':
configure: error: C compiler cannot create executables
See `config.log' for more details.
before running the code above I have install wllvm before through
pip install --upgrade wllvm
and already installed
Requirement already up-to-date: wllvm in /home/klee/.local/lib/python2.7/site-packages
But although I already installed it, it still produces error, and I don't know how to handle it,
I have use the solution provided in C compiler cannot create executables during build of Coreutils with LLVM, but nothing different,
after that I follow instruction in https://github.com/travitch/whole-program-llvm/issues/68, said to use clang rather than wllvm. The program was running after that, but error again on execute
find . -executable -type f | xargs -I '{}' extract-bc '{}'
that say
xargs: extract-bc: No such file or directory
After searching any source, I still can't solve it.
this is part of the config.log when wllvm not found
../configure: line 4240: wllvm: command not found
configure:4249: $? = 127
configure:4269: checking whether the C compiler works
configure:4291: wllvm -g -O1 -Xclang -disable-llvm-passes -D__NO_STRING_INLINES -D_FORTIFY_SOURCE=0 -U__OPTIMIZE__ conftest.c >&5
../configure: line 4293: wllvm: command not found
configure:4295: $? = 127
configure:4333: result: no
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "GNU coreutils"
| #define PACKAGE_TARNAME "coreutils"
| #define PACKAGE_VERSION "8.0"
| #define PACKAGE_STRING "GNU coreutils 8.0"
| #define PACKAGE_BUGREPORT "bug-coreutils#gnu.org"
| #define PACKAGE_URL "http://www.gnu.org/software/coreutils/"
| #define PACKAGE "coreutils"
| #define VERSION "8.0"
| /* end confdefs.h. */
|
| int
| main ()
| {
|
| ;
| return 0;
| }
configure:4338: error: in `/home/klee/coreutils-8.0/obj-llvm':
configure:4342: error: C compiler cannot create executables
See `config.log' for more details.
It seems that wllvm is simply not in your $PATH. You can check that with which; for example for me it is:
$ which wllvm
/home/#####/.local/bin/wllvm
Related: How to add a directory to the PATH?
Related
I am cross compiling on a Intel based Linux Ubuntu system under Windows 10 for an Intel i486 under QNX 6.5.0. One of the libraries is snappy, v.1.0.4. Copied i486-pc-nto-qnx6.5.0* tools (gcc, g++, ld, etc.) from the QNX system to the /usr/local/bin in Ubuntu. Then configure as ./configure --build=x86_64-pc-linux-gnu --host=i486-pc-nto-qnx6.5.0. Run make and get an error: C compiler cannot create executables when cross-compiling.
In config.log:
configure:2985: checking whether make sets $(MAKE)
configure:3007: result: yes
configure:3117: checking build system type
configure:3131: result: x86_64-pc-linux-gnu
configure:3151: checking host system type
configure:3164: result: i486-pc-nto-qnx6.5.0
configure:3196: checking for style of include used by make
configure:3224: result: GNU
configure:3254: checking for i486-pc-nto-qnx6.5.0-gcc
configure:3270: found /usr/local/bin/i486-pc-nto-qnx6.5.0-gcc
configure:3281: result: i486-pc-nto-qnx6.5.0-gcc
configure:3550: checking for C compiler version
configure:3559: i486-pc-nto-qnx6.5.0-gcc --version >&5
configure:3572: $? = 1
configure:3592: checking whether the C compiler works
configure:3614: i486-pc-nto-qnx6.5.0-gcc conftest.c >&5
configure:3618: $? = 1
configure:3656: result: no
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "snappy"
| #define PACKAGE_TARNAME "snappy"
| #define PACKAGE_VERSION "1.0.4"
| #define PACKAGE_STRING "snappy 1.0.4"
| #define PACKAGE_BUGREPORT ""
| #define PACKAGE_URL ""
| #define PACKAGE "snappy"
| #define VERSION "1.0.4"
| /* end confdefs.h. */
|
| int
| main ()
| {
|
| ;
| return 0;
| }
configure:3661: error: in `/home/kirill/eleveldb/c_src/snappy-1.0.4':
configure:3665: error: C compiler cannot create executables
See `config.log' for more details.
I've started using Conan to manage a cross platform project with a fairly large dependency tree (diving into the deep end, I know). Several components in the project use autotools for their configuration step, and I'm struggling to get some of those scripts to detect it properly. Conan itself offers little guidance on the subject, so I'm certain there's some setting I'm missing.
To test out my cross environment, I'm compiling libcurl/7.69.1 from MacOS to iOS armv8 with the following settings (using --build to make everything locally):
[settings]
arch=armv8
arch_build=x86_64
build_type=Release
compiler=apple-clang
compiler.libcxx=libc++
compiler.version=11.0
os=iOS
os.version=9.0
os_build=Macos
[options]
darwin_ssl=False
with_openssl=True
[build_requires]
*: darwin-toolchain/1.0.6#theodelrieu/stable
libcurl/*: libtool/2.4.6
[env]
When it gets to the libcurl configure script, it fails with the following message (relevant libtool output included):
libtool/2.4.6: Package '150f8c59c5beb38d3bb23c3061298c1594abbc17' created
libtool/2.4.6: Created package revision 33a24903417fc5c368223b78e4ffc784
libtool/2.4.6: Appending PATH env: /Users/my_home_dir/.conan/data/libtool/2.4.6/_/_/package/150f8c59c5beb38d3bb23c3061298c1594abbc17/bin
libtool/2.4.6: Setting LIBTOOLIZE env to /Users/my_home_dir/.conan/data/libtool/2.4.6/_/_/package/150f8c59c5beb38d3bb23c3061298c1594abbc17/bin/libtoolize
libtool/2.4.6: Appending ACLOCAL_PATH env: /Users/my_home_dir/.conan/data/libtool/2.4.6/_/_/package/150f8c59c5beb38d3bb23c3061298c1594abbc17/bin/share/aclocal
libtool/2.4.6: Setting LIBTOOL_PREFIX environment variable to /Users/my_home_dir/.conan/data/libtool/2.4.6/_/_/package/150f8c59c5beb38d3bb23c3061298c1594abbc17
libtool/2.4.6: Setting LIBTOOL_DATADIR environment variable to /Users/my_home_dir/.conan/data/libtool/2.4.6/_/_/package/150f8c59c5beb38d3bb23c3061298c1594abbc17/bin/share
libtool/2.4.6: Setting LIBTOOL_PKGAUXDIR environment variable to /Users/my_home_dir/.conan/data/libtool/2.4.6/_/_/package/150f8c59c5beb38d3bb23c3061298c1594abbc17/bin/share/libtool/build-aux
libtool/2.4.6: Setting LIBTOOL_PKGLTDLDIR environment variable to /Users/my_home_dir/.conan/data/libtool/2.4.6/_/_/package/150f8c59c5beb38d3bb23c3061298c1594abbc17/bin/share/libtool
libtool/2.4.6: Setting LIBTOOL_ACLOCALDIR environment variable to /Users/my_home_dir/.conan/data/libtool/2.4.6/_/_/package/150f8c59c5beb38d3bb23c3061298c1594abbc17/bin/share/aclocal
libtool/2.4.6: Appending AUTOMAKE_CONAN_INCLUDES environment variable: /Users/my_home_dir/.conan/data/libtool/2.4.6/_/_/package/150f8c59c5beb38d3bb23c3061298c1594abbc17/bin/share/aclocal
...
libcurl/7.69.1: Calling:
> ./configure '--without-libidn2' '--without-librtmp' '--without-libmetalink' '--without-libpsl' '--without-brotli' '--with-ssl=/Users/my_home_dir/.conan/data/openssl/1.1.1g/Qrypt/dev/package/6721cd435aa597f77b709c9f18a506df5f25cc78' '--without-libssh2' '--without-nghttp2' '--with-zlib=/Users/my_home_dir/.conan/data/zlib/1.2.11/_/_/package/6721cd435aa597f77b709c9f18a506df5f25cc78/lib' '--disable-shared' '--enable-static' '--disable-ldap' '--enable-threaded-resolver' '--disable-verbose' '--prefix=/Users/my_home_dir/.conan/data/libcurl/7.69.1/_/_/package/614a97ea5d3c0afeea50678bf1a8f62835834ff0' '--bindir=${prefix}/bin' '--sbindir=${prefix}/bin' '--libexecdir=${prefix}/bin' '--libdir=${prefix}/lib' '--includedir=${prefix}/include' '--oldincludedir=${prefix}/include' '--datarootdir=${prefix}/share' --build=x86_64-apple-darwin --host=aarch64-apple-darwin
checking whether to enable maintainer-specific portions of Makefiles... no
checking whether make supports nested variables... yes
checking whether to enable debug build options... no
checking whether to enable compiler optimizer... (assumed) yes
checking whether to enable strict compiler warnings... no
checking whether to enable compiler warnings as errors... no
checking whether to enable curl debug memory tracking... no
checking whether to enable hiding of library internal symbols... yes
checking whether to enable c-ares for DNS lookups... no
checking whether to disable dependency on -lrt... (assumed no)
checking whether to enable ESNI support... no
checking for path separator... :
checking for sed... /usr/bin/sed
checking for grep... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for a BSD-compatible install... /usr/bin/install -c
checking for aarch64-apple-darwin-gcc... /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang
checking whether the C compiler works... no
configure: error: in `/Users/my_home_dir/.conan/data/libcurl/7.69.1/_/_/build/614a97ea5d3c0afeea50678bf1a8f62835834ff0/source_subfolder':
configure: error: C compiler cannot create executables
See `config.log' for more details
And the libcurl config.log reads:
configure:4319: checking whether the C compiler works
configure:4341: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.6.sdk -arch arm64 -mios-version-min=9.0 -isysroot/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.6.sdk -mios-version-min=9.0 -fembed-bitcode -arch arm64 -DHAVE_SOCKET -DHAVE_FCNTL_O_NONBLOCK -isysroot/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.6.sdk -mios-version-min=9.0 -fembed-bitcode -arch arm64 -arch arm64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.6.sdk -L/Users/my_home_dir/.conan/data/openssl/1.1.1g/Qrypt/dev/package/6721cd435aa597f77b709c9f18a506df5f25cc78/lib conftest.c -lltdl -lssl -lcrypto -lz >&5
ld: library not found for -lltdl
clang: error: linker command failed with exit code 1 (use -v to see invocation)
configure:4345: $? = 1
configure:4383: result: no
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "curl"
| #define PACKAGE_TARNAME "curl"
| #define PACKAGE_VERSION "-"
| #define PACKAGE_STRING "curl -"
| #define PACKAGE_BUGREPORT "a suitable curl mailing list: https://curl.haxx.se/mail/"
| #define PACKAGE_URL ""
| /* end confdefs.h. */
|
| int main (void)
| {
|
| ;
| return 0;
| }
My main question: Searching around, this error seems to indicate libtool cannot be found for my target platform. Am I setting up my autotools correctly within my profile? I copied it from the linux settings within lib curl's recipe; are there any other settings needed to get it set up for a MacOS build agent?
Some other misc questions to help me understand what I'm doing:
When I declare a build_requirement, those components get compiled for the build architecture, correct? (MacOS/x86_64 in this case)
The libcurl recipe on conan-center-index does not set libtool as a build_requirement for MacOS, but configure still tries to call it. Is that an oversight within the recipe or is there supposed to be another way to compile libcurl on MacOS machines?
I noticed the libtool package appends LIBTOOL_PREFIX/bin to the PATH, but libltdl.a resides in LIBTOOL_PREFIX/lib, does the curl configure script find libltdl.a some other way?
So far I'm unable to build QuantLib 1.5 on os x 10.9.5 following the official instructions http://quantlib.org/install/macosx.shtml
./configure --enable-static --with-boost-include=/opt/local/include/ \
--with-boost-lib=/opt/local/lib/ --prefix=/opt/local/ \
CXXFLAGS="-stlib=libstdc++ -mmacosx-version-min=10.6" \
LDFLAGS="-stlib=libstdc++ -mmacosx-version-min=10.6"
configure: WARNING: you should use --build, --host, --target
configure: WARNING: invalid host type:
configure: WARNING: you should use --build, --host, --target
configure: WARNING: invalid host type:
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... config/install-sh -c -d
checking for gawk... no
checking for mawk... no
checking for nawk... no
checking for awk... awk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking for gawk... (cached) awk
checking for -gcc... no
checking for gcc... gcc
checking whether the C compiler works... no
configure: error: in `~/Downloads/qlib/QuantLib-1.5':
configure: error: C compiler cannot create executables
See `config.log' for more details
$ make && sudo make install
make: *** No targets specified and no makefile found. Stop.
So what may be wrong? And how can I fix it?
Here is an excerpt from Config log:
## ----------- ##
## Core tests. ##
## ----------- ##
configure:2416: checking for a BSD-compatible install
configure:2484: result: /usr/bin/install -c
configure:2495: checking whether build environment is sane
configure:2550: result: yes
configure:2701: checking for a thread-safe mkdir -p
configure:2740: result: config/install-sh -c -d
configure:2747: checking for gawk
configure:2777: result: no
configure:2747: checking for mawk
configure:2777: result: no
configure:2747: checking for nawk
configure:2777: result: no
configure:2747: checking for awk
configure:2763: found /usr/bin/awk
configure:2774: result: awk
configure:2785: checking whether make sets $(MAKE)
configure:2807: result: yes
configure:2836: checking whether make supports nested variables
configure:2853: result: yes
configure:2987: checking for gawk
configure:3014: result: awk
configure:3069: checking for -gcc
configure:3099: result: no
configure:3109: checking for gcc
configure:3125: found /usr/bin/gcc
configure:3136: result: gcc
configure:3365: checking for C compiler version
configure:3374: gcc --version >&5
Apple LLVM version 6.0 (clang-600.0.56) (based on LLVM 3.5svn)
Target: x86_64-apple-darwin13.4.0
Thread model: posix
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
configure:3385: $? = 0
configure:3374: gcc -v >&5
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 6.0 (clang-600.0.56) (based on LLVM 3.5svn)
Target: x86_64-apple-darwin13.4.0
Thread model: posix
configure:3385: $? = 0
configure:3374: gcc -V >&5
clang: error: argument to '-V' is missing (expected 1 value)
clang: error: no input files
configure:3385: $? = 1
configure:3374: gcc -qversion >&5
clang: error: unknown argument: '-qversion'
clang: error: no input files
configure:3385: $? = 1
configure:3405: checking whether the C compiler works
configure:3427: gcc -I/opt/local/include -stlib=libstdc++ -mmacosx-version-min=10.6 -L/opt/local/lib conftest.c >&5
clang: error: unknown argument: '-stlib=libstdc++'
configure:3431: $? = 1
configure:3469: result: no
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "QuantLib"
| #define PACKAGE_TARNAME "QuantLib"
| #define PACKAGE_VERSION "1.5"
| #define PACKAGE_STRING "QuantLib 1.5"
| #define PACKAGE_BUGREPORT "quantlib-dev#lists.sourceforge.net"
| #define PACKAGE_URL ""
| #define PACKAGE "QuantLib"
| #define VERSION "1.5"
| /* end confdefs.h. */
|
| int
| main ()
| {
|
| ;
| return 0;
| }
configure:3474: error: in `~/Downloads/qlib/QuantLib-1.5':
configure:3476: error: C compiler cannot create executables
See `config.log' for more details
If you have this problem
checking whether the C compiler works... no
It means that you have not installed the command line tools properly for your Xcode. Please download and install it.
Your clue is in the config.log: "clang: error: unknown argument: '-stlib=libstdc++' "
change -stlib to -stdlib, it should compile and build.
See this related answer on how to configure gcc. The reason is, like me, you probably installed GCC with homebrew or something, therefore not using Apple's default.
I installed GCC 5.3 with homebrew.
Worked for me by just taking out -stdlib option all together.
I am trying to install System C 2.3.0 to Cygwin (1.7.25). I am running the ../configure in the objdir (as many tutorials online state) but i get the following error:
checking for gcc... gcc
checking for C compiler default output file name...
configure: error: C compiler cannot create executables
See `config.log' for more details.
/*Snippet of config.log /
gcc version 4.8.2 (GCC)
configure:2851: $? = 0
configure:2858: gcc -V >&5
gcc: error: unrecognized command line option '-V'
gcc: fatal error: no input files
compilation terminated.
configure:2861: $? = 1
configure:2884: checking for C compiler default output file name
configure:2911: gcc conftest.c >&5
gcc: error: spawn: No such file or directory
configure:2914: $? = 1
configure:2952: result:
configure: failed program was:
| / confdefs.h. */
| #define PACKAGE_NAME "SystemC"
| #define PACKAGE_TARNAME "systemc"
| #define PACKAGE_VERSION "2.3.0"
| #define PACKAGE_STRING "SystemC 2.3.0"
| #define PACKAGE_BUGREPORT ""
| /* end confdefs.h. */
Any help would be appreciated!
I figured out my issue. In my .cshrc file, I had modified the $path variable and actually removed gcc and g++. Thus, gcc and g++ both were not working and so the configure script was failing when it tried to run them.
I fixed up my cshrc and the $path variable now has /usr/bin/gcc /usr/bin/g++ and the configure script runs successfully.
was running the ./configure script for OTP14B03 on OpenSolaris and got the following output
Ignoring the --cache-file argument since it can cause the system to be erroneously configured
Disabling caching
checking build system type... i386-pc-solaris2.11
checking host system type... i386-pc-solaris2.11
checking for gcc... gcc
checking for C compiler default output file name... configure: error: C compiler cannot create executables
See `config.log' for more details.
I have gcc4 installed, in the $PATH, installed libgcc installed, but still getting this error. searching the web got me to try adding /usr/ccs/bin in order to locate the ld.so file (probably got to do with C++ Compiler or linker). Could some one help me out
EDIT:
Config/log file contains this:
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
configure:2041: $? = 0
configure:2043: gcc -v &5
Reading specs from /usr/local/lib/gcc/i386-pc-solaris2.10/3.4.6/specs
Configured with: ../configure --with-as=/usr/ccs/bin/as --with-ld=/usr/ccs/bin/ld --enable-shared --enable-languages=c,c++,f77
Thread model: posix
gcc version 3.4.6
configure:2046: $? = 0
configure:2048: gcc -V &5
gcc: `-V' option must have argument
configure:2051: $? = 1
configure:2074: checking for C compiler default output file name
configure:2077: gcc conftest.c >&5
ld: fatal: file values-Xa.o: open failed: No such file or directory
ld: fatal: file processing errors. No output written to a.out
collect2: ld returned 1 exit status
configure:2080: $? = 1
configure: failed program was:
| /* confdefs.h. */
|
| #define PACKAGE_NAME ""
| #define PACKAGE_TARNAME ""
| #define PACKAGE_VERSION ""
| #define PACKAGE_STRING ""
| #define PACKAGE_BUGREPORT ""
| /* end confdefs.h. */
|
| int
| main ()
| {
|
| ;
| return 0;
| }
configure:2118: error: C compiler cannot create executables
See `config.log' for more details.
Your linker cannot find the values-Xa.o object file.
According to this FAQ, it either means your system is missing a package required by the compiler, or that the required packages are installed but your default library path does not reflect it.
As a quick check, you can try adding /usr/ccs/lib to the library path:
./configure LDFLAGS="-L/usr/ccs/lib"