Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Haskell Compiler (ghc) with ld.gold
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
NTICompass
Apprentice
Apprentice


Joined: 11 Jun 2008
Posts: 171
Location: /home/nticompass/

PostPosted: Thu Sep 18, 2014 12:14 pm    Post subject: Haskell Compiler (ghc) with ld.gold Reply with quote

I am using ld.gold (because I feel like it) and I was having trouble with dev-lang/ghc. Version 7.6.3-r1 won't compile because gold doesn't support the --hash-size=31 (or --reduce-memory-overheads) option. Even after changing the /usr/lib/ghc-7.6.3/settings file, it still didn't compile.

To try to fix this, I keyworded ghc-7.8.3 and tried to install it. It all worked... until the end. I got the error shown here: https://ghc.haskell.org/trac/ghc/ticket/7452

They have fixed that bug, and there are patches posted in the bug's comments.

Would it possible to apply the patch to gentoo's ghc-7.8.3 ebuild? Here's the patch: https://git.haskell.org/ghc.git/commitdiff/021b7978d14799bae779907faf7490cfd21b3f46

This should make ghc-7.8.3 work with gold.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54237
Location: 56N 3W

PostPosted: Thu Sep 18, 2014 7:08 pm    Post subject: Reply with quote

NTICompass,

The ghc ghc-7.8.3 ebuild does not contain epatchuser or it would be easy. You need to do it the harder way.

Follow the Gentoo Handbook to set up a local overlay. Mine is in /usr/local/portage
This prevents emerge --sync removing all of your hard work.

Copy /usr/portage/dev-lang/ghc/* to your overlay, which will give you /usr/local/portage/dev-lang/ghc/
You don't need it all but its harmless.

Put your new patch into /usr/local/portage/dev-lang/ghc/files/ you can call it anything but you will need the name in the next step.
Edit /usr/local/portage/dev-lang/ghc/ghc-7.8.3.ebuild and add a new epatch line to the file at the end of the existing epatch statements.
Copy the last one
Code:
 epatch "${FILESDIR}"/${PN}-7.8.3-ia64-prim.patch
and edit the copy to apply your patch.
Save the change.
emerge will detect that the ebuild has be tampered with, to fix that run
Code:
ebuild /usr/local/portage/dev-lang/ghc/ghc-7.8.3.ebuild manifest
to regenerate the digests.

If all is well, portage will use the ebuild from your overlay, which will apply the patch.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
NTICompass
Apprentice
Apprentice


Joined: 11 Jun 2008
Posts: 171
Location: /home/nticompass/

PostPosted: Thu Sep 18, 2014 7:25 pm    Post subject: Reply with quote

NeddySeagoon wrote:
NTICompass,

The ghc ghc-7.8.3 ebuild does not contain epatchuser or it would be easy. You need to do it the harder way.

Follow the Gentoo Handbook to set up a local overlay. Mine is in /usr/local/portage
This prevents emerge --sync removing all of your hard work.

Copy /usr/portage/dev-lang/ghc/* to your overlay, which will give you /usr/local/portage/dev-lang/ghc/
You don't need it all but its harmless.

Put your new patch into /usr/local/portage/dev-lang/ghc/files/ you can call it anything but you will need the name in the next step.
Edit /usr/local/portage/dev-lang/ghc/ghc-7.8.3.ebuild and add a new epatch line to the file at the end of the existing epatch statements.
Copy the last one
Code:
 epatch "${FILESDIR}"/${PN}-7.8.3-ia64-prim.patch
and edit the copy to apply your patch.
Save the change.
emerge will detect that the ebuild has be tampered with, to fix that run
Code:
ebuild /usr/local/portage/dev-lang/ghc/ghc-7.8.3.ebuild manifest
to regenerate the digests.

If all is well, portage will use the ebuild from your overlay, which will apply the patch.


Thanks a lot for showing me how to modify and use my own ebuilds! :-D

If this patch is useful for others, would it be possible to include it with the ebuild officially?
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54237
Location: 56N 3W

PostPosted: Thu Sep 18, 2014 7:31 pm    Post subject: Reply with quote

NTICompass,

File a bug at bugs.gentoo.org
Include the patch in the bug, not a link to the source.
Also include a credit to the patch author(s) if you can find them. At least, make it clear its not your own work.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
NTICompass
Apprentice
Apprentice


Joined: 11 Jun 2008
Posts: 171
Location: /home/nticompass/

PostPosted: Thu Sep 18, 2014 7:33 pm    Post subject: Reply with quote

NeddySeagoon wrote:
NTICompass,

File a bug at bugs.gentoo.org
Include the patch in the bug, not a link to the source.
Also include a credit to the patch author(s) if you can find them. At least, make it clear its not your own work.


OK. I'll test the patch out myself, and if it works, then I'll post a bug report with it :-)
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54237
Location: 56N 3W

PostPosted: Thu Sep 18, 2014 7:47 pm    Post subject: Reply with quote

NTICompass,

That sounds like a plan. Then you can detail how you tested it. Put your emerge --info output in the bug.
You can then say Works For Me (if it works).

The idea is to make the devs job easy, so they act on your bug report, with the solution attached.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum