tokenrove/granderl

Won't compile with older gcc versions (-std=gnu11 not supported)

akontsevoy opened this issue · 2 comments

Granderl seems to be using an exotic -std=gnu11 option in preamble.sh, which is not recognized as valid on older platforms (e.g. when trying to compile with gcc 4.4 on Debian 6 or CentOS 6). However, Erlang itself (even currently maintained versions such as 22.3) builds from source fine on such platforms.

The -std= switch appears unnecessary for default implementation mode (it compiles fine on the tested platform when the switch is removed), and it is only required for rdrand. Therefore the switch should not be used by default and its support should be checked in test_for_rdrand() function in preamble.sh (if not supported, the rdrand implementation should be disabled).

Sorry for the delay in responding. I spent a while thinking about this; normally, if I was going to do further work on this project, I'd keep gnu11 (or at least c11) as it's likely that I'll use aspects in new code. But it's probably not necessary here aside from for the builtin intrinsic; in fact, it doesn't seem to be needed even for that (we use inline asm, not a _builtin, for rdrand).

How early a gcc would you like to support? Does 4.4 support -std=gnu99? If so, I'll gladly change it to that.

Thanks -- yes, 4.4, 4.3, and even 3.x would all support -std=gnu99. In fact, it is used by Erlang OTP builds themselves, so it's probably safe to use in any Erlang projects.