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

Add build documentation #110

Closed
surajssd opened this issue Feb 21, 2023 · 2 comments · Fixed by #157
Closed

Add build documentation #110

surajssd opened this issue Feb 21, 2023 · 2 comments · Fixed by #157

Comments

@surajssd
Copy link
Contributor

surajssd commented Feb 21, 2023

For me to build sevctl on Ubuntu I had to install the following OS packages:

sudo apt install -y pkg-config libssl-dev asciidoctor

And then I could build using the following command:

cargo build
@surajssd
Copy link
Contributor Author

surajssd commented Mar 2, 2023

Normally built binary has dependency on the following system libs:

$ ldd target/release/sevctl
        linux-vdso.so.1 (0x00007ffed59d1000)
        libssl.so.3 => /lib/x86_64-linux-gnu/libssl.so.3 (0x00007f5d6d8c1000)
        libcrypto.so.3 => /lib/x86_64-linux-gnu/libcrypto.so.3 (0x00007f5d6d47e000)
        libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f5d6d45e000)
        libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f5d6d236000)
        /lib64/ld-linux-x86-64.so.2 (0x00007f5d6dbea000)

To be able to do static build I had to also install the musl-tools on top of the existing packages:

sudo apt install -y pkg-config libssl-dev asciidoctor musl-tools
rustup target add x86_64-unknown-linux-musl
cargo build --release --target x86_64-unknown-linux-musl

And using the changes in PR #112, I can now do static build:

$ ldd target/x86_64-unknown-linux-musl/release/sevctl
        statically linked

@tylerfanelli
Copy link
Member

@surajssd Apologies for delay, addressed in #157

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

Successfully merging a pull request may close this issue.

2 participants