Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Understanding build error when adding a dependency #3540

Closed
ashic opened this issue Nov 1, 2017 · 2 comments
Closed

Understanding build error when adding a dependency #3540

ashic opened this issue Nov 1, 2017 · 2 comments
Milestone

Comments

@ashic
Copy link

ashic commented Nov 1, 2017

I'm new to stack, and am trying to get a sample app working. A new project builds and executes fine. However, if I add a dependency on scotty, I get build errors.

Steps to reproduce

Create a new project using stack

stack new auh

Add a dependency on scotty. My yaml config is as follows:

name:                auh
version:             0.1.0.0
github:              githubuser/auh
license:             BSD3
author:              Author name here
maintainer:          [email protected]
copyright:           2017 Author name here

extra-source-files:
- README.md
- ChangeLog.md

# Metadata used when publishing your package
# synopsis:
# description:
# category:            Web

dependencies:
- base >= 4.7 && < 5

library:
  source-dirs: src
  dependencies:
  - time
  - scotty

executables:
  auh-exe:
    main:                Main.hs
    source-dirs:         app
    ghc-options:
    - -threaded
    - -rtsopts
    - -with-rtsopts=-N
    dependencies:
    - auh

tests:
  auh-test:
    main:                Spec.hs
    source-dirs:         test
    ghc-options:
    - -threaded
    - -rtsopts
    - -with-rtsopts=-N
    dependencies:
    - auh

Run stack build.

Expected

The build succeeds.

Actual

The build fails with:

old-time-1.1.0.3: configure
zlib-0.6.1.2: download
network-2.6.3.2: configure
unix-compat-0.4.3.1: configure
unix-compat-0.4.3.1: build
regex-posix-0.95.2: configure
regex-posix-0.95.2: build
aeson-1.1.2.0: configure
aeson-1.1.2.0: build
zlib-0.6.1.2: configure
zlib-0.6.1.2: build
aeson-1.1.2.0: copy/register
Progress: 6/18
--  While building package zlib-0.6.1.2 using:
      /mnt/e/ashicX/.stack/setup-exe-cache/x86_64-linux-tinfo6-nopie/Cabal-simple_mPHDZzAJ_1.24.2.0_ghc-8.0.2 --builddir=.stack-work/dist/x86_64-linux-tinfo6-nopie/Cabal-1.24.2.0 build --ghc-options " -ddump-hi -ddump-to-file"
    Process exited with code: ExitFailure 1
    Logs have been written to: /mnt/e/dev/github/ashic/actually-using-haskell/src/auh/.stack-work/logs/zlib-0.6.1.2.log

    Configuring zlib-0.6.1.2...
    Building zlib-0.6.1.2...
    Preprocessing library zlib-0.6.1.2...
    /usr/bin/ld: .stack-work/dist/x86_64-linux-tinfo6-nopie/Cabal-1.24.2.0/build/Codec/Compression/Zlib/Stream_hsc_make.o: relocation R_X86_64_32 against `.rodata' can not be used when making a shared object; recompile with -fPIC
    /usr/bin/ld: final link failed: Nonrepresentable section on output
    collect2: error: ld returned 1 exit status
    linking .stack-work/dist/x86_64-linux-tinfo6-nopie/Cabal-1.24.2.0/build/Codec/Compression/Zlib/Stream_hsc_make.o failed (exit code 1)
    command was: /usr/bin/gcc .stack-work/dist/x86_64-linux-tinfo6-nopie/Cabal-1.24.2.0/build/Codec/Compression/Zlib/Stream_hsc_make.o .stack-work/dist/x86_64-linux-tinfo6-nopie/Cabal-1.24.2.0/build/Codec/Compression/Zlib/Stream_hsc_utils.o -o .stack-work/dist/x86_64-linux-tinfo6-nopie/Cabal-1.24.2.0/build/Codec/Compression/Zlib/Stream_hsc_make -fno-PIE -fno-stack-protector -lz -L/mnt/e/ashicX/.stack/programs/x86_64-linux/ghc-tinfo6-nopie-8.0.2/lib/ghc-8.0.2/bytestring-0.10.8.1 -Wl,-R,/mnt/e/ashicX/.stack/programs/x86_64-linux/ghc-tinfo6-nopie-8.0.2/lib/ghc-8.0.2/bytestring-0.10.8.1 -L/mnt/e/ashicX/.stack/programs/x86_64-linux/ghc-tinfo6-nopie-8.0.2/lib/ghc-8.0.2/deepseq-1.4.2.0 -Wl,-R,/mnt/e/ashicX/.stack/programs/x86_64-linux/ghc-tinfo6-nopie-8.0.2/lib/ghc-8.0.2/deepseq-1.4.2.0 -L/mnt/e/ashicX/.stack/programs/x86_64-linux/ghc-tinfo6-nopie-8.0.2/lib/ghc-8.0.2/array-0.5.1.1 -Wl,-R,/mnt/e/ashicX/.stack/programs/x86_64-linux/ghc-tinfo6-nopie-8.0.2/lib/ghc-8.0.2/array-0.5.1.1 -L/mnt/e/ashicX/.stack/programs/x86_64-linux/ghc-tinfo6-nopie-8.0.2/lib/ghc-8.0.2/base-4.9.1.0 -Wl,-R,/mnt/e/ashicX/.stack/programs/x86_64-linux/ghc-tinfo6-nopie-8.0.2/lib/ghc-8.0.2/base-4.9.1.0 -L/mnt/e/ashicX/.stack/programs/x86_64-linux/ghc-tinfo6-nopie-8.0.2/lib/ghc-8.0.2/integer-gmp-1.0.0.1 -Wl,-R,/mnt/e/ashicX/.stack/programs/x86_64-linux/ghc-tinfo6-nopie-8.0.2/lib/ghc-8.0.2/integer-gmp-1.0.0.1 -lgmp -L/mnt/e/ashicX/.stack/programs/x86_64-linux/ghc-tinfo6-nopie-8.0.2/lib/ghc-8.0.2/ghc-prim-0.5.0.0 -Wl,-R,/mnt/e/ashicX/.stack/programs/x86_64-linux/ghc-tinfo6-nopie-8.0.2/lib/ghc-8.0.2/ghc-prim-0.5.0.0 -L/mnt/e/ashicX/.stack/programs/x86_64-linux/ghc-tinfo6-nopie-8.0.2/lib/ghc-8.0.2/rts -Wl,-R,/mnt/e/ashicX/.stack/programs/x86_64-linux/ghc-tinfo6-nopie-8.0.2/lib/ghc-8.0.2/rts -lm -lrt -ldl -lpthread


--  While building package regex-posix-0.95.2 using:
      /mnt/e/ashicX/.stack/setup-exe-cache/x86_64-linux-tinfo6-nopie/Cabal-simple_mPHDZzAJ_1.24.2.0_ghc-8.0.2 --builddir=.stack-work/dist/x86_64-linux-tinfo6-nopie/Cabal-1.24.2.0 build --ghc-options " -ddump-hi -ddump-to-file"
    Process exited with code: ExitFailure 1
    Logs have been written to: /mnt/e/dev/github/ashic/actually-using-haskell/src/auh/.stack-work/logs/regex-posix-0.95.2.log

    Configuring regex-posix-0.95.2...
    Building regex-posix-0.95.2...
    Preprocessing library regex-posix-0.95.2...
    /usr/bin/ld: .stack-work/dist/x86_64-linux-tinfo6-nopie/Cabal-1.24.2.0/build/Text/Regex/Posix/Wrap_hsc_make.o: relocation R_X86_64_32 against `.rodata' can not be used when making a shared object; recompile with -fPIC
    /usr/bin/ld: final link failed: Nonrepresentable section on output
    collect2: error: ld returned 1 exit status
    linking .stack-work/dist/x86_64-linux-tinfo6-nopie/Cabal-1.24.2.0/build/Text/Regex/Posix/Wrap_hsc_make.o failed (exit code 1)
    command was: /usr/bin/gcc .stack-work/dist/x86_64-linux-tinfo6-nopie/Cabal-1.24.2.0/build/Text/Regex/Posix/Wrap_hsc_make.o .stack-work/dist/x86_64-linux-tinfo6-nopie/Cabal-1.24.2.0/build/Text/Regex/Posix/Wrap_hsc_utils.o -o .stack-work/dist/x86_64-linux-tinfo6-nopie/Cabal-1.24.2.0/build/Text/Regex/Posix/Wrap_hsc_make -fno-PIE -fno-stack-protector -L/mnt/e/ashicX/.stack/snapshots/x86_64-linux-tinfo6-nopie/lts-9.11/8.0.2/lib/x86_64-linux-ghc-8.0.2/regex-base-0.93.2-AYjYAsBidAc8f5XNm9b2Aa -Wl,-R,/mnt/e/ashicX/.stack/snapshots/x86_64-linux-tinfo6-nopie/lts-9.11/8.0.2/lib/x86_64-linux-ghc-8.0.2/regex-base-0.93.2-AYjYAsBidAc8f5XNm9b2Aa -L/mnt/e/ashicX/.stack/snapshots/x86_64-linux-tinfo6-nopie/lts-9.11/8.0.2/lib/x86_64-linux-ghc-8.0.2/mtl-2.2.1-BLKBelFsPB3BoFeSWSOYj6 -Wl,-R,/mnt/e/ashicX/.stack/snapshots/x86_64-linux-tinfo6-nopie/lts-9.11/8.0.2/lib/x86_64-linux-ghc-8.0.2/mtl-2.2.1-BLKBelFsPB3BoFeSWSOYj6 -L/mnt/e/ashicX/.stack/programs/x86_64-linux/ghc-tinfo6-nopie-8.0.2/lib/ghc-8.0.2/transformers-0.5.2.0 -Wl,-R,/mnt/e/ashicX/.stack/programs/x86_64-linux/ghc-tinfo6-nopie-8.0.2/lib/ghc-8.0.2/transformers-0.5.2.0 -L/mnt/e/ashicX/.stack/programs/x86_64-linux/ghc-tinfo6-nopie-8.0.2/lib/ghc-8.0.2/containers-0.5.7.1 -Wl,-R,/mnt/e/ashicX/.stack/programs/x86_64-linux/ghc-tinfo6-nopie-8.0.2/lib/ghc-8.0.2/containers-0.5.7.1 -L/mnt/e/ashicX/.stack/programs/x86_64-linux/ghc-tinfo6-nopie-8.0.2/lib/ghc-8.0.2/bytestring-0.10.8.1 -Wl,-R,/mnt/e/ashicX/.stack/programs/x86_64-linux/ghc-tinfo6-nopie-8.0.2/lib/ghc-8.0.2/bytestring-0.10.8.1 -L/mnt/e/ashicX/.stack/programs/x86_64-linux/ghc-tinfo6-nopie-8.0.2/lib/ghc-8.0.2/deepseq-1.4.2.0 -Wl,-R,/mnt/e/ashicX/.stack/programs/x86_64-linux/ghc-tinfo6-nopie-8.0.2/lib/ghc-8.0.2/deepseq-1.4.2.0 -L/mnt/e/ashicX/.stack/programs/x86_64-linux/ghc-tinfo6-nopie-8.0.2/lib/ghc-8.0.2/array-0.5.1.1 -Wl,-R,/mnt/e/ashicX/.stack/programs/x86_64-linux/ghc-tinfo6-nopie-8.0.2/lib/ghc-8.0.2/array-0.5.1.1 -L/mnt/e/ashicX/.stack/programs/x86_64-linux/ghc-tinfo6-nopie-8.0.2/lib/ghc-8.0.2/base-4.9.1.0 -Wl,-R,/mnt/e/ashicX/.stack/programs/x86_64-linux/ghc-tinfo6-nopie-8.0.2/lib/ghc-8.0.2/base-4.9.1.0 -L/mnt/e/ashicX/.stack/programs/x86_64-linux/ghc-tinfo6-nopie-8.0.2/lib/ghc-8.0.2/integer-gmp-1.0.0.1 -Wl,-R,/mnt/e/ashicX/.stack/programs/x86_64-linux/ghc-tinfo6-nopie-8.0.2/lib/ghc-8.0.2/integer-gmp-1.0.0.1 -lgmp -L/mnt/e/ashicX/.stack/programs/x86_64-linux/ghc-tinfo6-nopie-8.0.2/lib/ghc-8.0.2/ghc-prim-0.5.0.0 -Wl,-R,/mnt/e/ashicX/.stack/programs/x86_64-linux/ghc-tinfo6-nopie-8.0.2/lib/ghc-8.0.2/ghc-prim-0.5.0.0 -L/mnt/e/ashicX/.stack/programs/x86_64-linux/ghc-tinfo6-nopie-8.0.2/lib/ghc-8.0.2/rts -Wl,-R,/mnt/e/ashicX/.stack/programs/x86_64-linux/ghc-tinfo6-nopie-8.0.2/lib/ghc-8.0.2/rts -lm -lrt -ldl -lpthread


--  While building package unix-compat-0.4.3.1 using:
      /mnt/e/ashicX/.stack/setup-exe-cache/x86_64-linux-tinfo6-nopie/Cabal-simple_mPHDZzAJ_1.24.2.0_ghc-8.0.2 --builddir=.stack-work/dist/x86_64-linux-tinfo6-nopie/Cabal-1.24.2.0 build --ghc-options " -ddump-hi -ddump-to-file"
    Process exited with code: ExitFailure 1
    Logs have been written to: /mnt/e/dev/github/ashic/actually-using-haskell/src/auh/.stack-work/logs/unix-compat-0.4.3.1.log

    Configuring unix-compat-0.4.3.1...
    Building unix-compat-0.4.3.1...
    Preprocessing library unix-compat-0.4.3.1...
    /usr/bin/ld: .stack-work/dist/x86_64-linux-tinfo6-nopie/Cabal-1.24.2.0/build/System/PosixCompat/Extensions_hsc_make.o: relocation R_X86_64_32 against `.rodata' can not be used when making a shared object; recompile with -fPIC
    /usr/bin/ld: final link failed: Nonrepresentable section on output
    collect2: error: ld returned 1 exit status
    linking .stack-work/dist/x86_64-linux-tinfo6-nopie/Cabal-1.24.2.0/build/System/PosixCompat/Extensions_hsc_make.o failed (exit code 1)
    command was: /usr/bin/gcc .stack-work/dist/x86_64-linux-tinfo6-nopie/Cabal-1.24.2.0/build/System/PosixCompat/Extensions_hsc_make.o .stack-work/dist/x86_64-linux-tinfo6-nopie/Cabal-1.24.2.0/build/System/PosixCompat/Extensions_hsc_utils.o -o .stack-work/dist/x86_64-linux-tinfo6-nopie/Cabal-1.24.2.0/build/System/PosixCompat/Extensions_hsc_make -fno-PIE -fno-stack-protector -L/mnt/e/ashicX/.stack/programs/x86_64-linux/ghc-tinfo6-nopie-8.0.2/lib/ghc-8.0.2/unix-2.7.2.1 -Wl,-R,/mnt/e/ashicX/.stack/programs/x86_64-linux/ghc-tinfo6-nopie-8.0.2/lib/ghc-8.0.2/unix-2.7.2.1 -lrt -lutil -ldl -lpthread -L/mnt/e/ashicX/.stack/programs/x86_64-linux/ghc-tinfo6-nopie-8.0.2/lib/ghc-8.0.2/time-1.6.0.1 -Wl,-R,/mnt/e/ashicX/.stack/programs/x86_64-linux/ghc-tinfo6-nopie-8.0.2/lib/ghc-8.0.2/time-1.6.0.1 -L/mnt/e/ashicX/.stack/programs/x86_64-linux/ghc-tinfo6-nopie-8.0.2/lib/ghc-8.0.2/bytestring-0.10.8.1 -Wl,-R,/mnt/e/ashicX/.stack/programs/x86_64-linux/ghc-tinfo6-nopie-8.0.2/lib/ghc-8.0.2/bytestring-0.10.8.1 -L/mnt/e/ashicX/.stack/programs/x86_64-linux/ghc-tinfo6-nopie-8.0.2/lib/ghc-8.0.2/deepseq-1.4.2.0 -Wl,-R,/mnt/e/ashicX/.stack/programs/x86_64-linux/ghc-tinfo6-nopie-8.0.2/lib/ghc-8.0.2/deepseq-1.4.2.0 -L/mnt/e/ashicX/.stack/programs/x86_64-linux/ghc-tinfo6-nopie-8.0.2/lib/ghc-8.0.2/array-0.5.1.1 -Wl,-R,/mnt/e/ashicX/.stack/programs/x86_64-linux/ghc-tinfo6-nopie-8.0.2/lib/ghc-8.0.2/array-0.5.1.1 -L/mnt/e/ashicX/.stack/programs/x86_64-linux/ghc-tinfo6-nopie-8.0.2/lib/ghc-8.0.2/base-4.9.1.0 -Wl,-R,/mnt/e/ashicX/.stack/programs/x86_64-linux/ghc-tinfo6-nopie-8.0.2/lib/ghc-8.0.2/base-4.9.1.0 -L/mnt/e/ashicX/.stack/programs/x86_64-linux/ghc-tinfo6-nopie-8.0.2/lib/ghc-8.0.2/integer-gmp-1.0.0.1 -Wl,-R,/mnt/e/ashicX/.stack/programs/x86_64-linux/ghc-tinfo6-nopie-8.0.2/lib/ghc-8.0.2/integer-gmp-1.0.0.1 -lgmp -L/mnt/e/ashicX/.stack/programs/x86_64-linux/ghc-tinfo6-nopie-8.0.2/lib/ghc-8.0.2/ghc-prim-0.5.0.0 -Wl,-R,/mnt/e/ashicX/.stack/programs/x86_64-linux/ghc-tinfo6-nopie-8.0.2/lib/ghc-8.0.2/ghc-prim-0.5.0.0 -L/mnt/e/ashicX/.stack/programs/x86_64-linux/ghc-tinfo6-nopie-8.0.2/lib/ghc-8.0.2/rts -Wl,-R,/mnt/e/ashicX/.stack/programs/x86_64-linux/ghc-tinfo6-nopie-8.0.2/lib/ghc-8.0.2/rts -lm -lrt -ldl -lpthread


--  While building package network-2.6.3.2 using:
      /tmp/stack16566/network-2.6.3.2/.stack-work/dist/x86_64-linux-tinfo6-nopie/Cabal-1.24.2.0/setup/setup --builddir=.stack-work/dist/x86_64-linux-tinfo6-nopie/Cabal-1.24.2.0 configure --with-ghc=/mnt/e/ashicX/.stack/programs/x86_64-linux/ghc-tinfo6-nopie-8.0.2/bin/ghc --with-ghc-pkg=/mnt/e/ashicX/.stack/programs/x86_64-linux/ghc-tinfo6-nopie-8.0.2/bin/ghc-pkg --user --package-db=clear --package-db=global --package-db=/mnt/e/ashicX/.stack/snapshots/x86_64-linux-tinfo6-nopie/lts-9.11/8.0.2/pkgdb --libdir=/mnt/e/ashicX/.stack/snapshots/x86_64-linux-tinfo6-nopie/lts-9.11/8.0.2/lib --bindir=/mnt/e/ashicX/.stack/snapshots/x86_64-linux-tinfo6-nopie/lts-9.11/8.0.2/bin --datadir=/mnt/e/ashicX/.stack/snapshots/x86_64-linux-tinfo6-nopie/lts-9.11/8.0.2/share --libexecdir=/mnt/e/ashicX/.stack/snapshots/x86_64-linux-tinfo6-nopie/lts-9.11/8.0.2/libexec --sysconfdir=/mnt/e/ashicX/.stack/snapshots/x86_64-linux-tinfo6-nopie/lts-9.11/8.0.2/etc --docdir=/mnt/e/ashicX/.stack/snapshots/x86_64-linux-tinfo6-nopie/lts-9.11/8.0.2/doc/network-2.6.3.2 --htmldir=/mnt/e/ashicX/.stack/snapshots/x86_64-linux-tinfo6-nopie/lts-9.11/8.0.2/doc/network-2.6.3.2 --haddockdir=/mnt/e/ashicX/.stack/snapshots/x86_64-linux-tinfo6-nopie/lts-9.11/8.0.2/doc/network-2.6.3.2 --dependency=base=base-4.9.1.0 --dependency=bytestring=bytestring-0.10.8.1 --dependency=unix=unix-2.7.2.1
    Process exited with code: ExitFailure 1
    Logs have been written to: /mnt/e/dev/github/ashic/actually-using-haskell/src/auh/.stack-work/logs/network-2.6.3.2.log

    [1 of 2] Compiling Main             ( /tmp/stack16566/network-2.6.3.2/Setup.hs, /tmp/stack16566/network-2.6.3.2/.stack-work/dist/x86_64-linux-tinfo6-nopie/Cabal-1.24.2.0/setup/Main.o )
    [2 of 2] Compiling StackSetupShim   ( /mnt/e/ashicX/.stack/setup-exe-src/setup-shim-mPHDZzAJ.hs, /tmp/stack16566/network-2.6.3.2/.stack-work/dist/x86_64-linux-tinfo6-nopie/Cabal-1.24.2.0/setup/StackSetupShim.o )
    Linking /tmp/stack16566/network-2.6.3.2/.stack-work/dist/x86_64-linux-tinfo6-nopie/Cabal-1.24.2.0/setup/setup ...
    Configuring network-2.6.3.2...
    configure: WARNING: unrecognized options: --with-compiler
    checking build system type... x86_64-pc-linux-gnu
    checking host system type... x86_64-pc-linux-gnu
    checking for gcc... /usr/bin/gcc
    checking whether the C compiler works... yes
    checking for C compiler default output file name... a.out
    checking for suffix of executables... 
    checking whether we are cross compiling... configure: error: in `/tmp/stack16566/network-2.6.3.2':
    configure: error: cannot run C compiled programs.
    If you meant to cross compile, use `--host'.
    See `config.log' for more details


--  While building package old-time-1.1.0.3 using:
      /tmp/stack16566/old-time-1.1.0.3/.stack-work/dist/x86_64-linux-tinfo6-nopie/Cabal-1.24.2.0/setup/setup --builddir=.stack-work/dist/x86_64-linux-tinfo6-nopie/Cabal-1.24.2.0 configure --with-ghc=/mnt/e/ashicX/.stack/programs/x86_64-linux/ghc-tinfo6-nopie-8.0.2/bin/ghc --with-ghc-pkg=/mnt/e/ashicX/.stack/programs/x86_64-linux/ghc-tinfo6-nopie-8.0.2/bin/ghc-pkg --user --package-db=clear --package-db=global --package-db=/mnt/e/ashicX/.stack/snapshots/x86_64-linux-tinfo6-nopie/lts-9.11/8.0.2/pkgdb --libdir=/mnt/e/ashicX/.stack/snapshots/x86_64-linux-tinfo6-nopie/lts-9.11/8.0.2/lib --bindir=/mnt/e/ashicX/.stack/snapshots/x86_64-linux-tinfo6-nopie/lts-9.11/8.0.2/bin --datadir=/mnt/e/ashicX/.stack/snapshots/x86_64-linux-tinfo6-nopie/lts-9.11/8.0.2/share --libexecdir=/mnt/e/ashicX/.stack/snapshots/x86_64-linux-tinfo6-nopie/lts-9.11/8.0.2/libexec --sysconfdir=/mnt/e/ashicX/.stack/snapshots/x86_64-linux-tinfo6-nopie/lts-9.11/8.0.2/etc --docdir=/mnt/e/ashicX/.stack/snapshots/x86_64-linux-tinfo6-nopie/lts-9.11/8.0.2/doc/old-time-1.1.0.3 --htmldir=/mnt/e/ashicX/.stack/snapshots/x86_64-linux-tinfo6-nopie/lts-9.11/8.0.2/doc/old-time-1.1.0.3 --haddockdir=/mnt/e/ashicX/.stack/snapshots/x86_64-linux-tinfo6-nopie/lts-9.11/8.0.2/doc/old-time-1.1.0.3 --dependency=base=base-4.9.1.0 --dependency=old-locale=old-locale-1.0.0.7-KGBP1BSKxH5GCm0LnZP04j
    Process exited with code: ExitFailure 1
    Logs have been written to: /mnt/e/dev/github/ashic/actually-using-haskell/src/auh/.stack-work/logs/old-time-1.1.0.3.log

    [1 of 2] Compiling Main             ( /tmp/stack16566/old-time-1.1.0.3/Setup.hs, /tmp/stack16566/old-time-1.1.0.3/.stack-work/dist/x86_64-linux-tinfo6-nopie/Cabal-1.24.2.0/setup/Main.o )
    [2 of 2] Compiling StackSetupShim   ( /mnt/e/ashicX/.stack/setup-exe-src/setup-shim-mPHDZzAJ.hs, /tmp/stack16566/old-time-1.1.0.3/.stack-work/dist/x86_64-linux-tinfo6-nopie/Cabal-1.24.2.0/setup/StackSetupShim.o )
    Linking /tmp/stack16566/old-time-1.1.0.3/.stack-work/dist/x86_64-linux-tinfo6-nopie/Cabal-1.24.2.0/setup/setup ...
    Configuring old-time-1.1.0.3...
    configure: WARNING: unrecognized options: --with-compiler
    checking for gcc... /usr/bin/gcc
    checking whether the C compiler works... yes
    checking for C compiler default output file name... a.out
    checking for suffix of executables... 
    checking whether we are cross compiling... configure: error: in `/tmp/stack16566/old-time-1.1.0.3':
    configure: error: cannot run C compiled programs.
    If you meant to cross compile, use `--host'.
    See `config.log' for more details

Stack version

Version 1.6.0.20171022 x86_64

Method of installation

Pacman on archlinux.

I'd appreciate any help in resolving this.

@ashic
Copy link
Author

ashic commented Nov 1, 2017

I managed to get it working via #2712 (comment) .
I changed the settings in ~/.stack/programs/x86_64-linux/ghc-tinfo6-nopie-8.0.2/lib/ghc-8.0.2/settings to

("C compiler flags", "-fno-PIE -fno-stack-protector"),
("C compiler link flags", "-no-pie"),
("ld flags", "-no-pie"),

In my case, the link flags string was empty.

@ashic ashic closed this as completed Nov 1, 2017
@mgsloan
Copy link
Contributor

mgsloan commented Nov 1, 2017

Yes, this is an issue that seems to be occurring for a lot of arch people lately. Please try the workarounds here - #3509 (comment)

Related issues:

@mgsloan mgsloan added this to the Support milestone Nov 1, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants