Hi Everyone,
I noticed the Makefile has a line (
http://github.com/weidai11/cryptopp/blob/master/GNUmakefile#L146):
CXXFLAGS += -Wa,--divide # allow use of "/" operator |
endif
That is a GNU Assembler option. It seems that block has not been executed in some time, including 5.6.2 and earlier:
$ git checkout CRYPTOPP_5_6_2
$ make -j 2
g++ -DNDEBUG -g -O2 -pipe -c cryptlib
...
My question is, should this be fixed?
A quick testing pass on modern GCC, ancient GCC and non-GNU systems shows the fix is rather easy:
$ cat GNUmakefile.diff
diff --git a/GNUmakefile b/GNUmakefile
index 8ddef45..2d5e355 100755
--- a/GNUmakefile
+++ b/GNUmakefile
@@ -82,6 +82,7 @@ GCC48_OR_LATER := $(shell $(CXX) -v 2>&1 | $(EGREP) -i -c "gcc version (4\.[8-9]
GCC49_OR_LATER := $(shell $(CXX) -v 2>&1 | $(EGREP) -i -c "gcc version (4\.9|[5-9]\.)")
ICC111_OR_LATER := $(shell $(CXX) --version 2>&1 | $(EGREP) -c "\(ICC\) ([2-9][0-9]|1[2-9]|11\.[1-9])")
+IS_GAS := $(shell $(CXX) -xc -c /dev/null -Wa,-v -o/dev/null 2>&1 | $(EGREP) -c "GNU assembler")
GAS210_OR_LATER := $(shell $(CXX) -xc -c /dev/null -Wa,-v -o/dev/null 2>&1 | $(
...
+# Allow use of "/" operator for GNU Assembler
+ifeq ($(IS_GAS),1)
+CXXFLAGS += -Wa,--divide
endif