[BACK]Return to patch-rts_StgCRun.c CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / pkgsrc / lang / ghc7 / patches

File: [cvs.NetBSD.org] / pkgsrc / lang / ghc7 / patches / Attic / patch-rts_StgCRun.c (download)

Revision 1.2, Thu Feb 5 00:59:10 2015 UTC (5 years, 5 months ago) by pho
Branch: MAIN
CVS Tags: pkgsrc-2019Q4-base, pkgsrc-2019Q4, pkgsrc-2019Q3-base, pkgsrc-2019Q3, pkgsrc-2019Q2-base, pkgsrc-2019Q2, pkgsrc-2019Q1-base, pkgsrc-2019Q1, pkgsrc-2018Q4-base, pkgsrc-2018Q4, pkgsrc-2018Q3-base, pkgsrc-2018Q3, pkgsrc-2018Q2-base, pkgsrc-2018Q2, pkgsrc-2018Q1-base, pkgsrc-2018Q1, pkgsrc-2017Q4-base, pkgsrc-2017Q4, pkgsrc-2017Q3-base, pkgsrc-2017Q3, pkgsrc-2017Q2-base, pkgsrc-2017Q2, pkgsrc-2017Q1-base, pkgsrc-2017Q1, pkgsrc-2016Q4-base, pkgsrc-2016Q4, pkgsrc-2016Q3-base, pkgsrc-2016Q3, pkgsrc-2016Q2-base, pkgsrc-2016Q2, pkgsrc-2016Q1-base, pkgsrc-2016Q1, pkgsrc-2015Q4-base, pkgsrc-2015Q4, pkgsrc-2015Q3-base, pkgsrc-2015Q3, pkgsrc-2015Q2-base, pkgsrc-2015Q2, pkgsrc-2015Q1-base, pkgsrc-2015Q1
Changes since 1.1: +3 -1 lines

Add upstream Trac URL to patches/patch-rts_StgCRun.c

$NetBSD: patch-rts_StgCRun.c,v 1.2 2015/02/05 00:59:10 pho Exp $

We have to make the visiblity of StgRun and StgReturn to "hidden" not
to trigger a bug in old binutils which results in:

   ld: rts/dist/build/RtsStartup.dyn_o: relocation R_X86_64_PC32
   against `StgRun' can not be used when making a shared object;
   recompile with -fPIC

With this workaround we can no longer override those two symbols using
LD_PRELOAD, but I think there is no reason to do so anyway.

This has already been fixed in the upstream:
https://ghc.haskell.org/trac/ghc/ticket/7813

--- rts/StgCRun.c.orig	2013-01-27 13:21:52.000000000 +0000
+++ rts/StgCRun.c
@@ -246,6 +246,7 @@ StgRunIsImplementedInAssembler(void)
          * save callee-saves registers on behalf of the STG code.
          */
         ".globl " STG_RUN "\n"
+        ".hidden " STG_RUN "\n"
         STG_RUN ":\n\t"
         "subq %1, %%rsp\n\t"
         "movq %%rsp, %%rax\n\t"
@@ -280,6 +281,7 @@ StgRunIsImplementedInAssembler(void)
         "jmp *%%rax\n\t"
 
         ".globl " STG_RETURN "\n"
+        ".hidden " STG_RETURN "\n"
          STG_RETURN ":\n\t"
 
         "movq %%rbx, %%rax\n\t"   /* Return value in R1  */