struggling to get master to build

Norman Ramsey nr at cs.tufts.edu
Fri Feb 18 16:56:41 UTC 2022


I recently pulled to bring my local copy of GHC HEAD up to
67dd5724297094af93be1887ef000845722c6f2b.  But I cannot seem
to get it to build.

I'm following these steps:

  git pull --ff-only --prune --recurse-submodules --force

  rm -r _build

  ./boot

  ./configure

  ./hadrian build -j

The build is failing with this error message:

  Warning: -rtsopts and -with-rtsopts have no effect with -shared.
      Call hs_init_ghc() from your main() function to set these options.
  ld.lld: error: can't create dynamic relocation R_X86_64_64 against local symbol in readonly segment; recompile object files with -fPIC or pass '-Wl,-z,notext' to allow text relocations in the output
  >>> defined in _build/stage1/rts/build/S/adjustor/NativeAmd64Asm.thr_dyn_o
  >>> referenced by _build/stage1/rts/build/S/adjustor/NativeAmd64Asm.thr_dyn_o:(.text+0x50)
  collect2: error: ld returned 1 exit status
  `cc' failed in phase `Linker'. (Exit code: 1)
  Command failed
  Build failed.

The offending command is very long indeed; it is appended to this message.

What am I doing wrong, and what do I need to change?


Norman



Command line: _build/stage0/bin/ghc -Wall -Wcompat -hisuf thr_dyn_hi -osuf thr_dyn_o -hcsuf thr_dyn_hc -fPIC -dynamic -optc-DTHREADED_RTS -hide-all-packages -no-user-package-db '-package-env -' '-package-db _build/stage1/lib/package.conf.d' '-this-unit-id rts-1.0.2' -i -i/home/nr/asterius/ghc/_build/stage1/rts/build -i/home/nr/asterius/ghc/_build/stage1/rts/build/autogen -i/home/nr/asterius/ghc/rts -Irts/include -I_build/stage1/rts/build -I_build/stage1/rts/build/include -Irts/include -optP-include -optP_build/stage1/rts/build/autogen/cabal_macros.h -ghcversion-file=rts/include/ghcversion.h -outputdir _build/stage1/rts/build -fdiagnostics-color=always -dynamic -shared -dynload deploy -optl-Wl,-rpath,$ORIGIN -optl-Wl,-zorigin -fno-use-rpaths -no-auto-link-packages -rtsopts -lc -lm -lrt -ldl -lpthread -lnuma -L_build/stage1/rts/build -lffi -Wnoncanonical-monad-instances -optc-Wno-error=inline -optP-Wno-nonportable-include-path _build/stage1/rts/build/S/adjustor/NativeAmd64Asm.thr_dyn_o _build/stage1/rts/build/c/Adjustor.thr_dyn_o _build/stage1/rts/build/c/adjustor/AdjustorPool.thr_dyn_o _build/stage1/rts/build/c/ExecPage.thr_dyn_o _build/stage1/rts/build/c/Arena.thr_dyn_o _build/stage1/rts/build/c/Capability.thr_dyn_o _build/stage1/rts/build/c/CheckUnload.thr_dyn_o _build/stage1/rts/build/c/CloneStack.thr_dyn_o _build/stage1/rts/build/c/ClosureFlags.thr_dyn_o _build/stage1/rts/build/c/ClosureSize.thr_dyn_o _build/stage1/rts/build/c/Disassembler.thr_dyn_o _build/stage1/rts/build/c/FileLock.thr_dyn_o _build/stage1/rts/build/c/ForeignExports.thr_dyn_o _build/stage1/rts/build/c/Globals.thr_dyn_o _build/stage1/rts/build/c/Hash.thr_dyn_o _build/stage1/rts/build/c/Heap.thr_dyn_o _build/stage1/rts/build/c/Hpc.thr_dyn_o _build/stage1/rts/build/c/HsFFI.thr_dyn_o _build/stage1/rts/build/c/Inlines.thr_dyn_o _build/stage1/rts/build/c/Interpreter.thr_dyn_o _build/stage1/rts/build/c/IOManager.thr_dyn_o _build/stage1/rts/build/c/LdvProfile.thr_dyn_o _build/stage1/rts/build/c/Libdw.thr_dyn_o _build/stage1/rts/build/c/LibdwPool.thr_dyn_o _build/stage1/rts/build/c/Linker.thr_dyn_o _build/stage1/rts/build/c/ReportMemoryMap.thr_dyn_o _build/stage1/rts/build/c/Messages.thr_dyn_o _build/stage1/rts/build/c/OldARMAtomic.thr_dyn_o _build/stage1/rts/build/c/PathUtils.thr_dyn_o _build/stage1/rts/build/c/Pool.thr_dyn_o _build/stage1/rts/build/c/Printer.thr_dyn_o _build/stage1/rts/build/c/ProfHeap.thr_dyn_o _build/stage1/rts/build/c/ProfilerReport.thr_dyn_o _build/stage1/rts/build/c/ProfilerReportJson.thr_dyn_o _build/stage1/rts/build/c/Profiling.thr_dyn_o _build/stage1/rts/build/c/IPE.thr_dyn_o _build/stage1/rts/build/c/Proftimer.thr_dyn_o _build/stage1/rts/build/c/RaiseAsync.thr_dyn_o _build/stage1/rts/build/c/RetainerProfile.thr_dyn_o _build/stage1/rts/build/c/RetainerSet.thr_dyn_o _build/stage1/rts/build/c/RtsAPI.thr_dyn_o _build/stage1/rts/build/c/RtsDllMain.thr_dyn_o _build/stage1/rts/build/c/RtsFlags.thr_dyn_o _build/stage1/rts/build/c/RtsMain.thr_dyn_o _build/stage1/rts/build/c/RtsMessages.thr_dyn_o _build/stage1/rts/build/c/RtsStartup.thr_dyn_o _build/stage1/rts/build/c/RtsSymbolInfo.thr_dyn_o _build/stage1/rts/build/c/RtsSymbols.thr_dyn_o _build/stage1/rts/build/c/RtsUtils.thr_dyn_o _build/stage1/rts/build/c/STM.thr_dyn_o _build/stage1/rts/build/c/Schedule.thr_dyn_o _build/stage1/rts/build/c/Sparks.thr_dyn_o _build/stage1/rts/build/c/SpinLock.thr_dyn_o _build/stage1/rts/build/c/StableName.thr_dyn_o _build/stage1/rts/build/c/StablePtr.thr_dyn_o _build/stage1/rts/build/c/StaticPtrTable.thr_dyn_o _build/stage1/rts/build/c/Stats.thr_dyn_o _build/stage1/rts/build/c/StgCRun.thr_dyn_o _build/stage1/rts/build/c/StgPrimFloat.thr_dyn_o _build/stage1/rts/build/c/Task.thr_dyn_o _build/stage1/rts/build/c/ThreadLabels.thr_dyn_o _build/stage1/rts/build/c/ThreadPaused.thr_dyn_o _build/stage1/rts/build/c/Threads.thr_dyn_o _build/stage1/rts/build/c/Ticky.thr_dyn_o _build/stage1/rts/build/c/Timer.thr_dyn_o _build/stage1/rts/build/c/TopHandler.thr_dyn_o _build/stage1/rts/build/c/Trace.thr_dyn_o _build/stage1/rts/build/c/TraverseHeap.thr_dyn_o _build/stage1/rts/build/c/TraverseHeapTest.thr_dyn_o _build/stage1/rts/build/c/WSDeque.thr_dyn_o _build/stage1/rts/build/c/Weak.thr_dyn_o _build/stage1/rts/build/c/eventlog/EventLog.thr_dyn_o _build/stage1/rts/build/c/eventlog/EventLogWriter.thr_dyn_o _build/stage1/rts/build/c/hooks/FlagDefaults.thr_dyn_o _build/stage1/rts/build/c/hooks/LongGCSync.thr_dyn_o _build/stage1/rts/build/c/hooks/MallocFail.thr_dyn_o _build/stage1/rts/build/c/hooks/OnExit.thr_dyn_o _build/stage1/rts/build/c/hooks/OutOfHeap.thr_dyn_o _build/stage1/rts/build/c/hooks/StackOverflow.thr_dyn_o _build/stage1/rts/build/c/linker/CacheFlush.thr_dyn_o _build/stage1/rts/build/c/linker/Elf.thr_dyn_o _build/stage1/rts/build/c/linker/LoadArchive.thr_dyn_o _build/stage1/rts/build/c/linker/M32Alloc.thr_dyn_o _build/stage1/rts/build/c/linker/MMap.thr_dyn_o _build/stage1/rts/build/c/linker/MachO.thr_dyn_o _build/stage1/rts/build/c/linker/macho/plt.thr_dyn_o _build/stage1/rts/build/c/linker/macho/plt_aarch64.thr_dyn_o _build/stage1/rts/build/c/linker/PEi386.thr_dyn_o _build/stage1/rts/build/c/linker/SymbolExtras.thr_dyn_o _build/stage1/rts/build/c/linker/elf_got.thr_dyn_o _build/stage1/rts/build/c/linker/elf_plt.thr_dyn_o _build/stage1/rts/build/c/linker/elf_plt_aarch64.thr_dyn_o _build/stage1/rts/build/c/linker/elf_plt_arm.thr_dyn_o _build/stage1/rts/build/c/linker/elf_reloc.thr_dyn_o _build/stage1/rts/build/c/linker/elf_reloc_aarch64.thr_dyn_o _build/stage1/rts/build/c/linker/elf_tlsgd.thr_dyn_o _build/stage1/rts/build/c/linker/elf_util.thr_dyn_o _build/stage1/rts/build/c/sm/BlockAlloc.thr_dyn_o _build/stage1/rts/build/c/sm/CNF.thr_dyn_o _build/stage1/rts/build/c/sm/Compact.thr_dyn_o _build/stage1/rts/build/c/sm/Evac.thr_dyn_o _build/stage1/rts/build/c/sm/Evac_thr.thr_dyn_o _build/stage1/rts/build/c/sm/GC.thr_dyn_o _build/stage1/rts/build/c/sm/GCAux.thr_dyn_o _build/stage1/rts/build/c/sm/GCUtils.thr_dyn_o _build/stage1/rts/build/c/sm/MBlock.thr_dyn_o _build/stage1/rts/build/c/sm/MarkWeak.thr_dyn_o _build/stage1/rts/build/c/sm/NonMoving.thr_dyn_o _build/stage1/rts/build/c/sm/NonMovingCensus.thr_dyn_o _build/stage1/rts/build/c/sm/NonMovingMark.thr_dyn_o _build/stage1/rts/build/c/sm/NonMovingScav.thr_dyn_o _build/stage1/rts/build/c/sm/NonMovingShortcut.thr_dyn_o _build/stage1/rts/build/c/sm/NonMovingSweep.thr_dyn_o _build/stage1/rts/build/c/sm/Sanity.thr_dyn_o _build/stage1/rts/build/c/sm/Scav.thr_dyn_o _build/stage1/rts/build/c/sm/Scav_thr.thr_dyn_o _build/stage1/rts/build/c/sm/Storage.thr_dyn_o _build/stage1/rts/build/c/sm/Sweep.thr_dyn_o _build/stage1/rts/build/c/fs.thr_dyn_o _build/stage1/rts/build/c/adjustor/NativeAmd64.thr_dyn_o _build/stage1/rts/build/c/posix/GetEnv.thr_dyn_o _build/stage1/rts/build/c/posix/GetTime.thr_dyn_o _build/stage1/rts/build/c/posix/Ticker.thr_dyn_o _build/stage1/rts/build/c/posix/OSMem.thr_dyn_o _build/stage1/rts/build/c/posix/OSThreads.thr_dyn_o _build/stage1/rts/build/c/posix/Select.thr_dyn_o _build/stage1/rts/build/c/posix/Signals.thr_dyn_o _build/stage1/rts/build/c/posix/TTY.thr_dyn_o _build/stage1/rts/build/cmm/Apply.thr_dyn_o _build/stage1/rts/build/cmm/Compact.thr_dyn_o _build/stage1/rts/build/cmm/Exception.thr_dyn_o _build/stage1/rts/build/cmm/HeapStackCheck.thr_dyn_o _build/stage1/rts/build/cmm/PrimOps.thr_dyn_o _build/stage1/rts/build/cmm/StgMiscClosures.thr_dyn_o _build/stage1/rts/build/cmm/StgStartup.thr_dyn_o _build/stage1/rts/build/cmm/StgStdThunks.thr_dyn_o _build/stage1/rts/build/cmm/Updates.thr_dyn_o _build/stage1/rts/build/cmm/AutoApply.thr_dyn_o -o _build/stage1/rts/build/libHSrts-1.0.2_thr-ghc9.3.20220217.so -O2 -H32m -this-unit-id rts -XHaskell98 -no-global-package-db -package-db=/home/nr/asterius/ghc/_build/stage1/lib/package.conf.d -ghcversion-file=rts/include/ghcversion.h -haddock -Irts -I_build/stage1/rts/build '-DRtsWay="rts_thr_dyn"' -DFS_NAMESPACE=rts -DCOMPILING_RTS -DTHREADED_RTS -Wno-deprecated-flags -Wcpp-undef
===> Command failed with error code: 1


More information about the ghc-devs mailing list