ego icon indicating copy to clipboard operation
ego copied to clipboard

can not work with go build static

Open zhp1254 opened this issue 1 year ago • 1 comments

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]

zhp1254 avatar Sep 09 '24 10:09 zhp1254

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

thomasten avatar Sep 11 '24 11:09 thomasten