Skip to content
This repository has been archived by the owner on Aug 2, 2020. It is now read-only.

Use GHC to compile C files #380

Merged
merged 1 commit into from
Jul 29, 2017
Merged

Use GHC to compile C files #380

merged 1 commit into from
Jul 29, 2017

Conversation

izgzhen
Copy link
Collaborator

@izgzhen izgzhen commented Jul 28, 2017

@izgzhen izgzhen changed the title Use GHC to compiler C files Use GHC to compile C files Jul 28, 2017
@izgzhen
Copy link
Collaborator Author

izgzhen commented Jul 28, 2017

The CI result is a bit funny -- Linux failed, OS X and Windows are fine.

@snowleopard
Copy link
Owner

Yep, looks like something platform-specific:

$ inplace/bin/ghc-stage2 -e 1+2
ghc-stage2: /home/travis/build/snowleopard/hadrian/ghc/_build/stage1/libraries/base/HSbase-4.10.0.0.o: unknown symbol `stat'
ghc-stage2: unable to load package `base-4.10.0.0'

In general, the PR looks fine, but I'd rename GHCCompileC to CompileCWithGhc.

@izgzhen
Copy link
Collaborator Author

izgzhen commented Jul 28, 2017

Hmm, reproduced on my own Linux box ... will try to fix later

cppArgs <- getPkgDataList CppArgs
mconcat [ arg "-Wall"
, includeGhcArgs
, packageGhcArgs
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this include commonGhcArgs as well? On my machine I noticed that this patch resulted in linker errors apparently due to missing -fPIC flags during the RTS build. Presumably this is the reason.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed, thanks

@snowleopard snowleopard merged commit e6dcd1b into snowleopard:master Jul 29, 2017
@snowleopard
Copy link
Owner

Looks good, merged!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants