X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2FnativeGen%2FPositionIndependentCode.hs;h=ffd65773c7c79fe1ea5930841b4aecd818f633de;hb=4706dd570b3426eeb08be9451e12e036c171de92;hp=0daccb65309976a2de0743982974cffb99718747;hpb=0065d5ab628975892cea1ec7303f968c3338cbe1;p=ghc-hetmet.git diff --git a/compiler/nativeGen/PositionIndependentCode.hs b/compiler/nativeGen/PositionIndependentCode.hs index 0daccb6..ffd6577 100644 --- a/compiler/nativeGen/PositionIndependentCode.hs +++ b/compiler/nativeGen/PositionIndependentCode.hs @@ -175,6 +175,11 @@ howToAccessLabel _ lbl | labelDynamic lbl = AccessViaSymbolPtr -- It is always possible to access something indirectly, -- even when it's not necessary. +#if powerpc_TARGET_ARCH || powerpc64_TARGET_ARCH + -- on i386 and probably also on x86_64, dyld code stubs don't + -- work for tailcalls because the stack alignment is only right + -- for regular calls. + howToAccessLabel True lbl -- jumps to a dynamic library go via a symbol stub | labelDynamic lbl = AccessViaStub @@ -186,7 +191,8 @@ howToAccessLabel True lbl -- we'd need to pass the current Module all the way in to -- this function. | opt_PIC && externallyVisibleCLabel lbl = AccessViaStub -howToAccessLabel False lbl +#endif +howToAccessLabel _ lbl -- data access to a dynamic library goes via a symbol pointer | labelDynamic lbl = AccessViaSymbolPtr -- cross-module PIC references: same as above