Coder Social home page Coder Social logo

Comments (7)

jovanbulck avatar jovanbulck commented on July 21, 2024

HI shujiecui,

This error indicates that the linker doesn't find the customly patched SGX SDK. Did you make sure to patch and install the SGX SDK? This should be automatically taken care of when you use the "install_sdk.sh" script. The Makefiles by default expect a system-wide SDK installation under /opt/intel. You can check if this is okay on your system, eg as follows:

jo@breuer:~$ objdump -D /opt/intel/sgxsdk/lib64/libsgx_urts.so | grep sgx_get_aep
0000000000000ab6 <sgx_get_aep>:

Let me know if this works for you!

from sgx-step.

shujiecui avatar shujiecui commented on July 21, 2024

Yes, I installed the driver and SDK with the scripts.
By running the above objdump command, I get: 0000000000000b86 <sgx_get_aep>:
By the way, I haven't disable C-States and SpeedStep technology in the BIOS. Does that matter?

from sgx-step.

jovanbulck avatar jovanbulck commented on July 21, 2024

Okay, so since the objdump lists the symbol, patching and installing went fine indeed. Did you make sure to source /opt/intel/sgxsdk/environment in the same terminal as were you execute the make command, so that all environment variables are properly set? Also, to be sure you're not using old objects, try doing make clean first?

Re C-States and SpeedStep: no, that's not crucial. Not needed at all if you don't do single-stepping and eg only page-table manipulations. In general speedstep may somewhat improve predictability when doing timer-based single-stepping, but I found that this is not required in practice. Current versions of sgx-step furthermore already try to fix the processor clock at runtime through the MSR interface.

from sgx-step.

shujiecui avatar shujiecui commented on July 21, 2024

yes, I did all that, but still not work

from sgx-step.

jovanbulck avatar jovanbulck commented on July 21, 2024

Without more information, I can only guess what's going wrong on your system. I suspect you may have another SGX-SDK installed earlier through apt or so that may interfere and leave global symbolic links and make that the default path will not find the patched SDK under /opt/intel/. You should check this and/or provide more details. Particularly, try finding out which dynamic library is being used by ldd and then check whether or not it has the patches. It turns out on my system I use a patched /usr/lib/libsgx_urts.so by default. You can manually override the desired library location using the LD_LIBRARY_PATH environment variable, as shown below

jo@breuer:~/sgx-step-fresh/app/aep-redirect$ ldd ./app 
	linux-vdso.so.1 (0x00007ffebeb60000)
	libsgx_urts.so => /usr/lib/libsgx_urts.so (0x00007f8330ee2000)
	libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f8330cc3000)
	libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f83308d2000)
	libsgx_enclave_common.so.1 => /usr/lib/libsgx_enclave_common.so.1 (0x00007f83306cd000)
	libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f83304c9000)
	libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f8330140000)
	libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f832ff28000)
	/lib64/ld-linux-x86-64.so.2 (0x00007f833130f000)
	libsgx_launch.so.1 => /usr/lib/libsgx_launch.so.1 (0x00007f832fcdd000)
	libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f832f93f000)
	libprotobuf.so.10 => /usr/lib/x86_64-linux-gnu/libprotobuf.so.10 (0x00007f832f4e6000)
	libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007f832f2c9000)
jo@breuer:~/sgx-step-fresh/app/aep-redirect$ nm -g /usr/lib/libsgx_urts.so | grep aep
000000000000c070 T sgx_get_aep
000000000000c090 T sgx_set_aep
jo@breuer:~/sgx-step-fresh/app/aep-redirect$ LD_LIBRARY_PATH=/opt/intel/sgxsdk/lib64/ ldd ./app 
	linux-vdso.so.1 (0x00007ffc2d69c000)
	libsgx_urts.so => /opt/intel/sgxsdk/lib64/libsgx_urts.so (0x00007fa3dce26000)
	libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007fa3dcc07000)
	libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fa3dc816000)
	/lib64/ld-linux-x86-64.so.2 (0x00007fa3dd231000)
jo@breuer:~/sgx-step-fresh/app/aep-redirect$ nm -g /opt/intel/sgxsdk/lib64/libsgx_urts.so | grep aep
0000000000000ab6 T sgx_get_aep
0000000000000acd T sgx_set_aep

from sgx-step.

shujiecui avatar shujiecui commented on July 21, 2024

Aha, you are right. LLD doesn't link to /opt../libsgx_urts.so. Instead, it links to /user/.../libsgx_urts.so, and this one doesn't have sgx_get_aep.
Thanks for your help.

from sgx-step.

jovanbulck avatar jovanbulck commented on July 21, 2024

glad it got figured out, closing this issue ^^

from sgx-step.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.