Use EntryLabel to represent block labels
Needs RevisionPublic

Authored by bgamari on Sep 24 2017, 8:24 AM.

Details

Summary

This hopefully fixes Trac #14264 after a long road of breakage,

  • D3977 refactored the backend to use mkAsmTempLabel (through BlockId.blockLbl) to produce labels for BlockIds as this is what the NCG did. This fixes Trac #14221.
  • This in turn broke the LLVM and unregisterised backends (Trac #14264)
  • D4014 attempted to fix this by removing an assertion, fixing the LLVM backend but leaving the unregisterised configuration broken
  • b3ae47caf2f23cfd2c22c29dbfca646493ffe469 restored the assertion but still didn't fix the underlying problem: that AsmTempLabels aren't supported by the unregisterised backend.

This hopefully fixes this by using proper EntryLabels to represent block labels.

Test Plan

Validate, Build in LLVM and unregisterised configurations

bgamari created this revision.Sep 24 2017, 8:24 AM
trofi accepted this revision.Sep 24 2017, 11:08 AM
This revision is now accepted and ready to land.Sep 24 2017, 11:08 AM
angerman requested changes to this revision.Sep 24 2017, 8:56 PM

Building the quick flavor (NCG) on macOS with this patch results in

ghc-stage2: internal error: ghc-stage2: internal error: ghc-stage2: internal error: evacuate(static): strange closure type 418407935evacuate(static): strange closure type 418407935evacuate(static): strange closure type 418407935

for me.

This revision now requires changes to proceed.Sep 24 2017, 8:56 PM
trofi requested changes to this revision.Nov 6 2017, 8:18 AM

This change also seems to break dynamic build:

    Call hs_init_ghc() from your main() function to set these options.
/usr/lib/gcc/x86_64-pc-linux-gnu/4.8.4/../../../../x86_64-pc-linux-gnu/bin/ld: compiler/stage2/build/X86/CodeGen.dyn_o: warning: relocation against `c4FDO_entry' in readonly section `.rodata'.
/usr/lib/gcc/x86_64-pc-linux-gnu/4.8.4/../../../../x86_64-pc-linux-gnu/bin/ld: compiler/stage2/build/CoreUtils.dyn_o: relocation R_X86_64_PC32 against undefined symbol `cKsC_entry' can not be used when making a shared object; recompile with -fPIC
/usr/lib/gcc/x86_64-pc-linux-gnu/4.8.4/../../../../x86_64-pc-linux-gnu/bin/ld: final link failed: Bad value
collect2: error: ld returned 1 exit status