IoTone / TheShellProject

The Shell Project aims to build a viable general purpose blockchain written in Dlang, with attributes of security, ease of deployment, clear specification, ease of use for DAPPs, and multiple implementation interop
1 stars 1 forks source link

keccak-tiny doesn't build properly on Linux with GCC 5.x #66

Closed truedat101 closed 3 years ago

truedat101 commented 5 years ago

Apparently gcc 5.x will fail:

external/keccak-tiny-singlefile$ ./do.sh
cc1: warning: unrecognized gcc debugging option: y
cc1: warning: unrecognized gcc debugging option: n
cc1: warning: unrecognized gcc debugging option: m
cc1: warning: unrecognized gcc debugging option: i
cc1: warning: unrecognized gcc debugging option: c
keccak-tiny.c:117:19: warning: always_inline function might not be inlinable [-Wattributes]  static inline int hash(uint8_t* out, size_t outlen,
                   ^
keccak-tiny.c:102:12: warning: always_inline function might not be inlinable [-Wattributes]  mkapply_sd(setout, dst[i] = src[i])  // setout
            ^
keccak-tiny.c:95:22: note: in definition of macro ‘mkapply_sd’
   static inline void NAME(const uint8_t* src,                        \
                      ^
keccak-tiny.c:101:12: warning: always_inline function might not be inlinable [-Wattributes]  mkapply_ds(xorin, dst[i] ^= src[i])  // xorin
            ^
keccak-tiny.c:89:22: note: in definition of macro ‘mkapply_ds’
   static inline void NAME(uint8_t* dst,                              \
                      ^
keccak-tiny.c:47:20: warning: always_inline function might not be inlinable [-Wattributes]
 static inline void keccakf(void* state) {
                    ^
/usr/bin/ld: /tmp/ccC8BlpZ.o: relocation R_X86_64_32S against `.rodata' can not be used when making a shared object; recompile with -fPIC
/tmp/ccC8BlpZ.o: error adding symbols: Bad value
collect2: error: ld returned 1 exit status
cc1: warning: unrecognized gcc debugging option: y
cc1: warning: unrecognized gcc debugging option: n
cc1: warning: unrecognized gcc debugging option: m
cc1: warning: unrecognized gcc debugging option: i
cc1: warning: unrecognized gcc debugging option: c
/usr/bin/ld: /tmp/cc4AGxcn.o: relocation R_X86_64_32S against `.rodata' can not be used when making a shared object; recompile with -fPIC
/tmp/cc4AGxcn.o: error adding symbols: Bad value
collect2: error: ld returned 1 exit status
truedat101 commented 5 years ago

Inline function behavior is definitely different between certain GCC versions.

truedat101 commented 5 years ago

The question is, how important is this? Arguably, not very if clang works.

pedroalvesbatista commented 5 years ago

Yeah, I was doing some searches, the inline is implemented some how some way different. I think we can keep open as we will testing in other OS's and keep track of what's going on. We can plan a "testing bulk" to map some issues that may appear in some compilers implementations

truedat101 commented 5 years ago

Clang didn't work. I think it's the particular tiny-keccak fork. I'll try the fix I posted up last night. If that one works I'll use that.

truedat101 commented 5 years ago

fixed by 5f4f5730717f0038c7a650748f316c25c4c7a358