GHC issueshttps://gitlab.haskell.org/ghc/ghc/-/issues2019-07-07T18:32:19Zhttps://gitlab.haskell.org/ghc/ghc/-/issues/11061GHC 7.10.3 RC1: build broken on OS X2019-07-07T18:32:19ZPeter Trommlerptrommler@acm.orgGHC 7.10.3 RC1: build broken on OS XRichard reported on ghc-devs:
> ```
> checking for readelf... no
> configure: error: cannot find readelf in your PATH
> ```
OS X uses Mach-O not ELF. So `readelf` does not work on Mach-O binaries.
<details><summary>Trac metadata</summ...Richard reported on ghc-devs:
> ```
> checking for readelf... no
> configure: error: cannot find readelf in your PATH
> ```
OS X uses Mach-O not ELF. So `readelf` does not work on Mach-O binaries.
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ------------ |
| Version | 7.10.2 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | highest |
| Resolution | Unresolved |
| Component | Build System |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"GHC 7.10.3 RC1: build broken on OS X","status":"New","operating_system":"","component":"Build System","related":[],"milestone":"7.10.3","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"7.10.2","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Bug","description":"Richard reported on ghc-devs:\r\n> {{{\r\n> checking for readelf... no\r\n> configure: error: cannot find readelf in your PATH\r\n> }}}\r\n\r\nOS X uses Mach-O not ELF. So `readelf` does not work on Mach-O binaries.","type_of_failure":"OtherFailure","blocking":[]} -->7.10.3https://gitlab.haskell.org/ghc/ghc/-/issues/10476Wrong ar during cross-compilation2019-07-07T18:35:46ZJakub ZalewskiWrong ar during cross-compilationIt appears that during cross-compilation, while building stage 1 ghc, the build system uses ar for target architecture instead of ar for build/host architecture.
It will cause linking errors on systems where ar for target architecture i...It appears that during cross-compilation, while building stage 1 ghc, the build system uses ar for target architecture instead of ar for build/host architecture.
It will cause linking errors on systems where ar for target architecture is incompatible with ar for build/host architecture (sample output attached below).
```
(...)
"rm" -f libraries/Cabal/Cabal/dist-boot/build/libHSCabal-1.22.3.0-3tdTeip89ooLNDDdwdA54s.a.contents
"rm" -f libraries/bin-package-db/dist-boot/build/libHSbin-package-db-0.0.0.0-Gk3F1vzzO3g80wuNGtok3x.a libraries/bin-package-db/dist-boot/build/libHSbin-package-db-0.0.0.0-Gk3F1vzzO3g80wuNGtok3x.a.contents
echo libraries/bin-package-db/dist-boot/build/GHC/PackageDb.o >> libraries/bin-package-db/dist-boot/build/libHSbin-package-db-0.0.0.0-Gk3F1vzzO3g80wuNGtok3x.a.contents
"/Users/jakub/src/haskell/PNaCl/gsoc/wrappers/i686-unknown-nacl-ar" q libraries/bin-package-db/dist-boot/build/libHSbin-package-db-0.0.0.0-Gk3F1vzzO3g80wuNGtok3x.a @libraries/bin-package-db/dist-boot/build/libHSbin-package-db-0.0.0.0-Gk3F1vzzO3g80wuNGtok3x.a.contents
/Users/jakub/src/nacl_sdk/pepper_canary/toolchain/mac_x86_newlib/bin/i686-nacl-ar: creating libraries/bin-package-db/dist-boot/build/libHSbin-package-db-0.0.0.0-Gk3F1vzzO3g80wuNGtok3x.a
"rm" -f libraries/bin-package-db/dist-boot/build/libHSbin-package-db-0.0.0.0-Gk3F1vzzO3g80wuNGtok3x.a.contents
(...)
ld: archive has no table of contents file '/Users/jakub/src/haskell/PNaCl/ghc-pnacl/libraries/terminfo/dist-boot/build/libHSterminfo-0.4.0.1-7qZwBlx3clR8sTBilJl253.a' for architecture x86_64
```
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ---------------- |
| Version | 7.11 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | low |
| Resolution | Unresolved |
| Component | Build System |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | Unknown/Multiple |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"Wrong ar during cross-compilation","status":"New","operating_system":"Unknown/Multiple","component":"Build System","related":[],"milestone":"","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"7.11","keywords":["cross-compiling"],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Bug","description":"It appears that during cross-compilation, while building stage 1 ghc, the build system uses ar for target architecture instead of ar for build/host architecture.\r\n\r\nIt will cause linking errors on systems where ar for target architecture is incompatible with ar for build/host architecture (sample output attached below).\r\n\r\n{{{\r\n(...)\r\n\"rm\" -f libraries/Cabal/Cabal/dist-boot/build/libHSCabal-1.22.3.0-3tdTeip89ooLNDDdwdA54s.a.contents \r\n\"rm\" -f libraries/bin-package-db/dist-boot/build/libHSbin-package-db-0.0.0.0-Gk3F1vzzO3g80wuNGtok3x.a libraries/bin-package-db/dist-boot/build/libHSbin-package-db-0.0.0.0-Gk3F1vzzO3g80wuNGtok3x.a.contents \r\necho libraries/bin-package-db/dist-boot/build/GHC/PackageDb.o >> libraries/bin-package-db/dist-boot/build/libHSbin-package-db-0.0.0.0-Gk3F1vzzO3g80wuNGtok3x.a.contents\r\n\"/Users/jakub/src/haskell/PNaCl/gsoc/wrappers/i686-unknown-nacl-ar\" q libraries/bin-package-db/dist-boot/build/libHSbin-package-db-0.0.0.0-Gk3F1vzzO3g80wuNGtok3x.a @libraries/bin-package-db/dist-boot/build/libHSbin-package-db-0.0.0.0-Gk3F1vzzO3g80wuNGtok3x.a.contents\r\n/Users/jakub/src/nacl_sdk/pepper_canary/toolchain/mac_x86_newlib/bin/i686-nacl-ar: creating libraries/bin-package-db/dist-boot/build/libHSbin-package-db-0.0.0.0-Gk3F1vzzO3g80wuNGtok3x.a\r\n\"rm\" -f libraries/bin-package-db/dist-boot/build/libHSbin-package-db-0.0.0.0-Gk3F1vzzO3g80wuNGtok3x.a.contents \r\n(...)\r\nld: archive has no table of contents file '/Users/jakub/src/haskell/PNaCl/ghc-pnacl/libraries/terminfo/dist-boot/build/libHSterminfo-0.4.0.1-7qZwBlx3clR8sTBilJl253.a' for architecture x86_64\r\n}}}","type_of_failure":"OtherFailure","blocking":[]} -->7.10.3Thomas MiedemaThomas Miedemahttps://gitlab.haskell.org/ghc/ghc/-/issues/8652Cross-compiling broken for ARM/Linux target2019-07-07T18:44:05ZkgardasCross-compiling broken for ARM/Linux targetI've attempted to cross compile GHC HEAD on Ubuntu 13.10 with ubuntu's hard-float tool-chain and LLVM. I've configured GHC with:
```
$ ./configure --target=arm-linux-gnueabihf
```
and compiling by make works till it fails with:
```
in...I've attempted to cross compile GHC HEAD on Ubuntu 13.10 with ubuntu's hard-float tool-chain and LLVM. I've configured GHC with:
```
$ ./configure --target=arm-linux-gnueabihf
```
and compiling by make works till it fails with:
```
inplace/bin/deriveConstants --gen-header -o includes/dist-derivedconstants/header/DerivedConstants.h --tmpdir includes/dist-derivedconstants/header/ --gcc-program "/usr/bin/gcc" --gcc-flag -fno-stack-protector --gcc-flag -Iincludes --gcc-flag -Iincludes/dist --gcc-flag -Iincludes/dist-derivedconstants/header --gcc-flag -Iincludes/dist-ghcconstants/header --gcc-flag -Irts --gcc-flag -fcommon --nm-program "/usr/bin/arm-linux-gnueabihf-nm"
/usr/bin/arm-linux-gnueabihf-nm: includes/dist-derivedconstants/header/tmp.o: File format not recognized
deriveConstants: readProcess: /usr/bin/arm-linux-gnueabihf-nm "includes/dist-derivedconstants/header/tmp.o" (exit 1): failed
make[1]: *** [includes/dist-derivedconstants/header/DerivedConstants.h] Error 1
```
As a workaround for this issue, it's possible to use --with-gcc= and this way deriveConstants gets the right cross GCC. Looks like a bug somewhere in make machinery or configure itself.
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ------------ |
| Version | 7.7 |
| 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":"Cross-compiling broken for ARM/Linux target","status":"New","operating_system":"","component":"Compiler","related":[],"milestone":"","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"7.7","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Bug","description":"I've attempted to cross compile GHC HEAD on Ubuntu 13.10 with ubuntu's hard-float tool-chain and LLVM. I've configured GHC with:\r\n{{{\r\n$ ./configure --target=arm-linux-gnueabihf\r\n}}}\r\nand compiling by make works till it fails with:\r\n{{{\r\ninplace/bin/deriveConstants --gen-header -o includes/dist-derivedconstants/header/DerivedConstants.h --tmpdir includes/dist-derivedconstants/header/ --gcc-program \"/usr/bin/gcc\" --gcc-flag -fno-stack-protector --gcc-flag -Iincludes --gcc-flag -Iincludes/dist --gcc-flag -Iincludes/dist-derivedconstants/header --gcc-flag -Iincludes/dist-ghcconstants/header --gcc-flag -Irts --gcc-flag -fcommon --nm-program \"/usr/bin/arm-linux-gnueabihf-nm\"\r\n/usr/bin/arm-linux-gnueabihf-nm: includes/dist-derivedconstants/header/tmp.o: File format not recognized\r\nderiveConstants: readProcess: /usr/bin/arm-linux-gnueabihf-nm \"includes/dist-derivedconstants/header/tmp.o\" (exit 1): failed\r\nmake[1]: *** [includes/dist-derivedconstants/header/DerivedConstants.h] Error 1\r\n}}}\r\nAs a workaround for this issue, it's possible to use --with-gcc= and this way deriveConstants gets the right cross GCC. Looks like a bug somewhere in make machinery or configure itself.","type_of_failure":"OtherFailure","blocking":[]} -->7.10.3