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

Stack gives CFLAGS=-fno-PIE to autoconf #3488

Closed
HMPerson1 opened this issue Oct 13, 2017 · 3 comments
Closed

Stack gives CFLAGS=-fno-PIE to autoconf #3488

HMPerson1 opened this issue Oct 13, 2017 · 3 comments

Comments

@HMPerson1
Copy link

General summary/comments (optional)

On Archlinux, when building a package using autoconf, stack gives CFLAGS=-fno-PIE to autoconf, which makes autoconf think the C compiler is broken. Using CFLAGS=-no-pie instead would fix this.

Steps to reproduce

  1. Have a package that uses autoconf (e.g. terminfo)
  2. stack build

Expected

It works.

Actual

Configure fails:

$ stack build
terminfo-0.4.1.0: configure (lib)
Configuring terminfo-0.4.1.0...
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... 
configure: error: in `/tmp/tmp.A5fZP6SH5x/terminfo-0.4.1.0':
configure: error: cannot run C compiled programs.
If you meant to cross compile, use `--host'.
See `config.log' for more details
checking whether we are cross compiling... 

--  While building package terminfo-0.4.1.0 using:
      /tmp/tmp.A5fZP6SH5x/terminfo-0.4.1.0/.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=/home/michael/.stack/programs/x86_64-linux/ghc-tinfo6-nopie-8.0.2/bin/ghc --with-ghc-pkg=/home/michael/.stack/programs/x86_64-linux/ghc-tinfo6-nopie-8.0.2/bin/ghc-pkg --user --package-db=clear --package-db=global --package-db=/home/michael/.stack/snapshots/x86_64-linux-tinfo6-nopie/lts-9.8/8.0.2/pkgdb --package-db=/tmp/tmp.A5fZP6SH5x/terminfo-0.4.1.0/.stack-work/install/x86_64-linux-tinfo6-nopie/lts-9.8/8.0.2/pkgdb --libdir=/tmp/tmp.A5fZP6SH5x/terminfo-0.4.1.0/.stack-work/install/x86_64-linux-tinfo6-nopie/lts-9.8/8.0.2/lib --bindir=/tmp/tmp.A5fZP6SH5x/terminfo-0.4.1.0/.stack-work/install/x86_64-linux-tinfo6-nopie/lts-9.8/8.0.2/bin --datadir=/tmp/tmp.A5fZP6SH5x/terminfo-0.4.1.0/.stack-work/install/x86_64-linux-tinfo6-nopie/lts-9.8/8.0.2/share --libexecdir=/tmp/tmp.A5fZP6SH5x/terminfo-0.4.1.0/.stack-work/install/x86_64-linux-tinfo6-nopie/lts-9.8/8.0.2/libexec --sysconfdir=/tmp/tmp.A5fZP6SH5x/terminfo-0.4.1.0/.stack-work/install/x86_64-linux-tinfo6-nopie/lts-9.8/8.0.2/etc --docdir=/tmp/tmp.A5fZP6SH5x/terminfo-0.4.1.0/.stack-work/install/x86_64-linux-tinfo6-nopie/lts-9.8/8.0.2/doc/terminfo-0.4.1.0 --htmldir=/tmp/tmp.A5fZP6SH5x/terminfo-0.4.1.0/.stack-work/install/x86_64-linux-tinfo6-nopie/lts-9.8/8.0.2/doc/terminfo-0.4.1.0 --haddockdir=/tmp/tmp.A5fZP6SH5x/terminfo-0.4.1.0/.stack-work/install/x86_64-linux-tinfo6-nopie/lts-9.8/8.0.2/doc/terminfo-0.4.1.0 --dependency=base=base-4.9.1.0 --enable-tests --enable-benchmarks
    Process exited with code: ExitFailure 1

Verbose output

config.log

Stack version

$ stack --version
Version 1.5.1 x86_64

Method of installation

  • Archlinux repository
@hsyl20
Copy link
Contributor

hsyl20 commented Oct 23, 2017

It seems to be the same issue as #2712.
Putting ghc-build: nopie in stack.yaml fixes it for me.

@dschrempf
Copy link

Please see

https://bugs.archlinux.org/task/56101

@mgsloan
Copy link
Contributor

mgsloan commented Oct 24, 2017

Closing this as duplicate / upstream

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants