Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Register
  • Sign in
  • GHC GHC
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
    • Locked files
  • Issues 5.5k
    • Issues 5.5k
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 634
    • Merge requests 634
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Artifacts
    • Schedules
    • Test cases
  • Deployments
    • Deployments
    • Releases
  • Packages and registries
    • Packages and registries
    • Model experiments
  • Analytics
    • Analytics
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Glasgow Haskell CompilerGlasgow Haskell Compiler
  • GHCGHC
  • Issues
  • #20218

Don't link plugins with target code

I'm working on #14335: supporting plugins with -fexternal-interpreter by having them use their own environment which uses the internal interpreter. However it turns out that GHC links plugins with target code at least in some cases, which makes the linking phase fails.

With the most simple example -- a plugin that does nothing used to compile a program that does nothing -- we get the following linker invocation:

cc '-fuse-ld=lld' -Wl,--no-as-needed -o DumbProgram -no-pie -fPIC -U__PIC__ -D__PIC__ -Wl,--gc-sections TXXXXX.o '-L/tmp/ghctest-tqzmgxss/test   spaces/testsuite/tests/plugins/TXXXXX.run/simple-plugin/pkg.TXXXXX/install/lib/x86_64-linux-ghc-9.3.20210804' -Xlinker -rpath-link -Xlinker '/tmp/ghctest-tqzmgxss/test   spaces/testsuite/tests/plugins/TXXXXX.run/simple-plugin/pkg.TXXXXX/install/lib/x86_64-linux-ghc-9.3.20210804' -Xlinker -rpath -Xlinker '/tmp/ghctest-tqzmgxss/test   spaces/testsuite/tests/plugins/TXXXXX.run/simple-plugin/pkg.TXXXXX/install/lib/x86_64-linux-ghc-9.3.20210804' -L/home/hsyl20/projects/ghc/master/_build/stage1/lib/../lib/x86_64-linux-ghc-9.3.20210804 -Xlinker -rpath-link -Xlinker /home/hsyl20/projects/ghc/master/_build/stage1/lib/../lib/x86_64-linux-ghc-9.3.20210804 -Xlinker -rpath -Xlinker /home/hsyl20/projects/ghc/master/_build/stage1/lib/../lib/x86_64-linux-ghc-9.3.20210804 /tmp/ghc126596_0/ghc_4.o /tmp/ghc126596_0/ghc_7.o -Wl,-u,hs_atomic_add64 -Wl,-u{...many others...} -lHSsimple-plugin-0.1-95cpf37BE66F7W09my2aO-ghc9.3.20210804 -lHSghc-9.3-ghc9.3.20210804 -lHSterminfo-0.4.1.4-ghc9.3.20210804 -lHSprocess-1.6.13.1-ghc9.3.20210804 -lHSparsec-3.1.14.0-ghc9.3.20210804 -lHStext-1.2.4.2-ghc9.3.20210804 -lHShpc-0.6.1.0-ghc9.3.20210804 -lHSghci-9.3-ghc9.3.20210804 -lHSghc-heap-9.3-ghc9.3.20210804 -lHSghc-boot-9.3-ghc9.3.20210804 -lHSexceptions-0.10.4-ghc9.3.20210804 -lHStemplate-haskell-2.18.0.0-ghc9.3.20210804 -lHSpretty-1.1.3.6-ghc9.3.20210804 -lHSghc-boot-th-9.3-ghc9.3.20210804 -lHSstm-2.5.0.0-ghc9.3.20210804 -lHSmtl-2.2.2-ghc9.3.20210804 -lHStransformers-0.5.6.2-ghc9.3.20210804 -lHSdirectory-1.3.6.1-ghc9.3.20210804 -lHSunix-2.7.2.2-ghc9.3.20210804 -lHStime-1.11.1.1-ghc9.3.20210804 -lHSfilepath-1.4.2.1-ghc9.3.20210804 -lHSbinary-0.8.8.0-ghc9.3.20210804 -lHScontainers-0.6.4.1-ghc9.3.20210804 -lHSbytestring-0.11.1.0-ghc9.3.20210804 -lHSdeepseq-1.4.4.0-ghc9.3.20210804 -lHSarray-0.5.4.0-ghc9.3.20210804 -lHSbase-4.16.0.0-ghc9.3.20210804 -lHSghc-bignum-1.2-ghc9.3.20210804 -lHSghc-prim-0.8.0-ghc9.3.20210804 -lHSrts-1.0.2-ghc9.3.20210804 -lffi -ltinfo -lrt -lutil -ldl -lpthread -lgmp -lc -lm -lm -lrt -ldl -lpthread -lnuma

Notice -lHSsimple-plugin-0.1-95cpf37BE66F7W09my2aO-ghc9.3.20210804, -lHSghc-9.3-ghc9.3.20210804 and similar flags for every GHC dependency.

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking