This is being tracked at https://github.com/weidai11/cryptopp/issues/11. It also intersects with a few other open issues.
There's a request to use Clang's integrated assembler when using LLVM's gear. That includes Apple's platforms, and when we do a `make CXX=clang++`. It seems reasonable to me since the user expressly asked for it when they `make CXX=clang++`. The patch below performs an initial cut-over. Its sympathetic to the way the library is setup/predicated upon GNU AS (GAS), and it provides an initial move away from GAS. I think we will need to rework it a bit once we sort out all the details. We also have to fix the ASM code in Crypto++ so Clang's assembler accepts it (there are numerous parsing issues at the moment). For those who want the clang compiler but not the clang assembler, they can `make CLANG_ASSEMBLER=0`. This is one of those areas we need to improve the patch. `CLANG_ASSEMBLER=0` avoids the code path in the makefile, but it still uses the Clang assembler. I'm trying to figure out how to reconcile the issue. Any help would be appreciated. (Also see https://stackoverflow.com/questions/11118887/how-to-switch-off-llvms-integrated-assembler, which does not appear to work reliably). Any comments or objections? ********** $ cat GNUmakefile.diff diff --git a/GNUmakefile b/GNUmakefile index 3f48cc5..a34dcbf 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -32,13 +32,25 @@ ifneq ($(CLANG_COMPILER),0) CXXFLAGS += -Wall endif +# Also see LLVM Bug 24200 (https://llvm.org/bugs/show_bug.cgi?id=24200) +CLANG_ASSEMBLER ?= $(shell $(CXX) -xc -c /dev/null -Wa,-v -o/dev/null 2>&1 | $(EGREP) -i -c "^clang") + ifeq ($(IS_X86),1) GCC42_OR_LATER = $(shell $(CXX) -v 2>&1 | $(EGREP) -i -c "^gcc version (4.[2-9]|[5-9])") ICC111_OR_LATER = $(shell $(CXX) --version 2>&1 | $(EGREP) -c "\(ICC\) ([2-9][0-9]|1[2-9]|11\.[1-9])") + +ifeq ($(CLANG_ASSEMBLER),0) +# Using system provided assembler. It may be GNU AS (GAS). GAS210_OR_LATER ?= $(shell $(CXX) -xc -c /dev/null -Wa,-v -o/dev/null 2>&1 | $(EGREP) -c "GNU assembler version (2\.[1-9][0-9]|[3-9])") GAS217_OR_LATER ?= $(shell $(CXX) -xc -c /dev/null -Wa,-v -o/dev/null 2>&1 | $(EGREP) -c "GNU assembler version (2\.1[7-9]|2\.[2-9]|[3-9])") GAS219_OR_LATER ?= $(shell $(CXX) -xc -c /dev/null -Wa,-v -o/dev/null 2>&1 | $(EGREP) -c "GNU assembler version (2\.19|2\.[2-9]|[3-9])") +else +# Using Clang integrated assembler +GAS210_OR_LATER ?= 1 +GAS217_OR_LATER ?= 1 +GAS219_OR_LATER ?= 1 +endif # Enable PIC for x86_64 targets ifneq ($(IS_X86_64),0) -- -- You received this message because you are subscribed to the "Crypto++ Users" Google Group. To unsubscribe, send an email to [email protected]. More information about Crypto++ and this group is available at http://www.cryptopp.com. --- You received this message because you are subscribed to the Google Groups "Crypto++ Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
