Installing ghc-7.10.2 linux binary distro on SuSE

Hello all, I've been having a lot of trouble installing the binary-distro's on a SuSE machine. Unfortunately, I don't have root privileges and thus my options are rather limited. The problem seem to boil down to the use of the function pthread_setname_np. It appears the problem was noted before, and Simon Marlow added a corresponding configure check for platforms that do not have this function. See here: https://mail.haskell.org/pipermail/ghc-devs/2014-October/006707.html Alas, none of the binary distributions listed on https://www.haskell.org/ghc/download_ghc_7_10_2#binaries seem to be built against a system that does not have this function. So, I was unable to install 7.10.2 successfully. Essentially, I'm looking for a binary distro on SuSE, or with a libc that doesn't have the GNU extensions such as pthread_setname_np; if anyone would be kind enough to put out such a binary distro, that'd really be appreciated. (Yes, I tried building from the source; but in the corporate environment with so many things controlled, that did not go very far.) Thanks, -Levent.

Levent Erkok
Hello all,
I've been having a lot of trouble installing the binary-distro's on a SuSE machine. Unfortunately, I don't have root privileges and thus my options are rather limited.
The problem seem to boil down to the use of the function pthread_setname_np. It appears the problem was noted before, and Simon Marlow added a corresponding configure check for platforms that do not have this function. See here: https://mail.haskell.org/pipermail/ghc-devs/2014-October/006707.html
Alas, none of the binary distributions listed on https://www.haskell.org/ghc/download_ghc_7_10_2#binaries seem to be built against a system that does not have this function. So, I was unable to install 7.10.2 successfully.
Essentially, I'm looking for a binary distro on SuSE, or with a libc that doesn't have the GNU extensions such as pthread_setname_np; if anyone would be kind enough to put out such a binary distro, that'd really be appreciated.
(Yes, I tried building from the source; but in the corporate environment with so many things controlled, that did not go very far.)
You could try the Nix route, which, conceptually, would boil down to: 1. Installing the Nix package manager into your $HOME on the SuSE system 2. Use Nix to install GHC Which expands to: 1. Following the instructions at: https://nixos.org/wiki/How_to_install_nix_in_home_%28on_another_distribution... 2. Invoking: nix-env -iA haskellPackages.ghc This would require only HTTP access, which, I presume, should be available within the corporate environment. All the packages from Hackage can be had precompiled from Nixpkgs, but that's slightly more involved and requires some reading: http://nixos.org/nixpkgs/manual/#users-guide-to-the-haskell-infrastructure Should you meet trouble, you can always seek help either at nix-dev@lists.science.uu.nl, or on the #nixos/irc.freenode.net IRC channel -- both have a vibrant nightlife^W Haskell community. -- с уважениeм / respectfully, Косырев Серёга -- “And those who were seen dancing were thought to be insane by those who could not hear the music.” – Friedrich Wilhelm Nietzsche

I really like the idea of nix. Alas, generating native binaries that can run on SuSE without being in the nix environment is a requirement that's hard to let go. (Everyone in my group would have to start using nix, a tall order.) Thanks for the advice however, it can indeed come handy for one-off trials if needed. In the meantime, I'm still looking for a binary-linux-distro that doesn't require the set_threadname_np functionality, if anyone can point me in that direction. Thanks, -Levent. On Sat, Aug 29, 2015 at 3:23 PM, Kosyrev Serge <_deepfire@feelingofgreen.ru> wrote:
Levent Erkok
writes: Hello all,
I've been having a lot of trouble installing the binary-distro's on a SuSE machine. Unfortunately, I don't have root privileges and thus my options are rather limited.
The problem seem to boil down to the use of the function pthread_setname_np. It appears the problem was noted before, and Simon Marlow added a corresponding configure check for platforms that do not have this function. See here: https://mail.haskell.org/pipermail/ghc-devs/2014-October/006707.html
Alas, none of the binary distributions listed on https://www.haskell.org/ghc/download_ghc_7_10_2#binaries seem to be built against a system that does not have this function. So, I was unable to install 7.10.2 successfully.
Essentially, I'm looking for a binary distro on SuSE, or with a libc that doesn't have the GNU extensions such as pthread_setname_np; if anyone would be kind enough to put out such a binary distro, that'd really be appreciated.
(Yes, I tried building from the source; but in the corporate environment with so many things controlled, that did not go very far.)
You could try the Nix route, which, conceptually, would boil down to:
1. Installing the Nix package manager into your $HOME on the SuSE system 2. Use Nix to install GHC
Which expands to:
1. Following the instructions at:
https://nixos.org/wiki/How_to_install_nix_in_home_%28on_another_distribution...
2. Invoking:
nix-env -iA haskellPackages.ghc
This would require only HTTP access, which, I presume, should be available within the corporate environment.
All the packages from Hackage can be had precompiled from Nixpkgs, but that's slightly more involved and requires some reading:
http://nixos.org/nixpkgs/manual/#users-guide-to-the-haskell-infrastructure
Should you meet trouble, you can always seek help either at nix-dev@lists.science.uu.nl, or on the #nixos/irc.freenode.net IRC channel -- both have a vibrant nightlife^W Haskell community.
-- с уважениeм / respectfully, Косырев Серёга -- “And those who were seen dancing were thought to be insane by those who could not hear the music.” – Friedrich Wilhelm Nietzsche

Hi Levent, For a quick fix, you may want to create a wrapper script which uses LD_PRELOAD to inject `set_threadname_np` to your runtime. An example is given in this blog page: http://hackerboss.com/overriding-system-functions-for-fun-and-profit/ http://hackerboss.com/overriding-system-functions-for-fun-and-profit/ -aycan
On 30 Aug 2015, at 03:02, Levent Erkok
wrote: I really like the idea of nix. Alas, generating native binaries that can run on SuSE without being in the nix environment is a requirement that's hard to let go. (Everyone in my group would have to start using nix, a tall order.)
Thanks for the advice however, it can indeed come handy for one-off trials if needed. In the meantime, I'm still looking for a binary-linux-distro that doesn't require the set_threadname_np functionality, if anyone can point me in that direction.
Thanks,
-Levent.
On Sat, Aug 29, 2015 at 3:23 PM, Kosyrev Serge <_deepfire@feelingofgreen.ru mailto:_deepfire@feelingofgreen.ru> wrote: Levent Erkok
mailto:erkokl@gmail.com> writes: Hello all,
I've been having a lot of trouble installing the binary-distro's on a SuSE machine. Unfortunately, I don't have root privileges and thus my options are rather limited.
The problem seem to boil down to the use of the function pthread_setname_np. It appears the problem was noted before, and Simon Marlow added a corresponding configure check for platforms that do not have this function. See here: https://mail.haskell.org/pipermail/ghc-devs/2014-October/006707.html https://mail.haskell.org/pipermail/ghc-devs/2014-October/006707.html
Alas, none of the binary distributions listed on https://www.haskell.org/ghc/download_ghc_7_10_2#binaries https://www.haskell.org/ghc/download_ghc_7_10_2#binaries seem to be built against a system that does not have this function. So, I was unable to install 7.10.2 successfully.
Essentially, I'm looking for a binary distro on SuSE, or with a libc that doesn't have the GNU extensions such as pthread_setname_np; if anyone would be kind enough to put out such a binary distro, that'd really be appreciated.
(Yes, I tried building from the source; but in the corporate environment with so many things controlled, that did not go very far.)
You could try the Nix route, which, conceptually, would boil down to:
1. Installing the Nix package manager into your $HOME on the SuSE system 2. Use Nix to install GHC
Which expands to:
1. Following the instructions at:
https://nixos.org/wiki/How_to_install_nix_in_home_%28on_another_distribution... https://nixos.org/wiki/How_to_install_nix_in_home_%28on_another_distribution...
2. Invoking:
nix-env -iA haskellPackages.ghc
This would require only HTTP access, which, I presume, should be available within the corporate environment.
All the packages from Hackage can be had precompiled from Nixpkgs, but that's slightly more involved and requires some reading:
http://nixos.org/nixpkgs/manual/#users-guide-to-the-haskell-infrastructure http://nixos.org/nixpkgs/manual/#users-guide-to-the-haskell-infrastructure
Should you meet trouble, you can always seek help either at nix-dev@lists.science.uu.nl mailto:nix-dev@lists.science.uu.nl, or on the #nixos/irc.freenode.net http://irc.freenode.net/ IRC channel -- both have a vibrant nightlife^W Haskell community.
-- с уважениeм / respectfully, Косырев Серёга -- “And those who were seen dancing were thought to be insane by those who could not hear the music.” – Friedrich Wilhelm Nietzsche
_______________________________________________ ghc-devs mailing list ghc-devs@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs

Thanks Aycan. The LD_PRELOAD solution did indeed work. I didn't know about
that facility before, so I'm pleasantly surprised.
One gotcha though: I had to add the "fake-library" into the runtime as
well; with a command that looked like this:
ar q libHsrts_thr.a ghcFakeLib.o
where the libHsrts_thr.a comes from the binary distro, and the ghcFakeLib.o
is the object file I got by defining those pthread_setname_np and
pthread_getname_np. (They do nothing but return 0.)
Thanks,
-Levent.
On Sun, Aug 30, 2015 at 12:37 AM, Aycan İrican
Hi Levent,
For a quick fix, you may want to create a wrapper script which uses LD_PRELOAD to inject `set_threadname_np` to your runtime. An example is given in this blog page:
http://hackerboss.com/overriding-system-functions-for-fun-and-profit/
-aycan
On 30 Aug 2015, at 03:02, Levent Erkok
wrote: I really like the idea of nix. Alas, generating native binaries that can run on SuSE without being in the nix environment is a requirement that's hard to let go. (Everyone in my group would have to start using nix, a tall order.)
Thanks for the advice however, it can indeed come handy for one-off trials if needed. In the meantime, I'm still looking for a binary-linux-distro that doesn't require the set_threadname_np functionality, if anyone can point me in that direction.
Thanks,
-Levent.
On Sat, Aug 29, 2015 at 3:23 PM, Kosyrev Serge < _deepfire@feelingofgreen.ru> wrote:
Levent Erkok
writes: Hello all,
I've been having a lot of trouble installing the binary-distro's on a SuSE machine. Unfortunately, I don't have root privileges and thus my options are rather limited.
The problem seem to boil down to the use of the function pthread_setname_np. It appears the problem was noted before, and Simon Marlow added a corresponding configure check for platforms that do not have this function. See here: https://mail.haskell.org/pipermail/ghc-devs/2014-October/006707.html
Alas, none of the binary distributions listed on https://www.haskell.org/ghc/download_ghc_7_10_2#binaries seem to be built against a system that does not have this function. So, I was unable to install 7.10.2 successfully.
Essentially, I'm looking for a binary distro on SuSE, or with a libc that doesn't have the GNU extensions such as pthread_setname_np; if anyone would be kind enough to put out such a binary distro, that'd really be appreciated.
(Yes, I tried building from the source; but in the corporate environment with so many things controlled, that did not go very far.)
You could try the Nix route, which, conceptually, would boil down to:
1. Installing the Nix package manager into your $HOME on the SuSE system 2. Use Nix to install GHC
Which expands to:
1. Following the instructions at:
https://nixos.org/wiki/How_to_install_nix_in_home_%28on_another_distribution...
2. Invoking:
nix-env -iA haskellPackages.ghc
This would require only HTTP access, which, I presume, should be available within the corporate environment.
All the packages from Hackage can be had precompiled from Nixpkgs, but that's slightly more involved and requires some reading:
http://nixos.org/nixpkgs/manual/#users-guide-to-the-haskell-infrastructure
Should you meet trouble, you can always seek help either at nix-dev@lists.science.uu.nl, or on the #nixos/irc.freenode.net IRC channel -- both have a vibrant nightlife^W Haskell community.
-- с уважениeм / respectfully, Косырев Серёга -- “And those who were seen dancing were thought to be insane by those who could not hear the music.” – Friedrich Wilhelm Nietzsche
_______________________________________________ ghc-devs mailing list ghc-devs@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs

I'm happy to see it worked. If you want to get rid of LD_PRELOAD, you may
use patchelf to modify your binary to inject your fakelib. See 'add-needed'
parameter here:
https://github.com/NixOS/patchelf/blob/master/README
On Mon, 31 Aug 2015 01:50 Levent Erkok
Thanks Aycan. The LD_PRELOAD solution did indeed work. I didn't know about that facility before, so I'm pleasantly surprised.
One gotcha though: I had to add the "fake-library" into the runtime as well; with a command that looked like this:
ar q libHsrts_thr.a ghcFakeLib.o
where the libHsrts_thr.a comes from the binary distro, and the ghcFakeLib.o is the object file I got by defining those pthread_setname_np and pthread_getname_np. (They do nothing but return 0.)
Thanks,
-Levent.
On Sun, Aug 30, 2015 at 12:37 AM, Aycan İrican
wrote: Hi Levent,
For a quick fix, you may want to create a wrapper script which uses LD_PRELOAD to inject `set_threadname_np` to your runtime. An example is given in this blog page:
http://hackerboss.com/overriding-system-functions-for-fun-and-profit/
-aycan
On 30 Aug 2015, at 03:02, Levent Erkok
wrote: I really like the idea of nix. Alas, generating native binaries that can run on SuSE without being in the nix environment is a requirement that's hard to let go. (Everyone in my group would have to start using nix, a tall order.)
Thanks for the advice however, it can indeed come handy for one-off trials if needed. In the meantime, I'm still looking for a binary-linux-distro that doesn't require the set_threadname_np functionality, if anyone can point me in that direction.
Thanks,
-Levent.
On Sat, Aug 29, 2015 at 3:23 PM, Kosyrev Serge < _deepfire@feelingofgreen.ru> wrote:
Levent Erkok
writes: Hello all,
I've been having a lot of trouble installing the binary-distro's on a SuSE machine. Unfortunately, I don't have root privileges and thus my options are rather limited.
The problem seem to boil down to the use of the function pthread_setname_np. It appears the problem was noted before, and Simon Marlow added a corresponding configure check for platforms that do not have this function. See here: https://mail.haskell.org/pipermail/ghc-devs/2014-October/006707.html
Alas, none of the binary distributions listed on https://www.haskell.org/ghc/download_ghc_7_10_2#binaries seem to be built against a system that does not have this function. So, I was unable to install 7.10.2 successfully.
Essentially, I'm looking for a binary distro on SuSE, or with a libc that doesn't have the GNU extensions such as pthread_setname_np; if anyone would be kind enough to put out such a binary distro, that'd really be appreciated.
(Yes, I tried building from the source; but in the corporate environment with so many things controlled, that did not go very far.)
You could try the Nix route, which, conceptually, would boil down to:
1. Installing the Nix package manager into your $HOME on the SuSE system 2. Use Nix to install GHC
Which expands to:
1. Following the instructions at:
https://nixos.org/wiki/How_to_install_nix_in_home_%28on_another_distribution...
2. Invoking:
nix-env -iA haskellPackages.ghc
This would require only HTTP access, which, I presume, should be available within the corporate environment.
All the packages from Hackage can be had precompiled from Nixpkgs, but that's slightly more involved and requires some reading:
http://nixos.org/nixpkgs/manual/#users-guide-to-the-haskell-infrastructure
Should you meet trouble, you can always seek help either at nix-dev@lists.science.uu.nl, or on the #nixos/irc.freenode.net IRC channel -- both have a vibrant nightlife^W Haskell community.
-- с уважениeм / respectfully, Косырев Серёга -- “And those who were seen dancing were thought to be insane by those who could not hear the music.” – Friedrich Wilhelm Nietzsche
_______________________________________________ ghc-devs mailing list ghc-devs@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs

Hi Aycan.. Indeed I was able to use patchelf, so I don't need the
LD_PRELOAD trick anymore either. Thanks for the pointer..
As a side note: While I'm impressed with the level of trickery available to
inject/remove/change arbitrary functionality to binaries, I'm also
surprised to see how easy it would be to insert Trojan-horses on the fly
using these mechanisms as well. With "Trusted Haskell" brand, it almost
begs the question if GHC should do a "self-check" to make sure it's binary
hasn't been mocked up in this way. That would make my life harder of
course, but food for thought.
-Levent.
On Mon, Aug 31, 2015 at 2:44 AM, Aycan iRiCAN
I'm happy to see it worked. If you want to get rid of LD_PRELOAD, you may use patchelf to modify your binary to inject your fakelib. See 'add-needed' parameter here:
https://github.com/NixOS/patchelf/blob/master/README
On Mon, 31 Aug 2015 01:50 Levent Erkok
wrote: Thanks Aycan. The LD_PRELOAD solution did indeed work. I didn't know about that facility before, so I'm pleasantly surprised.
One gotcha though: I had to add the "fake-library" into the runtime as well; with a command that looked like this:
ar q libHsrts_thr.a ghcFakeLib.o
where the libHsrts_thr.a comes from the binary distro, and the ghcFakeLib.o is the object file I got by defining those pthread_setname_np and pthread_getname_np. (They do nothing but return 0.)
Thanks,
-Levent.
On Sun, Aug 30, 2015 at 12:37 AM, Aycan İrican
wrote: Hi Levent,
For a quick fix, you may want to create a wrapper script which uses LD_PRELOAD to inject `set_threadname_np` to your runtime. An example is given in this blog page:
http://hackerboss.com/overriding-system-functions-for-fun-and-profit/
-aycan
On 30 Aug 2015, at 03:02, Levent Erkok
wrote: I really like the idea of nix. Alas, generating native binaries that can run on SuSE without being in the nix environment is a requirement that's hard to let go. (Everyone in my group would have to start using nix, a tall order.)
Thanks for the advice however, it can indeed come handy for one-off trials if needed. In the meantime, I'm still looking for a binary-linux-distro that doesn't require the set_threadname_np functionality, if anyone can point me in that direction.
Thanks,
-Levent.
On Sat, Aug 29, 2015 at 3:23 PM, Kosyrev Serge < _deepfire@feelingofgreen.ru> wrote:
Levent Erkok
writes: Hello all,
I've been having a lot of trouble installing the binary-distro's on a SuSE machine. Unfortunately, I don't have root privileges and thus my options are rather limited.
The problem seem to boil down to the use of the function pthread_setname_np. It appears the problem was noted before, and Simon Marlow added a corresponding configure check for platforms that do not have this function. See here: https://mail.haskell.org/pipermail/ghc-devs/2014-October/006707.html
Alas, none of the binary distributions listed on https://www.haskell.org/ghc/download_ghc_7_10_2#binaries seem to be built against a system that does not have this function. So, I was unable to install 7.10.2 successfully.
Essentially, I'm looking for a binary distro on SuSE, or with a libc that doesn't have the GNU extensions such as pthread_setname_np; if anyone would be kind enough to put out such a binary distro, that'd really be appreciated.
(Yes, I tried building from the source; but in the corporate environment with so many things controlled, that did not go very far.)
You could try the Nix route, which, conceptually, would boil down to:
1. Installing the Nix package manager into your $HOME on the SuSE system 2. Use Nix to install GHC
Which expands to:
1. Following the instructions at:
https://nixos.org/wiki/How_to_install_nix_in_home_%28on_another_distribution...
2. Invoking:
nix-env -iA haskellPackages.ghc
This would require only HTTP access, which, I presume, should be available within the corporate environment.
All the packages from Hackage can be had precompiled from Nixpkgs, but that's slightly more involved and requires some reading:
http://nixos.org/nixpkgs/manual/#users-guide-to-the-haskell-infrastructure
Should you meet trouble, you can always seek help either at nix-dev@lists.science.uu.nl, or on the #nixos/irc.freenode.net IRC channel -- both have a vibrant nightlife^W Haskell community.
-- с уважениeм / respectfully, Косырев Серёга -- “And those who were seen dancing were thought to be insane by those who could not hear the music.” – Friedrich Wilhelm Nietzsche
_______________________________________________ ghc-devs mailing list ghc-devs@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs

On Sat, Aug 29, 2015 at 10:41 PM, Levent Erkok wrote:
Hello all,
[...]
(Yes, I tried building from the source; but in the corporate environment with so many things controlled, that did not go very far.)
What exactly failed? Have you tried using a same-distro-version SuSE chroot/container, where you install the SuSE-packaged GHC, for building 7.10.2? This is of course assuming that the autoconf check works.

Tuncer: The LD_PRELOAD trick and the patchelf magic solved the problem
nicely..
I'd still prefer if a SuSE binary distro was available from the downloads
page, for the good of the community. When I tried to build from source, I
was getting all sorts of error messages even from the configure step; so I
gave up fairly quickly. If it was a machine I had root access to then I'd
have given it more time; but with only user-level access, I didn't pursue
anything further.
On Sun, Aug 30, 2015 at 2:49 AM, Tuncer Ayaz
On Sat, Aug 29, 2015 at 10:41 PM, Levent Erkok wrote:
Hello all,
[...]
(Yes, I tried building from the source; but in the corporate environment with so many things controlled, that did not go very far.)
What exactly failed? Have you tried using a same-distro-version SuSE chroot/container, where you install the SuSE-packaged GHC, for building 7.10.2? This is of course assuming that the autoconf check works.
participants (5)
-
Aycan iRiCAN
-
Aycan İrican
-
Kosyrev Serge
-
Levent Erkok
-
Tuncer Ayaz