You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@teaclave.apache.org by samsondav <no...@github.com> on 2020/02/26 00:31:29 UTC

[apache/incubator-teaclave-sgx-sdk] [In compiler-rt] warning: "__ARM_EABI__" is not defined, evaluates to 0 [-Wundef] (#209)

During compilation I get this error.

```
$ make -C /opt/rust-sgx-sdk/compiler-rt/
make: Entering directory '/opt/rust-sgx-sdk/compiler-rt'
cc -c -Wjump-misses-init -Wstrict-prototypes -Wunsuffixed-float-constants -fstack-protector -O2   -UDEBUG -DNDEBUG -Wall -Wextra -Winit-self -Wpointer-arith -Wreturn-type -Waddress -Wsequence-point -Wformat-security -Wmissing-include-dirs -Wfloat-equal -Wundef -Wshadow -Wcast-align -Wconversion -Wredundant-decls -DITT_ARCH_IA64 -ffreestanding -nostdinc -fvisibility=hidden -fpie -O2  -I../common/inc/ muloti4.c -o muloti4.o
In file included from muloti4.c:15:0:
int_lib.h:25:5: warning: "__ARM_EABI__" is not defined, evaluates to 0 [-Wundef]
 #if __ARM_EABI__
     ^~~~~~~~~~~~
In file included from int_lib.h:51:0,
                 from muloti4.c:15:
int_types.h: In function 'make_ti':
int_types.h:100:15: warning: conversion to 'du_int {aka long long unsigned int}' from 'di_int {aka long long int}' may change the sign of the result [-Wsign-conversion]
     r.s.low = l;
               ^
ar rcsD libcompiler-rt-patch.a muloti4.o
make: Leaving directory '/opt/rust-sgx-sdk/compiler-rt'
```

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/apache/incubator-teaclave-sgx-sdk/issues/209

Re: [apache/incubator-teaclave-sgx-sdk] [In compiler-rt] warning: "__ARM_EABI__" is not defined, evaluates to 0 [-Wundef] (#209)

Posted by Yu Ding <no...@github.com>.
Please see my fix below. I removed RT_PATCH.

```diff
diff --git a/core/sgx/Makefile b/core/sgx/Makefile
index c8b134017..d6ca530d9 100644
--- a/core/sgx/Makefile
+++ b/core/sgx/Makefile
@@ -41,7 +41,7 @@ INCLUDES := -I$(SGX_SDK)/include -I$(SGX_RUST_SDK)/edl
 CC_FLAGS := $(SGX_COMMON_CFLAGS) -fPIC -Wno-attributes $(INCLUDES)
 
 ENCLAVE_RS_INCLUDE := -I$(SGX_RUST_SDK)/common/inc -I$(SGX_RUST_SDK)/edl -I$(SGX_SDK)/include -I$(SGX_SDK)/include/tlibc -I$(SGX_SDK)/include/stlport -I$(SGX_SDK)/include/epid
-ENCLAVE_RS_LIBS := -L./target/$(ENVIRONMENT) -lcompiler-rt-patch -lenclave
+ENCLAVE_RS_LIBS := -L./target/$(ENVIRONMENT) -lenclave
 ENCLAVE_RS_FLAGS := $(SGX_COMMON_CFLAGS) -nostdinc -fvisibility=hidden -fpie -fstack-protector $(ENCLAVE_RS_INCLUDE)
 ENCLAVE_RS_LD_FLAGS := $(SGX_COMMON_CFLAGS) -Wl,--no-undefined -nostdlib -nodefaultlibs -nostartfiles -L$(SGX_LIBRARY_PATH) \
 	-Wl,--whole-archive -l$(TRTS_LIB) -l$(SERVICE_LIB) -Wl,--no-whole-archive \
@@ -66,8 +66,6 @@ LIBADAPTERS := target/$(ENVIRONMENT)/libadapters.so
 UNTRUSTED_EDL_FILES := target/$(ENVIRONMENT)/enclave_u.c target/$(ENVIRONMENT)/enclave_u.h
 TRUSTED_EDL_FILES := target/$(ENVIRONMENT)/enclave_t.c target/$(ENVIRONMENT)/enclave_t.h
 
-RT_PATCH := target/$(ENVIRONMENT)/libcompiler-rt-patch.a
-
 #
 # Targets ---------------
 #
@@ -96,11 +94,6 @@ $(LIBADAPTERS): libadapters/Cargo.toml $(wildcard libadapters/src/*.rs) $(ENCLAV
 
 # Enclave ---------------
 
-$(RT_PATCH):
-	@printf -- '\nBuilding \e[1;36m$@\e[0m\n\n'
-	$(MAKE) -C $(SGX_RUST_SDK)/compiler-rt/
-	cp $(SGX_RUST_SDK)/compiler-rt/libcompiler-rt-patch.a $@
-
 $(ENCLAVE): enclave/Cargo.toml $(wildcard enclave/src/*.rs)
 	@printf -- '\nBuilding \e[1;36m$@\e[0m\n\n'
 	SGX_SIMULATION=$(SGX_SIMULATION) ENVIRONMENT=$(ENVIRONMENT) SGX_SDK=$(SGX_SDK) $(CARGO) build $(RUST_FLAGS) --manifest-path $<
@@ -109,7 +102,7 @@ $(TRUSTED_EDL_FILES): $(SGX_EDGER8R) enclave/enclave.edl
 	@printf -- '\nBuilding \e[1;36m$@\e[0m\n\n'
 	$(SGX_EDGER8R) --trusted enclave/enclave.edl --search-path $(SGX_SDK)/include --search-path $(SGX_RUST_SDK)/edl --trusted-dir $(@D)
 
-target/$(ENVIRONMENT)/enclave_t.o: $(TRUSTED_EDL_FILES) $(ENCLAVE) $(RT_PATCH)
+target/$(ENVIRONMENT)/enclave_t.o: $(TRUSTED_EDL_FILES) $(ENCLAVE)
 	@printf -- '\nBuilding \e[1;36m$@\e[0m\n\n'
 	$(CC) $(ENCLAVE_RS_FLAGS) -c $< -o $@
```

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/apache/incubator-teaclave-sgx-sdk/issues/209#issuecomment-591186945

Re: [apache/incubator-teaclave-sgx-sdk] [In compiler-rt] warning: "__ARM_EABI__" is not defined, evaluates to 0 [-Wundef] (#209)

Posted by Yu Ding <no...@github.com>.
Hi there, thanks for the report. Could I have your system configuration? e.g. which distribution/docker image you are working on?

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/apache/incubator-teaclave-sgx-sdk/issues/209#issuecomment-591171836

Re: [apache/incubator-teaclave-sgx-sdk] [In compiler-rt] warning: "__ARM_EABI__" is not defined, evaluates to 0 [-Wundef] (#209)

Posted by Yu Ding <no...@github.com>.
So you need to get rid of these warnings, right?

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/apache/incubator-teaclave-sgx-sdk/issues/209#issuecomment-591184462

Re: [apache/incubator-teaclave-sgx-sdk] [In compiler-rt] warning: "__ARM_EABI__" is not defined, evaluates to 0 [-Wundef] (#209)

Posted by samsondav <no...@github.com>.
@dingelish Yes, that's right!

Our builder is here: https://github.com/smartcontractkit/builder

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/apache/incubator-teaclave-sgx-sdk/issues/209#issuecomment-591175390

Re: [apache/incubator-teaclave-sgx-sdk] [In compiler-rt] warning: "__ARM_EABI__" is not defined, evaluates to 0 [-Wundef] (#209)

Posted by samsondav <no...@github.com>.
Yes, this would be ideal :)

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/apache/incubator-teaclave-sgx-sdk/issues/209#issuecomment-591447729

Re: [apache/incubator-teaclave-sgx-sdk] [In compiler-rt] warning: "__ARM_EABI__" is not defined, evaluates to 0 [-Wundef] (#209)

Posted by Yu Ding <no...@github.com>.
Closed #209.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/apache/incubator-teaclave-sgx-sdk/issues/209#event-3181394215

Re: [apache/incubator-teaclave-sgx-sdk] [In compiler-rt] warning: "__ARM_EABI__" is not defined, evaluates to 0 [-Wundef] (#209)

Posted by Yu Ding <no...@github.com>.
https://github.com/smartcontractkit/chainlink/blob/fa690eaa0c91368de14cf3b989b3b9e62c05f08b/core/chainlink-sgx.Dockerfile

this one, right?

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/apache/incubator-teaclave-sgx-sdk/issues/209#issuecomment-591172909

Re: [apache/incubator-teaclave-sgx-sdk] [In compiler-rt] warning: "__ARM_EABI__" is not defined, evaluates to 0 [-Wundef] (#209)

Posted by samsondav <no...@github.com>.
It's open source, see for yourself :)

https://github.com/smartcontractkit/chainlink/pull/2375

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/apache/incubator-teaclave-sgx-sdk/issues/209#issuecomment-591172017