diff options
author | Andreas Klebinger <klebinger.andreas@gmx.at> | 2017-07-27 18:16:09 +0100 |
---|---|---|
committer | Tamar Christina <tamar@zhox.com> | 2017-07-27 21:16:02 +0100 |
commit | 7af0b906116e13fbd90f43f2f6c6b826df2dca77 (patch) | |
tree | 4da8912ab0408e22b119098dd64260b32e935bd9 /docs | |
parent | 791947db6db32ef7d4772a821a0823e558e3c05b (diff) | |
download | haskell-7af0b906116e13fbd90f43f2f6c6b826df2dca77.tar.gz |
Initialize hs_init with UTF8 encoded arguments on Windows.
Summary:
Get utf8 encoded arguments before we call hs_init and use them
instead of ignoring hs_init arguments. This reduces differing
behaviour of the RTS between windows and linux and simplifies
the code involved.
A few testcases were changed to expect the same result on windows
as on linux after the changes.
This fixes #13940.
Test Plan: ./validate
Reviewers: austin, hvr, bgamari, erikd, simonmar, Phyx
Subscribers: Phyx, rwbarton, thomie
GHC Trac Issues: #13940
Differential Revision: https://phabricator.haskell.org/D3739
Diffstat (limited to 'docs')
-rw-r--r-- | docs/users_guide/ffi-chap.rst | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/docs/users_guide/ffi-chap.rst b/docs/users_guide/ffi-chap.rst index 311146c4d9..320a3a6e70 100644 --- a/docs/users_guide/ffi-chap.rst +++ b/docs/users_guide/ffi-chap.rst @@ -337,6 +337,12 @@ reliably re-initialise after this has happened; see :ref:`infelicities-ffi`. don't forget the flag :ghc-flag:`-no-hs-main`, otherwise GHC will try to link to the ``Main`` Haskell module. +.. note:: + On Windows hs_init treats argv as UTF8-encoded. Passing other encodings + might lead to unexpected results. Passing NULL as argv is valid but can + lead to <unknown> showing up in error messages instead of the name of the + executable. + To use ``+RTS`` flags with ``hs_init()``, we have to modify the example slightly. By default, GHC's RTS will only accept "safe" ``+RTS`` flags (see :ref:`options-linker`), and the :ghc-flag:`-rtsopts[=⟨none|some|all⟩]` |