Skip to content

GitLab

  • Menu
Projects Groups Snippets
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in / Register
  • GHC GHC
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 4,837
    • Issues 4,837
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 452
    • Merge requests 452
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Deployments
    • Deployments
    • Releases
  • Analytics
    • Analytics
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
    • Value stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Glasgow Haskell Compiler
  • GHCGHC
  • Issues
  • #18446

Closed
Open
Created Jul 14, 2020 by Matthias Andreas Benkard@benkard

System frameworks cannot be loaded on macOS Big Sur

Summary

When running on macOS Big Sur, attempting to load a system framework at runtime fails with a not found error.

Steps to reproduce

Create a file called Main.hs with the following content:

module Main where

main = putStrLn "Hi."

Run it with runghc, passing -framework OpenGL to GHC:

runghc --ghc-arg="-framework OpenGL" Main.hs

Expected behavior

The program should run and say hi.

Environment

  • GHC version used: 8.10.1
  • Operating System: macOS 10.16 Big Sur (20A4300b)
  • System Architecture: x86_64

Proposed Fix

Merge request !3689 (closed) is a proposed fix.

Remarks

This is presumably due to the following change in macOS Big Sur:

New in macOS Big Sur 11 beta, the system ships with a built-in dynamic linker cache of all system-provided libraries. As part of this change, copies of dynamic libraries are no longer present on the filesystem. Code that attempts to check for dynamic library presence by looking for a file at a path or enumerating a directory will fail. Instead, check for library presence by attempting to dlopen() the path, which will correctly check for the library in the cache. (62986286)

(https://developer.apple.com/documentation/macos-release-notes/macos-big-sur-11-beta-release-notes/)

The fix proposed above implements the behavior suggested there.

Edited Jul 14, 2020 by Matthias Andreas Benkard
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking