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

Building sgx-lkl under codeql fails. #34

Open
matt-gretton-dann opened this issue Jun 15, 2020 · 0 comments
Open

Building sgx-lkl under codeql fails. #34

matt-gretton-dann opened this issue Jun 15, 2020 · 0 comments
Assignees
Labels

Comments

@matt-gretton-dann
Copy link

@matt-gretton-dann matt-gretton-dann commented Jun 15, 2020

This is based on the following LGTM ticket: https://discuss.lgtm.com/t/error-loading-shared-library-ld-linux-x86-64-so-2-no-such-file-or-directory-needed-by-opt-dist-tools-lib64trace-so/2944/4

Build sgx-lkl as follows:

sudo apt-get install make gcc g++ bc python xutils-dev bison flex libgcrypt20-dev libjson-c-dev automake autopoint autoconf pkgconf libtool libcurl4-openssl-dev libprotobuf-dev libprotobuf-c-dev protobuf-compiler protobuf-c-compiler libssl-dev
git clone https://github.com/lsds/sgx-lkl.git
cd sgx-lkl
git submodule init
git submodule update --recursive
 ~/codeql-releases/codeql-2.2.2/codeql/codeql database create /tmp/db-sgx-lkl -l cpp -c "make"

After a while the build fails:

[2020-06-15 11:15:28] [build] checking for C compiler default output file name... a.out
[2020-06-15 11:15:28] [build-err] configure: error: in `/home/mgretton/git-repos/sgx-lkl/third_party/popt':
[2020-06-15 11:15:28] [build-err] configure: error: cannot run C compiled programs.
[2020-06-15 11:15:28] [build-err] If you meant to cross compile, use `--host'.
[2020-06-15 11:15:28] [build-err] See `config.log' for more details.
[2020-06-15 11:15:28] [build-err] make[1]: *** [Makefile:74: /home/mgretton/git-repos/sgx-lkl/build/cryptsetup/lib/libpopt.a] Error 1
[2020-06-15 11:15:28] [build-err] make[1]: unlink: /home/mgretton/git-repos/sgx-lkl/third_party/popt: Is a directory
[2020-06-15 11:15:28] [build] checking whether the C compiler works... rm /home/mgretton/git-repos/sgx-lkl/third_party/popt
[2020-06-15 11:15:28] [build] make[1]: Leaving directory '/home/mgretton/git-repos/sgx-lkl/third_party'
[2020-06-15 11:15:28] [build-err] make: *** [Makefile:41: /home/mgretton/git-repos/sgx-lkl/build/cryptsetup/lib/libcryptsetup.a] Error 2
[2020-06-15 11:15:28] [ERROR] Spawned process exited abnormally (code 2; tried to run: [/home/mgretton/codeql-releases/codeql-2.2.2/codeql/tools/linux64/preload_tracer, make])
A fatal error occurred: Exit status 2 from command: [make]

Looking in the appropriate config.log (third_party/popt/config.log) has the following error message:

configure:3186: checking for C compiler default output file name
configure:3208: /home/mgretton/git-repos/sgx-lkl/build/host-musl/bin/musl-gcc  -O3 -fPIC -Wl,--dynamic-linker=/home/mgretton/git-repos/sgx-lkl/build/host-musl/lib/libc.so   conftest.c  >&5
configure:3212: $? = 0
configure:3250: result: a.out
configure:3269: checking whether the C compiler works
configure:3279: ./a.out
Error loading shared library ld-linux-x86-64.so.2: No such file or directory (needed by /home/mgretton/codeql-releases/codeql-2.2.2/codeql/tools/linux64/lib64trace.so)
Error relocating /home/mgretton/codeql-releases/codeql-2.2.2/codeql/tools/linux64/lib64trace.so: __strdup: symbol not found
Error relocating /home/mgretton/codeql-releases/codeql-2.2.2/codeql/tools/linux64/lib64trace.so: __libc_dlopen_mode: symbol not found
Error relocating /home/mgretton/codeql-releases/codeql-2.2.2/codeql/tools/linux64/lib64trace.so: __libc_dlsym: symbol not found
Error relocating /home/mgretton/codeql-releases/codeql-2.2.2/codeql/tools/linux64/lib64trace.so: _dl_argv: symbol not found
configure:3283: $? = 127
configure:3290: error: in `/home/mgretton/git-repos/sgx-lkl/third_party/popt':
configure:3294: error: cannot run C compiled programs.
If you meant to cross compile, use `--host'.
See `config.log' for more details.

This is a tracing issue.

@matt-gretton-dann matt-gretton-dann self-assigned this Jun 15, 2020
@adityasharad adityasharad added the CLI label Jul 31, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.