Duncan Coutts | 3 Oct 22:22 2011

Re: failure of GHC 7.0.4 on OS X

On Sat, 2011-09-17 at 16:51 -0700, Mark Lentczner wrote:
> In preparation for building the Haskell Platform 2011.3.0.0 installer for
> Mac OS X, I've run into a snag: The GHC central distributed version of 7.0.4
> can't produce running executables. The problem comes at final link time,
> which fails with this message:
> 
> ld: pointer in read-only segment not allowed in slidable image, used in
> ___gmpn_modexact_1c_odd from
> /Users/markl/Projects/platform/hp-mac/src/macos/dist/root/Library/Frameworks/GHC.framework/Versions/7.0.4-x86_64/usr/lib/ghc-7.0.4/integer-gmp-0.2.0.3/libHSinteger-gmp-0.2.0.3.a(mode1o.o)
> 
> I think what this means is that something about the built version of
> HSinteger-gmp in the 7.0.4 distribution isn't compatible with code compiled
> on my system. I'm running Xcode 3.2.3 on OS 10.7. Googling of this error
> resulted in other projects having this problem with libgmp compilations, but
> usually the issue was some conflict between macports versions of GMP vs. a
> non-macports version. Was the 7.0.4 release built on a macports based build?
> 
> I'm guessing I'm going to have to build GHC 7.0.4 from source for the
> Haskell Platform build.
> 
> I'm wondering - what are other people's experiences of using 7.0.4 on Mac OS
> X.

I'd like to hear some more noise about this issue. If we can't use 7.0.4
on OSX we're really stuffed.

Duncan
Ezra Cooper | 4 Oct 06:31 2011
Picon

Re: failure of GHC 7.0.4 on OS X

On Oct 3, 2011, at 1:22 PM, Duncan Coutts wrote:

> On Sat, 2011-09-17 at 16:51 -0700, Mark Lentczner wrote:
>> In preparation for building the Haskell Platform 2011.3.0.0 installer for
>> Mac OS X, I've run into a snag: The GHC central distributed version of 7.0.4
>> can't produce running executables. The problem comes at final link time,
>> which fails with this message:
>> 
>> ld: pointer in read-only segment not allowed in slidable image, used in
>> ___gmpn_modexact_1c_odd from
>> /Users/markl/Projects/platform/hp-mac/src/macos/dist/root/Library/Frameworks/GHC.framework/Versions/7.0.4-x86_64/usr/lib/ghc-7.0.4/integer-gmp-0.2.0.3/libHSinteger-gmp-0.2.0.3.a(mode1o.o)
>> 
>> I think what this means is that something about the built version of
>> HSinteger-gmp in the 7.0.4 distribution isn't compatible with code compiled
>> on my system. I'm running Xcode 3.2.3 on OS 10.7. Googling of this error
>> resulted in other projects having this problem with libgmp compilations, but
>> usually the issue was some conflict between macports versions of GMP vs. a
>> non-macports version. Was the 7.0.4 release built on a macports based build?
>> 
>> I'm guessing I'm going to have to build GHC 7.0.4 from source for the
>> Haskell Platform build.
>> 
>> I'm wondering - what are other people's experiences of using 7.0.4 on Mac OS
>> X.
> 
> I'd like to hear some more noise about this issue. If we can't use 7.0.4
> on OSX we're really stuffed.
> 
> Duncan

(Continue reading)

Mark Lentczner | 4 Oct 07:50 2011

Re: failure of GHC 7.0.4 on OS X

Here's where I am:


Today I managed to build a 32-bit version HP 2011.3.0.0 (based on GHC 7.0.4 from GHC central). This installs and runs on 10.6 and 10.7 (with some tweaks applied to the ghc script). It will not run on 10.5 because the executables in the GHC distro (ghc, cabal, etc...) were not built compatible with 10.5[1].

I'm pretty sure I will be able to build a 64-bit version as well, subject to the same caveats. I have some scripting magic to take care of things I had to do by hand, and I want to put the prior-version uninstaller in this release. But then I'm good to go.

So - I suggest we proceed, and abandon 10.5 for this release. In the future, we should try get the GHC build to work as far back as 10.5 for 32-bit builds.

Also - I have some patches to the haskell-platform repo -- changing the .cabal file isn't quite enough, the versions appear a few other places as well. I can send Duncan a patch file, or you can add me to the proper group on code.haskell.org (I'm MtnViewMark there) so I can push over ssh.

 - Mark

[1] The executables die with
    dyld: unknown required load command 0x80000022
A little bit of googling yields that this is indicative of being compiled with in an environment where the default SDK and min version were 10.6. To change requires linking with:
    -mmacosx-version-min=10.5
(and possibly compiling against the 10.5 SDK, though that shouldn't be needed since the GHC build should use nothing from the 10.6 SDK that isn't in the 10.5 SDK.)
_______________________________________________
Haskell-platform mailing list
Haskell-platform@...
http://projects.haskell.org/cgi-bin/mailman/listinfo/haskell-platform
Duncan Coutts | 4 Oct 11:28 2011

Re: failure of GHC 7.0.4 on OS X

On Mon, 2011-10-03 at 22:50 -0700, Mark Lentczner wrote:
> Here's where I am:
> 
> Today I managed to build a 32-bit version HP 2011.3.0.0 (based on GHC 7.0.4
> from GHC central). This installs and runs on 10.6 and 10.7 (with some tweaks
> applied to the ghc script). It will not run on 10.5 because the executables
> in the GHC distro (ghc, cabal, etc...) were not built compatible with
> 10.5[1].

Thanks very much for working on this.

> I'm pretty sure I will be able to build a 64-bit version as well, subject to
> the same caveats. I have some scripting magic to take care of things I had
> to do by hand, and I want to put the prior-version uninstaller in this
> release. But then I'm good to go.
> 
> So - I suggest we proceed, and abandon 10.5 for this release.

Ok. Is 10.5 still popular? I presume we'll need to flag this up on the
download page and direct 10.5 users to the previous HP release.

> In the future, we should try get the GHC build to work as far back as
> 10.5 for 32-bit builds.

Is there anything that the upstream ghc devs need to fix or be aware of?

> Also - I have some patches to the haskell-platform repo -- changing the
> .cabal file isn't quite enough, the versions appear a few other places as
> well. I can send Duncan a patch file, or you can add me to the proper group
> on code.haskell.org (I'm MtnViewMark there) so I can push over ssh.

Done. You should now be able to push over ssh.

> [1] The executables die with
>     dyld: unknown required load command 0x80000022
> A little bit of googling yields that this is indicative of being compiled
> with in an environment where the default SDK and min version were 10.6. To
> change requires linking with:
>     -mmacosx-version-min=10.5
> (and possibly compiling against the 10.5 SDK, though that shouldn't be
> needed since the GHC build should use nothing from the 10.6 SDK that isn't
> in the 10.5 SDK.)

So is this something the ghc devs need to fix in the osx build scripts?
Given this info, would it be easy enough for an OSX hacker to prepare
and test a patch for the ghc build system? Perhaps we can find a
volunteer to try this. We noticed at the recent Haskell Implementors
Workshop that most of the Haskell hackers in the room were now OSX
users, so we ought to be able to find volunteers.

Duncan
Ian Lynagh | 4 Oct 19:48 2011
Picon

Re: failure of GHC 7.0.4 on OS X

On Tue, Oct 04, 2011 at 10:28:34AM +0100, Duncan Coutts wrote:
> On Mon, 2011-10-03 at 22:50 -0700, Mark Lentczner wrote:
> 
> > In the future, we should try get the GHC build to work as far back as
> > 10.5 for 32-bit builds.
> 
> Is there anything that the upstream ghc devs need to fix or be aware of?

I don't think we have the resources to support (in the "tier 1 platform"
sense) old versions of OS X, although we always happy to receive
patches, of course.

> > [1] The executables die with
> >     dyld: unknown required load command 0x80000022
> > A little bit of googling yields that this is indicative of being compiled
> > with in an environment where the default SDK and min version were 10.6. To
> > change requires linking with:
> >     -mmacosx-version-min=10.5
> > (and possibly compiling against the 10.5 SDK, though that shouldn't be
> > needed since the GHC build should use nothing from the 10.6 SDK that isn't
> > in the 10.5 SDK.)
> 
> So is this something the ghc devs need to fix in the osx build scripts?

We used to use

    -isysroot /Developer/SDKs/MacOSX10.5.sdk -mmacosx-version-min=10.5

but I had to remove it:

    commit 6c073daacc2c44e218411e874c2eec9d53851d72
    Author: Ian Lynagh <igloo <at> earth.li>
    Date:   Sun Mar 13 14:03:22 2011 +0000

        Stop explicitly asking for 10.5 support on OS X; fixes #5011
        XCode 4 doesn't include the 10.5 SDK, so if we explicitly ask for it
        then linking fails.

I don't know if just

    -mmacosx-version-min=10.5

would (a) produce a GHC that works on 10.5, and (b) work on recent Macs
too. Unfortunately, I can't test (a). Also, even if it does work now, I
wouldn't be surprised if it broke in the near future.

Thanks
Ian
Mark Lentczner | 5 Oct 03:33 2011

Re: failure of GHC 7.0.4 on OS X

I don't know if just

   -mmacosx-version-min=10.5

would (a) produce a GHC that works on 10.5, and (b) work on recent Macs
too. Unfortunately, I can't test (a). Also, even if it does work now, I
wouldn't be surprised if it broke in the near future.

Yes, it should. I was planning on testing that tonight. If you let me know where that line goes, it would keep me from having to go spelunking to find where to put it.

I would be surprised if it broke in the near/mid future. That option tells the linker which features it is allowed to use. For the most part, future SDKs only include more functionality. If you stick to the functionality only available on 10.x, then you can compile against 10.(x+i) but link with verion-min=10.x, and you should be good to go. The only downside of not compiling against the older 10.x SDK is that you might accidentally code calls to functions no available on older machines. Since the GHC source sticks close to POSIX, and doesn't really use Mac OS X APIs, I think we're pretty safe.

- Mark

_______________________________________________
Cvs-ghc mailing list
Cvs-ghc <at> haskell.org
http://www.haskell.org/mailman/listinfo/cvs-ghc
Ian Lynagh | 5 Oct 03:40 2011
Picon

Re: failure of GHC 7.0.4 on OS X

On Tue, Oct 04, 2011 at 06:33:06PM -0700, Mark Lentczner wrote:
> >
> > I don't know if just
> >
> >    -mmacosx-version-min=10.5
> >
> > would (a) produce a GHC that works on 10.5, and (b) work on recent Macs
> > too. Unfortunately, I can't test (a). Also, even if it does work now, I
> > wouldn't be surprised if it broke in the near future.
> >
> 
> Yes, it should. I was planning on testing that tonight. If you let me know
> where that line goes, it would keep me from having to go spelunking to find
> where to put it.

Putting it back where that patch removed it from ought to work:

diff --git a/aclocal.m4 b/aclocal.m4
index 1db95cf..691fd45 100644
--- a/aclocal.m4
+++ b/aclocal.m4
 <at>  <at>  -111,16 +111,6  <at>  <at>  AC_DEFUN([FPTOOLS_SET_C_LD_FLAGS],
         ;;
     esac

-    case $$1 in
-    i386-apple-darwin|x86_64-apple-darwin)
-        # We support back to OS X 10.5
-        $2="$$2 -isysroot /Developer/SDKs/MacOSX10.5.sdk -mmacosx-version-min=10.5"
-        $3="$$3 -isysroot /Developer/SDKs/MacOSX10.5.sdk -mmacosx-version-min=10.5"
-        $4="$$4  -macosx_version_min 10.5"
-        $5="$$5 -isysroot /Developer/SDKs/MacOSX10.5.sdk -mmacosx-version-min=10.5"
-        ;;
-    esac
-
     # If gcc knows about the stack protector, turn it off.
     # Otherwise the stack-smash handler gets triggered.
     echo 'int main(void) {return 0;}' > conftest.c

Thanks
Ian
Benedikt Huber | 7 Oct 17:38 2011
Picon
Picon

Re: failure of GHC 7.0.4 on OS X


On 04.10.2011, at 11:28, Duncan Coutts wrote:

> On Mon, 2011-10-03 at 22:50 -0700, Mark Lentczner wrote:
>> Here's where I am:
>>
>> Today I managed to build a 32-bit version HP 2011.3.0.0 (based on  
>> GHC 7.0.4
>> from GHC central). This installs and runs on 10.6 and 10.7 (with  
>> some tweaks
>> applied to the ghc script). It will not run on 10.5 because the  
>> executables
>> in the GHC distro (ghc, cabal, etc...) were not built compatible with
>> 10.5[1].
>
> Thanks very much for working on this.
Hello,
I've just built and installed both GHC 7.0.4 and the HP 2011.3.0.0 on  
OS X 10.5,
and did not run into any problems (plain ./configure && make && make  
install
worked fine). I tested it a little bit, at least the OpenGL  
application 'monadius'
works without any problems.

My System:
Darwin Kernel Version 9.8.0 i386
i686-apple-darwin9-gcc-4.0.1 (GCC) 4.0.1 (Apple Inc. build 5493)
Xcode 3.1.3

>
>> I'm pretty sure I will be able to build a 64-bit version as well,  
>> subject to
>> the same caveats. I have some scripting magic to take care of  
>> things I had
>> to do by hand, and I want to put the prior-version uninstaller in  
>> this
>> release. But then I'm good to go.
>>
>> So - I suggest we proceed, and abandon 10.5 for this release.
>
> Ok. Is 10.5 still popular? I presume we'll need to flag this up on the
> download page and direct 10.5 users to the previous HP release.
Personally, I do not care if there is no dedicated distribution for 10.5
as long as building the platform from source works. Maybe one could
add a note that this is also possible (in addition to using older  
versions).

Best Regards,
Benedikt

>
>> In the future, we should try get the GHC build to work as far back as
>> 10.5 for 32-bit builds.
>
> Is there anything that the upstream ghc devs need to fix or be aware  
> of?
>
>> Also - I have some patches to the haskell-platform repo -- changing  
>> the
>> .cabal file isn't quite enough, the versions appear a few other  
>> places as
>> well. I can send Duncan a patch file, or you can add me to the  
>> proper group
>> on code.haskell.org (I'm MtnViewMark there) so I can push over ssh.
>
> Done. You should now be able to push over ssh.
>
>> [1] The executables die with
>>    dyld: unknown required load command 0x80000022
>> A little bit of googling yields that this is indicative of being  
>> compiled
>> with in an environment where the default SDK and min version were  
>> 10.6. To
>> change requires linking with:
>>    -mmacosx-version-min=10.5
>> (and possibly compiling against the 10.5 SDK, though that shouldn't  
>> be
>> needed since the GHC build should use nothing from the 10.6 SDK  
>> that isn't
>> in the 10.5 SDK.)
>
> So is this something the ghc devs need to fix in the osx build  
> scripts?
> Given this info, would it be easy enough for an OSX hacker to prepare
> and test a patch for the ghc build system? Perhaps we can find a
> volunteer to try this. We noticed at the recent Haskell Implementors
> Workshop that most of the Haskell hackers in the room were now OSX
> users, so we ought to be able to find volunteers.
>
> Duncan
>
>
> _______________________________________________
> Haskell-platform mailing list
> Haskell-platform@...
> http://projects.haskell.org/cgi-bin/mailman/listinfo/haskell-platform
haskell-platform | 24 Oct 03:23 2011

#186: Intall fail on OSX 10.7.2/Xcode 4.2

#186: Intall fail on OSX 10.7.2/Xcode 4.2
---------------------------+------------------------------------------------
 Reporter:  moilejter      |       Owner:  gregorycollins
     Type:  defect         |      Status:  new           
 Priority:  major          |   Milestone:  2011.x.0.0    
Component:  OSX installer  |    Keywords:                
---------------------------+------------------------------------------------
 After updating my OSX to 10.7.2, and my Xcode to 4.2, I tried to install
 the Haskell platform on my computer, using the most current release.  When
 I try to install either the 32-bit or 64-bit versions, I get an error that
 says that the installer failed, because it could not find software to
 install...

--

-- 
Ticket URL: <http://trac.haskell.org/haskell-platform/ticket/186>
haskell-platform <http://trac.haskell.org/haskell-platform>
The Haskell Platform: a comprehensive and robust collection of Haskell libraries
haskell-platform | 24 Oct 18:36 2011

Re: #186: Intall fail on OSX 10.7.2/Xcode 4.2

#186: Intall fail on OSX 10.7.2/Xcode 4.2
---------------------------+------------------------------------------------
 Reporter:  moilejter      |        Owner:  MtnViewMark
     Type:  defect         |       Status:  new        
 Priority:  major          |    Milestone:  2011.x.0.0 
Component:  OSX installer  |   Resolution:             
 Keywords:                 |  
---------------------------+------------------------------------------------
Changes (by gregorycollins):

  * owner:  gregorycollins => MtnViewMark

--

-- 
Ticket URL: <http://trac.haskell.org/haskell-platform/ticket/186#comment:1>
haskell-platform <http://trac.haskell.org/haskell-platform>
The Haskell Platform: a comprehensive and robust collection of Haskell libraries

Gmane