Skip to content

Hadrian: ld crashes linking HStime on macos

@snowleopard @alp

This commit e529c65e is where the breakage happens.

Summary

MacOS 10.14.5, xcode 10.2 and 10.2.1, ld crashes in stage 1 linking Hstime.

Steps to reproduce

Build commands:

git clone https://gitlab.haskell.org/ghc/ghc.git
cd ghc
git submodule update --init --recursive
stack build --stack-yaml=hadrian/stack.yaml --only-dependencies
hadrian/build.stack.sh --configure --flavour=quickest -j

The error :

0  0x1052e2748  __assert_rtn + 129
1  0x1052be30f  ld::Fixup::Fixup(unsigned int, ld::Fixup::Cluster, ld::Fixup::Kind, bool, char const*) + 95
2  0x1052e8736  mach_o::relocatable::Parser<x86_64>::addFixup(mach_o::relocatable::Parser<x86_64>::SourceLocation const&, ld::Fixup::Cluster, ld::Fixup::Kind, bool, char const*) + 34
3  0x1052eaa9c  mach_o::relocatable::Section<x86_64>::addRelocFixup(mach_o::relocatable::Parser<x86_64>&, macho_relocation_info<Pointer64<LittleEndian> > const*) + 1722
4  0x1052ff61b  mach_o::relocatable::Section<x86_64>::makeFixups(mach_o::relocatable::Parser<x86_64>&, mach_o::relocatable::Parser<x86_64>::CFI_CU_InfoArrays const&) + 105
5  0x1052faa66  mach_o::relocatable::Parser<x86_64>::parse(mach_o::relocatable::ParserOptions const&) + 2120
6  0x1052f1250  mach_o::relocatable::Parser<x86_64>::parse(unsigned char const*, unsigned long long, char const*, long, ld::File::Ordinal, mach_o::relocatable::ParserOptions const&) + 282
7  0x10534352a  ld::tool::InputFiles::makeFile(Options::FileInfo const&, bool) + 808
8  0x105345f22  ld::tool::InputFiles::parseWorkerThread() + 530
9  0x7fff70a6b2eb  _pthread_body + 126
10  0x7fff70a6e249  _pthread_start + 66
A linker snapshot was created at:
	/tmp/HStime-1.9.2.o-2019-04-22-132113.ld-snapshot
ld: Assertion failed: (name != NULL), function Fixup, file /Library/Caches/com.apple.xbs/Sources/ld64/ld64-450.3/src/ld/ld.hpp, line 724.
)

This happens with at least ghc 8.6.4, resolvers lts-13.14 and lts-13.21.

Edited by Shayne Fletcher
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information