LoupVaillant / Monocypher

An easy to use, easy to deploy crypto library
https://monocypher.org
Other
614 stars 80 forks source link

Solaris 10 portability issues #120

Closed fscoto closed 5 years ago

fscoto commented 5 years ago

Solaris 10 ships with gcc 3.4.3 from 2004. When attempting to build Monocypher as packaged, it will fail as follows:

$ gmake
gcc -std=gnu99 -pedantic -Wall -Wextra -O3 -march=native -I src -I src/optional -fPIC -c -o lib/monocypher.o src/monocypher.c
src/monocypher.c:1: error: bad value (native) for -march= switch
src/monocypher.c:1: error: bad value (native) for -mtune= switch
gmake: *** [lib/monocypher.o] Error 1

This, however, can be worked around by setting CFLAGS on the command line and building like so: gmake CFLAGS=-O3. I don't consider this an issue. The tests pass on 32-bit x86 Solaris 10.

However, the building procedure then fails to create the libmonocypher.so symlink due to usage of $(), which does not exist in /bin/sh on Solaris 10. A fix would be to use backticks instead of $() for subshells.

Solaris 10 is still supported until January 2021, so at least about one and a half years remain until it hits EOL.

LoupVaillant commented 5 years ago

I confirm that $CC and $CFLAGS are default values for compiler and compiler flags. (There is no __$LD_FLAGS__, because Monocypher is a library, we don't link it.) Obscure platforms that don't support those default flags are supposed to change them.

That said, the README doesn't say so clearly. I'll add a paragraph in the installation section.