Skip to content

Commit

Permalink
Dynamically link compiler executable.
Browse files Browse the repository at this point in the history
DDlog used to rely on static linking to reduce runtime dependencies.
Unfortunately, this no longer works well on recent Ubuntu and Fedora
releases (see vmware#1051).  The problem appears to be in the `unix` Haskell
package, which may still load dynamic libraries (in particular glibc)
using `dlopen` when using static linking.  As far as I can tell it uses
older versions of Linux static libraries, which require some deprecated
libc symbols (specifically `__xmnod`).  This will probably get fixed
eventually, but overall static linking probably was not a good idea, so
we switch to the more standard dynamic linking method.
  • Loading branch information
ryzhyk committed Jul 23, 2022
1 parent 588d489 commit 919fac1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 12 deletions.
9 changes: 0 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -129,15 +129,6 @@ You are now ready to [start coding in DDlog](doc/tutorial/tutorial.md).
export PATH=`pwd`:$PATH
cd ..
```
- Static versions of the following libraries: `libpthread.a`, `libc.a`, `libm.a`, `librt.a`, `libutil.a`,
`libdl.a`, `libgmp.a`, and `libstdc++.a` can be installed from distro-specific packages. On Ubuntu:
```
apt install libc6-dev libgmp-dev
```
On Fedora:
```
dnf install glibc-static gmp-static libstdc++-static
```

#### Building

Expand Down
6 changes: 3 additions & 3 deletions package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ dependencies:
library:
source-dirs: src
ghc-options:
- -optl-static
# - -optl-static
- -optl-pthread
- -Wall
- -Werror
Expand All @@ -66,7 +66,7 @@ executables:
- -threaded
- -rtsopts
- -with-rtsopts=-N
- -optl-static
# - -optl-static
- -optl-pthread
- -Wall
- -Werror
Expand All @@ -91,7 +91,7 @@ executables:
- -threaded
- -rtsopts
- -with-rtsopts=-N
- -optl-static
# - -optl-static
- -Wall
- -Werror
else:
Expand Down

0 comments on commit 919fac1

Please sign in to comment.