Commit 2534164a authored by Edward Z. Yang's avatar Edward Z. Yang Committed by Ben Gamari

Move gmp/config.mk.in to config.mk.in, fix #14972

Here's how the rube goldberg machine triggered the old bug:

1. If you have a file gmp/config.mk.in, then Cabal will
create a generated file in $DIST/build/gmp/config.mk

2. When you attempt to load inplace integer-gmp via GHCi, it will
ask gcc (aka clang on OS X) for the file name of 'gmp', with
base directory set to $DIST/build

3. There is a folder named 'gmp', and so this folder is returned
as the 'library' for gmp

4. GHCi loadArchive chokes to death trying to open a library
that is actually a folder

This patch solves the problem by breaking the chain at (1): if we
don't put config.mk in a folder named gmp, NO PROBLEM.
Signed-off-by: default avatarEdward Z. Yang <ezyang@fb.com>

Test Plan: validate

Reviewers: angerman, hvr, bgamari

Reviewed By: angerman

Subscribers: erikd, thomie, carter

GHC Trac Issues: #14972

Differential Revision: https://phabricator.haskell.org/D4552
parent 81e7980a
# NB: This file lives in the top-level integer-gmp folder, and not in
# the gmp subfolder, because of #14972, where we MUST NOT create a
# folder named 'gmp' in dist/build/
ifeq "$(HaveLibGmp)" ""
HaveLibGmp = @HaveLibGmp@
endif
......
......@@ -106,7 +106,7 @@ AC_SUBST(GhcGmpVerMj)
AC_SUBST(GhcGmpVerMi)
AC_SUBST(GhcGmpVerPl)
AC_CONFIG_FILES([integer-gmp.buildinfo gmp/config.mk include/HsIntegerGmp.h])
AC_CONFIG_FILES([integer-gmp.buildinfo config.mk include/HsIntegerGmp.h])
dnl--------------------------------------------------------------------
dnl * Generate output files
......
......@@ -27,7 +27,6 @@ endif
ifneq "$(NO_CLEAN_GMP)" "YES"
$(eval $(call clean-target,gmp,,\
libraries/integer-gmp/include/ghc-gmp.h \
libraries/integer-gmp/gmp/config.mk \
libraries/integer-gmp/gmp/libgmp.a \
libraries/integer-gmp/gmp/gmp.h \
libraries/integer-gmp/gmp/gmpbuild \
......@@ -53,10 +52,10 @@ endif
ifeq "$(phase)" "final"
ifneq "$(CLEANING)" "YES"
# Hack. The file gmp/config.mk doesn't exist yet after running ./configure in
# Hack. The file config.mk doesn't exist yet after running ./configure in
# the toplevel (ghc) directory. To let some toplevel make commands such as
# sdist go through, right after ./configure, don't consider this an error.
-include libraries/integer-gmp/dist-install/build/gmp/config.mk
-include libraries/integer-gmp/dist-install/build/config.mk
endif
gmp_CC_OPTS += $(addprefix -I,$(GMP_INCLUDE_DIRS))
......
......@@ -26,16 +26,19 @@ extra-source-files:
config.sub
configure
configure.ac
gmp/config.mk.in
config.mk.in
include/HsIntegerGmp.h.in
install-sh
integer-gmp.buildinfo.in
-- NB: Many of these tmp files no longer ever actually get plopped in
-- the root directory post Cabal 2.4, thanks to a change that causes
-- autoconf/configure to get run inside the dist directory.
extra-tmp-files:
autom4te.cache
config.log
config.status
gmp/config.mk
config.mk
integer-gmp.buildinfo
include/HsIntegerGmp.h
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment