X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2Fcmm%2FCLabel.hs;h=3ceb982e7654e3548b6d36fd498f89c0dff8110d;hb=836b1e90821aacc9d1e09fe78085f911597274c8;hp=4fd0d3a0fec7951f79902e7c18165dc0abbc8f89;hpb=7854ec4b11e117f8514553890851d14a66690fbb;p=ghc-hetmet.git diff --git a/compiler/cmm/CLabel.hs b/compiler/cmm/CLabel.hs index 4fd0d3a..3ceb982 100644 --- a/compiler/cmm/CLabel.hs +++ b/compiler/cmm/CLabel.hs @@ -596,7 +596,15 @@ needsCDecl ModuleRegdLabel = False needsCDecl (StringLitLabel _) = False needsCDecl (AsmTempLabel _) = False needsCDecl (RtsLabel _) = False -needsCDecl (CmmLabel _ _ _) = True + +needsCDecl (CmmLabel pkgId _ _) + -- Prototypes for labels defined in the runtime system are imported + -- into HC files via includes/Stg.h. + | pkgId == rtsPackageId = False + + -- For other labels we inline one into the HC file directly. + | otherwise = True + needsCDecl l@(ForeignLabel{}) = not (isMathFun l) needsCDecl (CC_Label _) = True needsCDecl (CCS_Label _) = True @@ -800,13 +808,13 @@ labelDynamic this_pkg lbl = -- is the RTS in a DLL or not? RtsLabel _ -> not opt_Static && (this_pkg /= rtsPackageId) + IdLabel n _ k -> isDllName this_pkg n + +#if mingw32_TARGET_OS -- When compiling in the "dyn" way, eack package is to be linked into its own shared library. CmmLabel pkg _ _ -> not opt_Static && (this_pkg /= pkg) - IdLabel n _ k -> isDllName this_pkg n - -#if mingw32_TARGET_OS -- Foreign label is in some un-named foreign package (or DLL) ForeignLabel _ _ ForeignLabelInExternalPackage _ -> True @@ -823,6 +831,8 @@ labelDynamic this_pkg lbl = -- so we claim that all foreign imports come from dynamic libraries ForeignLabel _ _ _ _ -> True + CmmLabel pkg _ _ -> True + #endif ModuleInitLabel m _ -> not opt_Static && this_pkg /= (modulePackageId m) PlainModuleInitLabel m -> not opt_Static && this_pkg /= (modulePackageId m) @@ -1091,7 +1101,7 @@ pprDynamicLinkerAsmLabel SymbolPtr lbl pprDynamicLinkerAsmLabel _ _ = panic "pprDynamicLinkerAsmLabel" -#elif powerpc_TARGET_ARCH && linux_TARGET_OS +#elif powerpc_TARGET_ARCH && elf_OBJ_FORMAT pprDynamicLinkerAsmLabel CodeStub lbl = pprCLabel lbl <> text "@plt" pprDynamicLinkerAsmLabel SymbolPtr lbl @@ -1099,7 +1109,7 @@ pprDynamicLinkerAsmLabel SymbolPtr lbl pprDynamicLinkerAsmLabel _ _ = panic "pprDynamicLinkerAsmLabel" -#elif x86_64_TARGET_ARCH && linux_TARGET_OS +#elif x86_64_TARGET_ARCH && elf_OBJ_FORMAT pprDynamicLinkerAsmLabel CodeStub lbl = pprCLabel lbl <> text "@plt" pprDynamicLinkerAsmLabel GotSymbolPtr lbl @@ -1109,7 +1119,7 @@ pprDynamicLinkerAsmLabel GotSymbolOffset lbl pprDynamicLinkerAsmLabel SymbolPtr lbl = text ".LC_" <> pprCLabel lbl -#elif linux_TARGET_OS +#elif elf_OBJ_FORMAT pprDynamicLinkerAsmLabel CodeStub lbl = pprCLabel lbl <> text "@plt" pprDynamicLinkerAsmLabel SymbolPtr lbl