Skip to content

gmp doesn't build correctly when cross-compiling with clang

The commit in #8497 (closed) added this to libraries/integer-gmp/gmp/ghc.mk:

CLANG = $(findstring clang, $(shell $(CC_STAGE1) --version))

ifeq "$(CLANG)" "clang"
CCX = $(CLANG)
else
CCX = $(CC_STAGE1)
endif

and does the build with $(CCX) rather than $(CC_STAGE1).

However, when cross-compiling, $(CC_STAGE1) could be a clang cross-compiler, but then it's certainly not right to use $(CLANG) = clang, as that is presumably not a cross-compiler.

I don't understand why the issue in #8497 (closed) arose in the first place, so it's unclear to me how to proceed here.

Trac metadata
Trac field Value
Version 8.1
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Build System
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information