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

Bad libusgx_switchless.a in SGX 2.11 prebuilt SDK package #595

Closed
dingelish opened this issue Sep 10, 2020 · 8 comments
Closed

Bad libusgx_switchless.a in SGX 2.11 prebuilt SDK package #595

dingelish opened this issue Sep 10, 2020 · 8 comments

Comments

@dingelish
Copy link
Contributor

/usr/bin/ld: /opt/sgxsdk/lib64/libsgx_uswitchless.a(sl_uswitchless_untrusted.o): unable to initialize decompress status for section .debug_info
/usr/bin/ld: /opt/sgxsdk/lib64/libsgx_uswitchless.a(sl_uswitchless_untrusted.o): unable to initialize decompress status for section .debug_info
/opt/sgxsdk/lib64/libsgx_uswitchless.a: member /opt/sgxsdk/lib64/libsgx_uswitchless.a(sl_uswitchless_untrusted.o) in archive is not an object
collect2: error: ld returned 1 exit status

to reproduce, please docker build the following Dockerfiles. they all result in the above error message

Ubuntu 18.04:

FROM ubuntu:18.04
RUN apt update && apt install -y build-essential curl
RUN cd /root && \
    curl -o sdk.bin https://download.01.org/intel-sgx/sgx-linux/2.11/distro/ubuntu18.04-server/sgx_linux_x64_sdk_2.11.100.2.bin && \
    chmod +x sdk.bin && \
    echo -e 'no\n/opt' | ./sdk.bin

RUN bash -c "source /opt/sgxsdk/environment && cd /opt/sgxsdk/SampleCode/Switchless && make"

Centos 8

FROM centos:8

RUN dnf group install -y 'Development Tools'

RUN cd /root && \
    curl -o sdk.bin https://download.01.org/intel-sgx/sgx-linux/2.11/distro/centos8.1-server/sgx_linux_x64_sdk_2.11.100.2.bin && \
    chmod +x sdk.bin && \
    echo -e 'no\n/opt' | ./sdk.bin

RUN bash -c "source /opt/sgxsdk/environment && cd /opt/sgxsdk/SampleCode/Switchless && make"
@lzha101
Copy link
Contributor

lzha101 commented Sep 10, 2020

Generally, this error should be related to different binutils used. The SDK installer on download.01.org are built with the mitigation LVI binutils. Could you try to configure the LVI binutils in the Docker as well?

@dingelish
Copy link
Contributor Author

interesting. i can confirm use the prebuilt bintuils can fix this issue. one more question: does this means that switchless feature requires the latest binutils?

@lzha101
Copy link
Contributor

lzha101 commented Sep 10, 2020

I don't think so. It should depend on what binutils version is used to build the SDK. If you build your own SGX SDK installer with the system default binutils, suppose you can build the sample successfully with the system binutils as well.
To avoid the binutils incompatible errors, it is better to keep the same binutils to build the SDK and the final binaries.

@dingelish
Copy link
Contributor Author

understand. could you please confirm that the prebuilt static libraries in Intel SDK are compiled using the toolchain provided in as.ld.objdump.gold.r2.tar.gz ? thanks!

@lzha101
Copy link
Contributor

lzha101 commented Sep 10, 2020

Yes. All the SDK installers for 2.11 release provided in download.01.org are built with the prebuilt toolchain as.ld.objdump.gold.r2.tar.gz. And the prebuilt static libraries on that release are also built with that toolchain.

@dingelish
Copy link
Contributor Author

awesome! and could we have the exact source code (git hash is good)and configurations (like the argument of ./configure) for that copy of toolchain? thanks!

@lzha101
Copy link
Contributor

lzha101 commented Sep 10, 2020

The toolchain is based on https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=a09f656b267b9a684f038fba7cadfe98e2f18892, built with default configurations.

@dingelish
Copy link
Contributor Author

@lzha101 thanks so much for your help!

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