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 does not support yet Ubuntu 16.10 #2542

Closed
Blaisorblade opened this issue Aug 29, 2016 · 4 comments
Closed

Stack does not support yet Ubuntu 16.10 #2542

Blaisorblade opened this issue Aug 29, 2016 · 4 comments
Milestone

Comments

@Blaisorblade
Copy link
Collaborator

@hvr reported this in https://mail.haskell.org/pipermail/haskell-community/2016-August/000136.html. Let me quote:

The Stack or HP+Stack options currently both fail to provide a
good beginner experience on all Linux distributions.

Currently, for the just released Ubuntu 16.10 beta you need to use the
system-packaged GHC 7.10.3 package as otherwise you'll likely run into
linker errors due to PIE (and other Linux distros appear to be switching
to PIE by default in their GCC toolchain as well).

I still haven't had time to patch up my GHC PPA to add support for
Ubuntu 16.10, nor do GHC HQ provided GHC bindists work there yet
out-of-the-box, nor do we have addressed the issue for GHC 8.0.2 yet. So
it's unclear to me when the HP distro will have a GHC that works on
PIE-by-default Linux distros.

While that distro is in beta, it'd be good to address the trouble before that Ubuntu is released (which should be on October 13th).

@Blaisorblade Blaisorblade added this to the P1: Must milestone Aug 29, 2016
@borsboom
Copy link
Contributor

Does anyone know what's involved in building a GHC bindist that works on Ubuntu 16.10? Is it just a matter of building the bindist on Ubuntu 16.10? stack setup support for selecting different bindists depending on contents of the Linux distribution has improved recently, so this may not be too hard to deal with.

@Blaisorblade
Copy link
Collaborator Author

For 7.10.3 one could look at the Ubuntu patches IIUC (in the worst case). Or you could ping HVR if you think it's appropriate (I didn't just to avoid spamming notifications).

@Blaisorblade
Copy link
Collaborator Author

I looked at http://packages.ubuntu.com/yakkety/haskell/ghc and its changelog, and the relevant patches seem to be

Disable PIE on amd64 and ppc64el
Disable PIE on s390x, since Ubuntu's toolchain defaults to enabling it there (closes: #807366). https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=807366

Relevant code in debian/rules:

ifneq (,$(filter $(DEB_HOST_ARCH),$(pie_archs)))
  EXTRA_CONFIGURE_FLAGS += \
        CONF_CC_OPTS_STAGE2=-fno-PIE \
        CONF_GCC_LINKER_OPTS_STAGE2=-no-pie \
        CONF_LD_LINKER_OPTS_STAGE2=-no-pie
endif
# [...]
ifneq (,$(filter $(DEB_HOST_ARCH),$(pie_archs)))
        echo "SRC_CC_OPTS += -fno-PIE" >> mk/build.mk
        echo "SRC_LD_OPTS += -no-pie" >> mk/build.mk
endif

@borsboom
Copy link
Contributor

borsboom commented Sep 10, 2016

After some trial-and-error, it turns out that the configure options GHC was built with don't matter for this case, only the ones that it was installed with (which affect the runtime settings in lib/ghc-<VER>/settings). That means Stack can use the standard GHC bindist, but it will have to adjust the installation process slightly to use the equivalent of CONF_CC_OPTS_STAGE2=-fno-PIE CONF_GCC_LINKER_OPTS_STAGE2=-no-pie CONF_LD_LINKER_OPTS_STAGE2=-no-pie ./configure --prefix=~/.stack/programs/x86_64-linux/ghc-7.10.3.

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