GHC issueshttps://gitlab.haskell.org/ghc/ghc/-/issues2019-07-07T18:38:44Zhttps://gitlab.haskell.org/ghc/ghc/-/issues/9859Implement `calloc{,Bytes,Array,Array0}` allocators2019-07-07T18:38:44ZifesdjeenImplement `calloc{,Bytes,Array,Array0}` allocatorsAdd zero-initialising versions of malloc{,Bytes,Array,Array0}
- Add calloc and callocBytes to Foreign.Marshal.Alloc.
- Add callocArray and callocArray0 to Foreign.Marshal.Array.
Proposal Discussion: https://www.haskell.org/pipermail/li...Add zero-initialising versions of malloc{,Bytes,Array,Array0}
- Add calloc and callocBytes to Foreign.Marshal.Alloc.
- Add callocArray and callocArray0 to Foreign.Marshal.Array.
Proposal Discussion: https://www.haskell.org/pipermail/libraries/2014-November/024421.html7.10.1https://gitlab.haskell.org/ghc/ghc/-/issues/8701Update libffi-tarballs to latest libffi2019-07-07T18:43:53ZlukexiUpdate libffi-tarballs to latest libffilibffi 3.0.14 contains fixes necessary for successful iOS (and probably ARM in general) cross-compilation.
I've created a new archive that can be dropped in to replace the current libffi-tarballs archive here:
https://github.com/ghc-ios...libffi 3.0.14 contains fixes necessary for successful iOS (and probably ARM in general) cross-compilation.
I've created a new archive that can be dropped in to replace the current libffi-tarballs archive here:
https://github.com/ghc-ios/libffi-tarballs/blob/master/libffi-3.0.14.tar.gz?raw=true
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | -------------- |
| Version | 7.8.1-rc1 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | high |
| Resolution | Unresolved |
| Component | Compiler (FFI) |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | thoughtpolice |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"Update libffi-tarballs to latest libffi","status":"New","operating_system":"","component":"Compiler (FFI)","related":[],"milestone":"7.8.1","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"7.8.1-rc1","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":["thoughtpolice"],"type":"Bug","description":"libffi 3.0.14 contains fixes necessary for successful iOS (and probably ARM in general) cross-compilation.\r\n\r\nI've created a new archive that can be dropped in to replace the current libffi-tarballs archive here:\r\nhttps://github.com/ghc-ios/libffi-tarballs/blob/master/libffi-3.0.14.tar.gz?raw=true","type_of_failure":"OtherFailure","blocking":[]} -->7.10.1https://gitlab.haskell.org/ghc/ghc/-/issues/7243regression: acceptable foreign result types2019-07-07T18:50:43Zdmwitregression: acceptable foreign result typesThe following short file is rejected:
```
import Foreign.Ptr
foreign import ccall "wrapper" foo :: IO (FunPtr ())
```
The error is:
```
test.hs:2:1:
Unacceptable type in foreign declaration: IO (FunPtr ())
When checking declar...The following short file is rejected:
```
import Foreign.Ptr
foreign import ccall "wrapper" foo :: IO (FunPtr ())
```
The error is:
```
test.hs:2:1:
Unacceptable type in foreign declaration: IO (FunPtr ())
When checking declaration:
foreign import ccall safe "wrapper" foo :: IO (FunPtr ())
```
However, my reading of the 2010 Report suggests this should be acceptable. Specifically:
- Prelude.IO t is a marshallable foreign result type when t is a marshallable foreign type,\[\[BR\]\]
- all basic foreign types are marshallable foreign types, and\[\[BR\]\]
- FunPtr a is a basic foreign type for all a.
(Political note: I include this chain of reasoning not because I think others too stupid to recreate it, but because I think it likely that I am not reading the Report correctly, and want to make it easy to detect and correct any misconceptions I have.)
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ------------ |
| Version | 7.6.1 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | normal |
| Resolution | Unresolved |
| Component | Compiler |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"regression: acceptable foreign result types","status":"New","operating_system":"","component":"Compiler","related":[],"milestone":"","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"7.6.1","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Bug","description":"The following short file is rejected:\r\n\r\n{{{\r\nimport Foreign.Ptr\r\nforeign import ccall \"wrapper\" foo :: IO (FunPtr ())\r\n}}}\r\n\r\nThe error is:\r\n\r\n{{{\r\ntest.hs:2:1:\r\n Unacceptable type in foreign declaration: IO (FunPtr ())\r\n When checking declaration:\r\n foreign import ccall safe \"wrapper\" foo :: IO (FunPtr ())\r\n}}}\r\n\r\nHowever, my reading of the 2010 Report suggests this should be acceptable. Specifically:\r\n\r\n* Prelude.IO t is a marshallable foreign result type when t is a marshallable foreign type,[[BR]]\r\n* all basic foreign types are marshallable foreign types, and[[BR]]\r\n* FunPtr a is a basic foreign type for all a.\r\n\r\n(Political note: I include this chain of reasoning not because I think others too stupid to recreate it, but because I think it likely that I am not reading the Report correctly, and want to make it easy to detect and correct any misconceptions I have.)","type_of_failure":"OtherFailure","blocking":[]} -->7.10.1