[GHC] #8783: make ghc-pwd-bindist script /bin/sh compatible for Solaris

GHC ghc-devs at haskell.org
Thu Apr 3 15:51:04 UTC 2014


#8783: make ghc-pwd-bindist script /bin/sh compatible for Solaris
-------------------------------------+-------------------------------------
        Reporter:  maeder            |            Owner:
            Type:  bug               |           Status:  closed
        Priority:  normal            |        Milestone:  7.8.1
       Component:  Build System      |          Version:  7.8.1-rc2
      Resolution:  fixed             |         Keywords:
Operating System:  Solaris           |     Architecture:  Unknown/Multiple
 Type of failure:  Building GHC      |       Difficulty:  Easy (less than 1
  failed                             |  hour)
       Test Case:                    |       Blocked By:
        Blocking:                    |  Related Tickets:
-------------------------------------+-------------------------------------

Comment (by maeder):

 This patch causes a failure for integer-gmp when building integer-gmp
 under solaris namely the one that I wrongly attributed to #8764

 {{{
 /bin/sh ../libtool --tag=CC   --mode=compile /opt/csw/bin/gcc -std=gnu99
 -DHAVE_CONFIG_H -I. -I.. -D__GMP_WITHIN_GMP -I.. -DOPERATION_`echo
 fib_table | sed 's/_$//'`    -m32 -O2 -pedantic -fomit-frame-pointer
 -mtune=i386 -march=i386 -c -o fib_table.lo fib_table.c
 ../libtool: bad substitution
 }}}

 This is in fact caused by the file libraries/integer-gmp/gmp/ghc.mk that
 calls ./configure in gmpbuild. However, ./configure is called using
 $(SHELL) that is /bin/bash for me and then detects that this is a good
 shell and sets SHELL (in gmpbuild/config.status) to /bin/sh!

 The following patch fixes the problem by replacing $(SHELL) with /bin/sh:

 {{{
 --- ghc.mk~     Fri Feb 28 12:34:54 2014
 +++ ghc.mk      Thu Apr  3 11:25:13 2014
 @@ -146,7 +146,7 @@
             PATH=`pwd`:$$PATH; \
             export PATH; \
             cd gmpbuild && \
 -           CC=$(CCX) NM=$(NM) AR=$(AR_STAGE1) $(SHELL) ./configure \
 +           CC=$(CCX) NM=$(NM) AR=$(AR_STAGE1) /bin/sh ./configure \
                   --enable-shared=no \
                   --host=$(HOSTPLATFORM) --build=$(BUILDPLATFORM)
         $(MAKE) -C libraries/integer-gmp/gmp/gmpbuild MAKEFLAGS=
 }}}

 After this patch my gmpbuild/config.status contains correctly

 {{{
 S["SHELL"]="/bin/bash"
 }}}

 and the failure above is gone.

 (I've not tried yet to omit the shell entirely since ./configure should be
 executable as is.)

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/8783#comment:19>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list