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

can not work with go build static #285

Open
zhp1254 opened this issue Sep 9, 2024 · 1 comment
Open

can not work with go build static #285

zhp1254 opened this issue Sep 9, 2024 · 1 comment

Comments

@zhp1254
Copy link

zhp1254 commented Sep 9, 2024

Issue description

can not work with go build static

To reproduce

Steps to reproduce the behavior:

  1. ego-go build -trimpath --ldflags '--extldflags "-static -fpic"'
  2. ego sign
  3. got an error

Expected behavior

we want ego sign support ego-go build static

Additional info

uname -a
6.5.0-1024-azure #25~22.04.1-Ubuntu SMP Mon Jun 17 18:38:57 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux

error info :
ERROR: /opt/ego/bin/ego-oesign ERROR: oe_sgx_build_enclave(): result=OE_FAILURE (0x1)
2024-09-09T10:00:16+0000.322210Z [(H)ERROR] tid(0x7aac2cdbf0c0) | ELF image is not a PIE or shared object (oe_result_t=OE_INVALID_IMAGE) [/ertbuild/3rdparty/openenclave/openenclave-src/host/sgx/loadelf.c:_read_elf_header:95]
2024-09-09T10:00:16+0000.322227Z [(H)ERROR] tid(0x7aac2cdbf0c0) | :OE_INVALID_IMAGE [/ertbuild/3rdparty/openenclave/openenclave-src/host/sgx/loadelf.c:_load_elf_image:467]
2024-09-09T10:00:16+0000.322230Z [(H)ERROR] tid(0x7aac2cdbf0c0) | :OE_INVALID_IMAGE [/ertbuild/3rdparty/openenclave/openenclave-src/host/sgx/loadelf.c:_load_dependent_image:1500]
2024-09-09T10:00:16+0000.322232Z [(H)ERROR] tid(0x7aac2cdbf0c0) | :OE_INVALID_IMAGE [/ertbuild/3rdparty/openenclave/openenclave-src/host/sgx/loadelf.c:oe_load_elf_enclave_image:1546]
2024-09-09T10:00:16+0000.322234Z [(H)ERROR] tid(0x7aac2cdbf0c0) | :OE_INVALID_IMAGE [/ertbuild/3rdparty/openenclave/openenclave-src/host/sgx/load.c:oe_load_enclave_image:66]
2024-09-09T10:00:16+0000.322237Z [(H)ERROR] tid(0x7aac2cdbf0c0) | :OE_FAILURE [/ertbuild/3rdparty/openenclave/openenclave-src/host/sgx/create.c:oe_sgx_build_enclave:996]

@thomasten
Copy link
Member

libc must be dynamically linked. All other libs must be statically linked. See https://github.com/edgelesssys/ego/tree/master/samples/cgo

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