Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compilation failure when using ikos-scan to analyze a whole project #300

Open
fouzhe opened this issue Nov 17, 2024 · 2 comments
Open

Compilation failure when using ikos-scan to analyze a whole project #300

fouzhe opened this issue Nov 17, 2024 · 2 comments

Comments

@fouzhe
Copy link

fouzhe commented Nov 17, 2024

I encountered an issue while analyzing the YARA project using IKOS. Here are the steps I followed:

  1. Build YARA:
git clone https://github.com/VirusTotal/yara.git
./bootstrap.sh
./configure --enable-debug --enable-dex --enable-dotnet --without-crypto
make clean
make -j

The build completed successfully.

  1. Analyze with ikos-scan:
ikos-scan ./bootstrap.sh
ikos-scan ./configure --enable-debug --enable-dex --enable-dotnet --without-crypto
ikos-scan make clean
ikos-scan make -j V=1 

However, I received this error during analysis:


libtool: link: ranlib .libs/libyara.a

libtool: link: ( cd ".libs" && rm -f "libyara.la" && ln -s "../libyara.la" "libyara.la" )

/bin/bash ./libtool ... # command truncated for brevity

clang: error: no such file or directory: './.libs/libyara.so'

make[[1]: *** [Makefile::1734] Error 1

make[1]: Leaving directory '/root/IKOS-test/yara'

make: *** [Makefile:1189] Error 2

Did I miss any steps? Any assistance would be appreciated.

@Vivraan
Copy link

Vivraan commented Nov 18, 2024

You will need to build a shared object/library (.so). How does it work in YARA/configure?

@fouzhe
Copy link
Author

fouzhe commented Nov 18, 2024

@Vivraan
Hi, the configure seems normally and the output is as follows:

# ikos-scan ./configure --enable-debug --enable-dex --enable-dotnet --without-crypto
checking whether make supports nested variables... yes
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a race-free mkdir -p... /usr/bin/mkdir -p
checking for gawk... no
checking for mawk... mawk
checking whether make sets $(MAKE)... yes
checking whether make supports the include directive... yes (GNU style)
checking for gcc... ikos-scan-cc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether the compiler supports GNU C... yes
checking whether ikos-scan-cc accepts -g... yes
checking for ikos-scan-cc option to enable C11 features... none needed
checking whether ikos-scan-cc understands -c and -o together... yes
checking dependency style of ikos-scan-cc... gcc3
checking for ar... ar
checking the archiver (ar) interface... ar
checking for gcc... (cached) ikos-scan-cc
checking whether the compiler supports GNU C... (cached) yes
checking whether ikos-scan-cc accepts -g... (cached) yes
checking for ikos-scan-cc option to enable C11 features... (cached) none needed
checking whether ikos-scan-cc understands -c and -o together... (cached) yes
checking dependency style of ikos-scan-cc... (cached) gcc3
checking for flex... flex
checking for lex output file root... lex.yy
checking for lex library... none needed
checking for library containing yywrap... no
checking whether yytext is a pointer... yes
checking for bison... bison -y
checking for inline... inline
checking for stdio.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for strings.h... yes
checking for sys/stat.h... yes
checking for sys/types.h... yes
checking for unistd.h... yes
checking whether byte ordering is bigendian... no
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking how to print strings... printf
checking for a sed that does not truncate output... /usr/bin/sed
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for fgrep... /usr/bin/grep -F
checking for ld used by ikos-scan-cc... ikos-scan-cc
checking if the linker (ikos-scan-cc) is GNU ld... no
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 1572864
checking how to convert x86_64-pc-linux-gnu file names to x86_64-pc-linux-gnu format... func_convert_file_noop
checking how to convert x86_64-pc-linux-gnu file names to toolchain format... func_convert_file_noop
checking for ikos-scan-cc option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for dlltool... no
checking how to associate runtime and link libraries... printf %s\n
checking for archiver @FILE support... @
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /usr/bin/nm -B output from ikos-scan-cc object... ok
checking for sysroot... no
checking for a working dd... /usr/bin/dd
checking how to truncate binary pipes... /usr/bin/dd bs=4096 count=1
checking for mt... no
checking if : is a manifest tool... no
checking for dlfcn.h... yes
checking for objdir... .libs
checking if ikos-scan-cc supports -fno-rtti -fno-exceptions... yes
checking for ikos-scan-cc option to produce PIC... -fPIC -DPIC
checking if ikos-scan-cc PIC flag -fPIC -DPIC works... yes
checking if ikos-scan-cc static flag -static works... yes
checking if ikos-scan-cc supports -c -o file.o... yes
checking if ikos-scan-cc supports -c -o file.o... (cached) yes
checking whether the ikos-scan-cc linker (ikos-scan-cc -m elf_x86_64) supports shared libraries... yes
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... unsupported
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
checking for the pthreads library -lpthreads... no
checking whether pthreads work without any flags... yes
checking for joinable pthread attribute... PTHREAD_CREATE_JOINABLE
checking if more special flags are required for pthreads... no
checking whether to check for GCC pthread/shared inconsistencies... yes
checking whether -pthread is sufficient with -shared... yes
checking for isnan in -lm... yes
checking for log2 in -lm... yes
checking for strlcpy... no
checking for strlcat... no
checking for memmem... yes
checking for timegm... yes
checking for _mkgmtime... no
checking for clock_gettime... yes
checking for stdbool.h... yes
checking for pkg-config... /usr/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
configure: WARNING:
*****************************************************************
  The dotnet module is enabled by default now. No need to specify
  --enable-dotnet. To disable this module please use
  --disable-dotnet.
*****************************************************************

configure: WARNING:

*****************************************************************
  Could not find OpenSSL library. Some features in "pe" module
  have been disabled. If you want to enable all features please
  install OpenSSL and run this script again.
*****************************************************************

checking for Microsoft Crypto API... checking for wincrypt.h... no
checking for MacOSX Common Crypto API... checking for CommonCrypto/CommonCrypto.h... no
configure: WARNING:

*****************************************************************
  Could not find alternative APIs for hash functions. The "hash"
  module has been disabled.
*****************************************************************
            
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating yara.pc
config.status: executing depfiles commands
config.status: executing libtool commands
Nothing to analyze.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants