update(haskell) (#869)

* update(haskell)

* add PIC for x86-64

* ChatGPT says this will work

* so annoying

* maybe this

* let's goooo
This commit is contained in:
Jacob Heider 2023-04-09 19:02:10 -04:00 committed by GitHub
parent e36f971356
commit e2f503c0d4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -4,6 +4,7 @@ distributable:
strip-components: 1
versions:
- 9.4.4
- 9.2.4
#TODO
# github: ghc/ghc/tags
@ -64,14 +65,20 @@ build:
rm -r $HOME/.cabal/bin
fi
cabal update
cabal install alex happy
export PATH="$HOME/.cabal/bin:$PATH"
GHC="$HOME/.ghcup/bin/ghc"
# We need PIC on linux-x86_64 (it's already on the other
# platforms). This does that.
# https://www.hobson.space/posts/haskell-foreign-library/
sed -i.bak \
's/\((OSLinux, ArchAArch64) -> \[Opt_PIC, Opt_ExternalDynamicRefs\]\)/\1\n (OSLinux, ArchX86_64) -> \[Opt_PIC, Opt_ExternalDynamicRefs\]/' \
compiler/GHC/Driver/Session.hs
rm compiler/GHC/Driver/Session.hs.bak
./configure $ARGS
hadrian/build -j --docs=none --prefix="{{prefix}}" install
hadrian/build $HADRIAN_ARGS install
for shim in $(find "{{prefix}}/bin" -type f); do
sed -i.bak -e 's_="{{prefix}}_="$(dirname $(dirname $0))_' $shim
@ -84,18 +91,25 @@ build:
BOOTSTRAP_HASKELL_NONINTERACTIVE: 1
BOOTSTRAP_HASKELL_ADJUST_BASHRC: 0
BOOTSTRAP_HASKELL_GHC_VERSION: ${{version}}
CONF_CC_OPTS_STAGE0: $LDFLAGS
CONF_CC_OPTS_STAGE1: $LDFLAGS
CONF_CC_OPTS_STAGE2: $LDFLAGS
CONF_CC_OPTS_STAGE0: $CFLAGS
CONF_CC_OPTS_STAGE1: $CFLAGS
CONF_CC_OPTS_STAGE2: $CFLAGS
CONF_GCC_LINKER_OPTS_STAGE0: $LDFLAGS
CONF_GCC_LINKER_OPTS_STAGE1: $LDFLAGS
CONF_GCC_LINKER_OPTS_STAGE2: $LDFLAGS
# ChatGPT
GHC_OPTIONS: -fPIC
ARGS:
- --prefix={{prefix}}
- --disable-numa
- --with-curses-includes={{deps.invisible-island.net/ncurses.prefix}}/include/ncursesw
- --with-intree-gmp
- --with-system-libffi
HADRIAN_ARGS:
- -j
- --docs=none
- --flavour=release
- --prefix="{{prefix}}"
linux:
C_INCLUDE_PATH: ${{deps.invisible-island.net/ncurses.prefix}}/include/ncursesw
# ^^ yep telling `./configure` about it just aint enough