Make `derivedConstants` more crosscompile-friendly
ClosedPublic

Authored by hvr on Nov 18 2015, 5:06 PM.

Details

Summary

derivedConstants currently uses System.Info.os for decisions (which
doesn't necessarily reflect the build-target), as well as hardcoding
"/usr/bin/objdump" for openbsd.

This patch auto-detects objdump similiar to how nm is detected via
Autoconf as well as passing the target-os into derivedConstants via
commandline.

Diff Detail

Repository
rGHC Glasgow Haskell Compiler
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
hvr updated this revision to Diff 5195.Nov 18 2015, 5:06 PM
hvr retitled this revision from to Make `derivedConstants` more crosscompile-friendly.
hvr updated this object.
hvr edited the test plan for this revision. (Show Details)
hvr added a reviewer: bgamari.
hvr updated this revision to Diff 5196.Nov 18 2015, 5:12 PM
hvr edited edge metadata.

forgot a patch hunk

hvr added a reviewer: erikd.Nov 19 2015, 1:17 AM

adding @erikd as afaik he does build GHC as cross-compiler from time to time

hvr updated this revision to Diff 5201.Nov 19 2015, 1:23 AM
hvr edited edge metadata.

moved change here that sneaked into D1500 instead (that's why D1500 validates)

erikd edited edge metadata.Nov 19 2015, 1:29 AM

This certainly looks very reasonable. Has it been tested on OpenBSD?

hvr added a reviewer: kgardas.Nov 19 2015, 1:32 AM
hvr added a subscriber: kgardas.
In D1499#43877, @erikd wrote:

This certainly looks very reasonable. Has it been tested on OpenBSD?

Nope, only on AIX (see D1500)

Maybe @kgardas can confirm?

kgardas accepted this revision.Nov 19 2015, 3:42 AM
kgardas edited edge metadata.

Tested on OpenBSD/AMD64 and Solaris/i386. Builds fine.

This revision is now accepted and ready to land.Nov 19 2015, 3:42 AM
erikd accepted this revision.Nov 19 2015, 3:58 AM
erikd edited edge metadata.
bgamari accepted this revision.Nov 19 2015, 4:51 AM
bgamari edited edge metadata.

Looks good to me.

This revision was automatically updated to reflect the committed changes.