<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
<html lang="en">
<head>
<meta content="text/html; charset=US-ASCII" http-equiv="Content-Type">
<title>
GitLab
</title>



<style>img {
max-width: 100%; height: auto;
}
</style>
</head>
<body>
<div class="content">

<h3>
Ben Gamari pushed to branch wip/facebook/ghc-8.8-unloading
at <a href="https://gitlab.haskell.org/ghc/ghc">Glasgow Haskell Compiler / GHC</a>
</h3>
<h4>
Commits:
</h4>
<ul>
<li>
<strong><a href="https://gitlab.haskell.org/ghc/ghc/-/commit/2ce2a5b444069ea0dc0afb483634f4ba405437cb">2ce2a5b4</a></strong>
<div>
<span>by Pepe Iborra</span>
<i>at 2020-11-24T01:17:25+00:00</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">Revert "Pass preprocessor options to C compiler when building foreign C files (#16737)"

This reverts commit 1c18d3b41f897f34a93669edaebe6069f319f9e2.
</pre>
</li>
<li>
<strong><a href="https://gitlab.haskell.org/ghc/ghc/-/commit/711fffed5a185c610261e5214f54d6eb863dbc74">711fffed</a></strong>
<div>
<span>by Ömer Sinan Ağacan</span>
<i>at 2020-11-24T01:17:25+00:00</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">rts: Properly free the RTSSummaryStats structure

`stat_exit` always allocates a `RTSSummaryStats` but only sometimes
frees it, which casues leaks. With this patch we unconditionally free
the structure, fixing the leak.

Fixes #16584
</pre>
</li>
<li>
<strong><a href="https://gitlab.haskell.org/ghc/ghc/-/commit/237180d278f89b9528568f1e6ff6acd0376d7228">237180d2</a></strong>
<div>
<span>by pepeiborra</span>
<i>at 2020-11-24T01:17:25+00:00</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">Define __FACEBOOK_HASKELL__

Summary: Adds a new __FACEBOOK_HASKELL__ CPP definition for use in conditional compilation. This is needed because fbghc makes api changes in the ghc package, which can break downstream consumers like ghcide

Test Plan:
## Doesn't break anything
```
$ tp2_use_local ghc
$ buck build common/hs/... haxl/... tools/build/... sigma/haxl/...
```
## Can be used for conditional compilation
$FBCODE/experimental/pepeiborra/Hellofacebook.hs:
```haskell
{-# LANGUAGE CPP #-}

module Hellofacebook where

main :: IO ()
main =
#ifdef __FACEBOOK_HASKELL__
  putStrLn "Hello Facebook"
#else
  putStrLn "Hello dummy"
#endif
```
$FBCODE/experimental/pepeiborra/TARGETS:
```
load("@fbcode_macros//build_defs:haskell_binary.bzl", "haskell_binary")

haskell_binary(
    name = "hellofacebook",
    srcs = [
        "Hellofacebook.hs",
    ],
    main = "Hellofacebook"
)
```
Test
```
$ buck run //experimental/pepeiborra:hellofacebook
Building: finished in 0.4 sec (100%) 41/41 jobs, 0 updated
  Total time: 0.4 sec
Hello Facebook
```

Reviewers: josefs, rayshih, watashi

Reviewed By: watashi

Subscribers: smarlow

Differential Revision: https://phabricator.intern.facebook.com/D22901280

Tasks: T70949920

Tags: haskell, bootcamp, GHC

Signature: 22901280:1596477273:1c220ebed71b59079ab022af9b50223d99257be8
</pre>
</li>
<li>
<strong><a href="https://gitlab.haskell.org/ghc/ghc/-/commit/eecf9f2726fb2508314a42860915edd13c752b34">eecf9f27</a></strong>
<div>
<span>by Pepe Iborra</span>
<i>at 2020-11-24T01:17:25+00:00</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">Revert "Add a RTS option -xp to load PIC object anywhere in address space"

This reverts commit cb3f710d952c0a2bad539f76c2ab6d07ba894bea.
</pre>
</li>
<li>
<strong><a href="https://gitlab.haskell.org/ghc/ghc/-/commit/552714a205c4b4f3346328fd12d2e5c64ba817a4">552714a2</a></strong>
<div>
<span>by Pepe Iborra</span>
<i>at 2020-11-24T01:17:25+00:00</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">Revert "Revert "Add a RTS option -xp to load PIC object anywhere in address space""

This reverts commit 82a716431cc680392e332bc2b1a1fd0d7faa4cd8.
</pre>
</li>
<li>
<strong><a href="https://gitlab.haskell.org/ghc/ghc/-/commit/54527eff95c97d940d9a2bfaa93c06eeb1fb0cdc">54527eff</a></strong>
<div>
<span>by Pepe Iborra</span>
<i>at 2020-11-24T01:17:25+00:00</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">Revert "Revert "Allocate bss section within proper range of other sections""

This reverts commit 9cbf6f2baf793e361d41b9c36497c5601ff22253.
</pre>
</li>
<li>
<strong><a href="https://gitlab.haskell.org/ghc/ghc/-/commit/a94ffd1b5080227b9016b0b136d8bdd4540e357f">a94ffd1b</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-24T01:17:25+00:00</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">Revert "Reimplement fix related to load/unload native object"

This reverts commit 8edf564362e37c9740a351f1d71f2fa5e042f7b1.
</pre>
</li>
<li>
<strong><a href="https://gitlab.haskell.org/ghc/ghc/-/commit/a226fc88e87d43898c64dbc75d867319029c26b0">a226fc88</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-24T01:17:25+00:00</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">Revert "Apply upstream patch 3842: Linker: Object unloading"

This reverts commit e508c92828c7e009b6f7df16cd7be2147c4a9026.
</pre>
</li>
<li>
<strong><a href="https://gitlab.haskell.org/ghc/ghc/-/commit/9190776515f420f3f7bb625f68c3ad0ed727be22">91907765</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-24T01:18:39+00:00</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">Revert "Add loadNativeObj and unloadNativeObj"

This reverts commit b6482d18f78fc52de3321c03ab20cb84f0253016.
</pre>
</li>
<li>
<strong><a href="https://gitlab.haskell.org/ghc/ghc/-/commit/8bc40df0f8bae753a6c6ea910f25b7e781deac88">8bc40df0</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-24T01:18:43+00:00</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">rts: Refactor foreign export tracking

This avoids calling `libc` in the initializers which are responsible for
registering foreign exports. We believe this should avoid the corruption
observed in #18548.

See Note [Tracking foreign exports] in rts/ForeignExports.c for an
overview of the new scheme.

(cherry picked from commit c492134912e5270180881b7345ee86dc32756bdd)
(cherry picked from commit ed57c3a9eb9286faa222f98e484a9ef3432b2025)
</pre>
</li>
<li>
<strong><a href="https://gitlab.haskell.org/ghc/ghc/-/commit/91950b3be5f72361687307fee653ae7a4188a1d4">91950b3b</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-24T01:18:43+00:00</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">rts: Refactor unloading of foreign export StablePtrs

Previously we would allocate a linked list cell for each foreign export.
Now we can avoid this by taking advantage of the fact that they are
already broken into groups.

(cherry picked from commit 40dc91069d15bfc1d81f1722b39e06cac8fdddd1)
(cherry picked from commit 65be3832f3aa48bbde896ee846c18fcba1f16b42)
</pre>
</li>
<li>
<strong><a href="https://gitlab.haskell.org/ghc/ghc/-/commit/c043710a2064d3c9c9d8ca2c2fbf58910989e2a5">c043710a</a></strong>
<div>
<span>by Ömer Sinan Ağacan</span>
<i>at 2020-11-24T01:18:43+00:00</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">Fix and enable object unloading in GHCi

Fixes #16525 by tracking dependencies between object file symbols and
marking symbol liveness during garbage collection

See Note [Object unloading] in CheckUnload.c for details.

(cherry picked from commit c34a4b98b1f09ea3096d39a839a86f2d7185c796)
(cherry picked from commit a4153029347c48be38bace114438b72475e2c40f)
</pre>
</li>
<li>
<strong><a href="https://gitlab.haskell.org/ghc/ghc/-/commit/0ac691710c8131767b940f0e36b171312dd1ba9e">0ac69171</a></strong>
<div>
<span>by Ray Shih</span>
<i>at 2020-11-24T01:18:43+00:00</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">Add loadNativeObj and unloadNativeObj

(This change is originally written by niteria)

This adds two functions:
* `loadNativeObj`
* `unloadNativeObj`
and implements them for Linux.

They are useful if you want to load a shared object with Haskell code
using the system linker and have GHC call dlclose() after the
code is no longer referenced from the heap.

Using the system linker allows you to load the shared object
above outside the low-mem region. It also loads the DWARF sections
in a way that `perf` understands.

`dl_iterate_phdr` is what makes this implementation Linux specific.

(cherry picked from commit 2782487f5f6ad9df4dc8725226a47f07fec77f9f)
</pre>
</li>
</ul>
<h4>30 changed files:</h4>
<ul>
<li class="file-stats">
<a href="#cf5b233b6ec5c0a6951d1018fee507d2d2d71391">
compiler/deSugar/DsForeign.hs
</a>
</li>
<li class="file-stats">
<a href="#47f4bea1d308dee249030e6063d92071b5aac240">
compiler/ghci/Linker.hs
</a>
</li>
<li class="file-stats">
<a href="#72690aad4036dea6e6e116c30e4d7582f5077db7">
compiler/main/DriverPipeline.hs
</a>
</li>
<li class="file-stats">
<a href="#8d11c404e91070407324f71df4a47224c0887148">
docs/users_guide/8.8.1-notes.rst
</a>
</li>
<li class="file-stats">
<a href="#40f83a2cddcbc1f8190b0551eb572ccf4ea88cc9">
includes/Rts.h
</a>
</li>
<li class="file-stats">
<a href="#75e004ba0ee41712b519d7dbb11188801ddbb722">
includes/ghc.mk
</a>
</li>
<li class="file-stats">
<a href="#456263288343573de99d23371fb69e400889ac65">
<span class="new-file">
+
includes/rts/ForeignExports.h
</span>
</a>
</li>
<li class="file-stats">
<a href="#94ca41c5afbb3d932bd6f37ee16458322988fb69">
includes/rts/storage/GC.h
</a>
</li>
<li class="file-stats">
<a href="#ba1d62598dfbf5ddb817dd9c93461a02a0bba43d">
rts/CheckUnload.c
</a>
</li>
<li class="file-stats">
<a href="#67cc28da78ad5c427434fbe2efdcecffe61ae002">
rts/CheckUnload.h
</a>
</li>
<li class="file-stats">
<a href="#ae718f022c910e7a1a4e159b50a9ad3a8f8afcfe">
<span class="new-file">
+
rts/ForeignExports.c
</span>
</a>
</li>
<li class="file-stats">
<a href="#29001fa4f85b778737a44790761e498504c3f160">
<span class="new-file">
+
rts/ForeignExports.h
</span>
</a>
</li>
<li class="file-stats">
<a href="#152b85a9ce66dcf385a199eab2acad9d98fd737b">
rts/Hash.c
</a>
</li>
<li class="file-stats">
<a href="#4352fec095ae082617e59e2f077ec6dc9e865ee7">
rts/Hash.h
</a>
</li>
<li class="file-stats">
<a href="#044fe9284335a9bfd17546e06c2e5c40a680dd3d">
rts/Linker.c
</a>
</li>
<li class="file-stats">
<a href="#687f0b17315e54a1692de64626391e572ca298e9">
rts/LinkerInternals.h
</a>
</li>
<li class="file-stats">
<a href="#9ed11d0519762dae04656481b089dbb5b05acf98">
rts/RtsStartup.c
</a>
</li>
<li class="file-stats">
<a href="#16c842a51a135c8ef2c7c7f94336544868348a3c">
rts/RtsSymbols.c
</a>
</li>
<li class="file-stats">
<a href="#6c6e266b51f1c94d2ebf5aa2052f408397451f94">
rts/Stats.c
</a>
</li>
<li class="file-stats">
<a href="#b7ec52d5e302083ed03503182f1293694dda24f3">
rts/linker/Elf.c
</a>
</li>
<li class="file-stats">
<a href="#427e40b26b348edf7bc8d906629d672f3c26bdec">
rts/linker/Elf.h
</a>
</li>
<li class="file-stats">
<a href="#f4db9593d88d3c951505379e54f3db74f49ae142">
rts/linker/MachO.c
</a>
</li>
<li class="file-stats">
<a href="#5d7a3459d41f1cf214a13882f80338c1d83e1025">
rts/linker/MachO.h
</a>
</li>
<li class="file-stats">
<a href="#9670354b74fe55079feca82e1510129734b46f4f">
rts/linker/PEi386.c
</a>
</li>
<li class="file-stats">
<a href="#d373a5481c2da8b16d7b59009c7565a297cc7a36">
rts/linker/PEi386.h
</a>
</li>
<li class="file-stats">
<a href="#4f7a8996954df0bb6d580c202be08ec03af67514">
rts/linker/SymbolExtras.c
</a>
</li>
<li class="file-stats">
<a href="#778af26779e4d8d3875de122cdb6e588e8b42508">
rts/linker/SymbolExtras.h
</a>
</li>
<li class="file-stats">
<a href="#e432c7b248b68100c3cc37db36ee80d975efd697">
rts/rts.cabal.in
</a>
</li>
<li class="file-stats">
<a href="#37a93df244a7789fddf557443b6398d06763e9cc">
rts/sm/Evac.c
</a>
</li>
<li class="file-stats">
<a href="#6477e10756faf038741e63d1ad499a1df809fe10">
rts/sm/GC.c
</a>
</li>
</ul>
<h5>The diff was not included because it is too large.</h5>

</div>
<div class="footer" style="margin-top: 10px;">
<p style="font-size: small; color: #666;">

<br>
<a href="https://gitlab.haskell.org/ghc/ghc/-/compare/4d6a8d55db4a28274d080351352baaaf41027d40...0ac691710c8131767b940f0e36b171312dd1ba9e">View it on GitLab</a>.
<br>
You're receiving this email because of your account on gitlab.haskell.org.
If you'd like to receive fewer emails, you can
adjust your notification settings.



</p>
</div>
</body>
</html>