[GHC] #14261: ghc stopped recognizing some arm triplets that used to work: Failed to lookup the datalayout for armv7a-hardfloat-linux-gnueabi; available targets:

#14261: ghc stopped recognizing some arm triplets that used to work: Failed to lookup the datalayout for armv7a-hardfloat-linux-gnueabi; available targets: -------------------------------------+------------------------------------- Reporter: slyfox | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.3 Keywords: | Operating System: Unknown/Multiple Architecture: | Type of failure: None/Unknown Unknown/Multiple | Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- Build failure on current ghc-HEAD as: Build failure for armv7a-hardfloat-linux-gnueabi: {{{ Failed to lookup the datalayout for armv7a-hardfloat-linux-gnueabi; available targets: ["i386-unknown-windows","i686-unknown-windows","x86_64 -unknown-windows","arm-unknown-linux-gnueabihf","armv6-unknown-linux- gnueabihf","armv7-unknown-linux-gnueabihf","aarch64-unknown-linux- gnu","aarch64-unknown-linux","i386-unknown-linux-gnu","i386-unknown- linux","x86_64-unknown-linux-gnu","x86_64-unknown-linux","armv7-unknown- linux-androideabi","aarch64-unknown-linux-android","arm-unknown-nto-qnx- eabi","i386-apple-darwin","x86_64-apple-darwin","armv7-apple-ios","aarch64 -apple-ios","i386-apple-ios","x86_64-apple-ios"] }}} Build failure for armv7a-unknown-linux-gnueabi {{{ Failed to lookup the datalayout for armv7a-unknown-linux-gnueabi; available targets: ["i386-unknown-windows","i686-unknown-windows","x86_64 -unknown-windows","arm-unknown-linux-gnueabihf","armv6-unknown-linux- gnueabihf","armv7-unknown-linux-gnueabihf","aarch64-unknown-linux- gnu","aarch64-unknown-linux","i386-unknown-linux-gnu","i386-unknown- linux","x86_64-unknown-linux-gnu","x86_64-unknown-linux","armv7-unknown- linux-androideabi","aarch64-unknown-linux-android","arm-unknown-nto-qnx- eabi","i386-apple-darwin","x86_64-apple-darwin","armv7-apple-ios","aarch64 -apple-ios","i386-apple-ios","x86_64-apple-ios"] }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14261 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14261: ghc stopped recognizing some arm triplets that used to work: Failed to lookup the datalayout for armv7a-hardfloat-linux-gnueabi; available targets: -------------------------------------+------------------------------------- Reporter: slyfox | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.3 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by angerman): I believe the error message could be better :-( Targets are not hardcoded into GHC anymore, they are read from the `llvm- targets` file, at the top level. (It is also copied during install/...), which is read by ghc at runtime, and thus changes to it are directly reflected without recompilation. The `llvm-targets` file can be generated via the `utils/llvm-targets/gen- data-layout.sh` script. That being said, I am a bit confused about the `armv7a-hardfloat-linux- gnueabi` target. Shouldn't that be `armv7-unknown-linux-gnueabihf`? Should we use Autoconf triple canonicalization here? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14261#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14261: ghc stopped recognizing some arm triplets that used to work: Failed to lookup the datalayout for armv7a-hardfloat-linux-gnueabi; available targets: -------------------------------------+------------------------------------- Reporter: slyfox | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.3 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by slyfox):
That being said, I am a bit confused about the armv7a-hardfloat-linux- gnueabi target. Shouldn't that be armv7-unknown-linux-gnueabihf
This triplet is recognized by autoconf, gcc, glibc and binutils just fine and generated by GHC binaries worked.
Should we use Autoconf triple canonicalization here?
I don't think canonicalization will give you much here. You can't match triples for exat match anyways. A few fields can be used to inject custom strings, like ${vendor}. I use ${vendor} a lot to distinct between locally installed toolchains (default-pie, default-nopie, etc.) {{{ ghc $ ./config.sub armv7a-hardfloat-linux-gnueabi armv7a-hardfloat-linux-gnueabi ghc $ ./config.sub armv7a-unknown-linux-gnueabi armv7a-unknown-linux-gnueabi ghc $ ./config.sub x86_64-UNREG-linux-gnu x86_64-UNREG-linux-gnu }}} I guess it depends what gen-data-layout.sh script tries to fish out of the triple. It looks like what it really needs is: - CPU architecture (that's the first field of triple) - FPU ABI Normally how autoconf scripts do it is they match for known templates: {{{ case ${target} in armv[78]-*) something;; *-ghueabihf) something-else;; armv[678]-hardfloat-*) another-thing;; ... }}} It's a bit fragile though. More precise way would be to interrogate available toolchain. Either through dumping of defined macros for a target compiler and check for features you need to construct proper llvm string or compile-test things in autoconf way. If all above it tedious I'm fine to have a manual mechanism of passing required info manually at ./configure time (or whenever appropriate). -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14261#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14261: ghc stopped recognizing some arm triplets that used to work: Failed to lookup the datalayout for armv7a-hardfloat-linux-gnueabi; available targets: -------------------------------------+------------------------------------- Reporter: slyfox | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.3 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by angerman): * cc: bgamari, kavon (added) Comment: Just for the record. The `*-hardfloat-*` vendor seems to be gentoo specific: https://gitweb.gentoo.org/repo/gentoo.git/tree/eclass/toolchain.eclass#n1069. The `gen-data-layout.sh` script actually interrogates `clang`, to obtain the `data-layout`, cpu, and additional flags. Frankly the additional flags are still a bit fragile. I'm ok with adding: `armv7a-unknown-linux-gnueabi` to the list of llvm-targets. The case of `armv7a-hardfloat-linux-gnueabi`, which is not recognized as a proper llvm target, and llvm would only recognize as `armv7a-unknown-linux-gnueabihf`, I'm a bit reluctant to add, as it would result in a seemingly accepted target, while llvm would generate code for soft float, which seem unintentional. The customizable vendor flag though, I believe we should allow. I'm not perfectly sure if we should just strip it out in autoconf, and replace any vendor that's not part of the llvm-targets, with `unknown` as a fallback. E.g. `x86_64-UNREG-linux-gnu` would end up as `LLVM_TARGET=x86_64-unknown- linux-gnu`. I'm also more comfortable to make the `*-hardfloat-*-gnueabi` gentoo hack into a special casing in the configure script to have it end up as `LLVM_TARGET=...-unknown-...-gnueabihf`. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14261#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14261: ghc stopped recognizing some arm triplets that used to work: Failed to
lookup the datalayout for armv7a-hardfloat-linux-gnueabi; available
targets:
-------------------------------------+-------------------------------------
Reporter: slyfox | Owner: (none)
Type: bug | Status: new
Priority: normal | Milestone:
Component: Compiler | Version: 8.3
Resolution: | Keywords:
Operating System: Unknown/Multiple | Architecture:
| Unknown/Multiple
Type of failure: None/Unknown | Test Case:
Blocked By: | Blocking:
Related Tickets: | Differential Rev(s):
Wiki Page: |
-------------------------------------+-------------------------------------
Comment (by Moritz Angermann

#14261: ghc stopped recognizing some arm triplets that used to work: Failed to lookup the datalayout for armv7a-hardfloat-linux-gnueabi; available targets: -------------------------------------+------------------------------------- Reporter: slyfox | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.3 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by slyfox): It looks like armv7a-unknown-linux-gnueabi still does not compile current ghc-HEAD as a shared library: {{{ "inplace/bin/ghc-stage1" -this-unit-id rts -shared -dynamic -dynload deploy -no-auto-link-packages -Lrts/dist/build -lffi -optl-Wl,-rpath -optl-Wl,'$ORIGIN' ... -o rts/dist/build/libHSrts_thr- ghc8.3.20171017.so /usr/libexec/gcc/armv7a-unknown-linux-gnueabi/ld: error: rts/dist/build /libHSrts-ghc8.3.20171017.so uses VFP register arguments, rts/dist/build/StgStartup.dyn_o does not /usr/libexec/gcc/armv7a-unknown-linux-gnueabi/ld: failed to merge target specific data of file rts/dist/build/StgStartup.dyn_o }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14261#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14261: ghc stopped recognizing some arm triplets that used to work: Failed to lookup the datalayout for armv7a-hardfloat-linux-gnueabi; available targets: -------------------------------------+------------------------------------- Reporter: slyfox | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.3 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by slyfox): Replying to [comment:5 slyfox]: Full build log: https://dev.gentoo.org/~slyfox/bugs/ghc-trac/14261/cross- armv7a-unknown-linux-gnueabi:ghc-9999:20171018-052036.log -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14261#comment:6 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14261: ghc stopped recognizing some arm triplets that used to work: Failed to lookup the datalayout for armv7a-hardfloat-linux-gnueabi; available targets: -------------------------------------+------------------------------------- Reporter: slyfox | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.3 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by angerman): Bah. llvm tools are a mess. Thanks for the report! -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14261#comment:7 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14261: ghc stopped recognizing some arm triplets that used to work: Failed to lookup the datalayout for armv7a-hardfloat-linux-gnueabi; available targets: -------------------------------------+------------------------------------- Reporter: slyfox | Owner: angerman Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.3 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * owner: (none) => angerman Comment: Has this been fixed, angerman? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14261#comment:8 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14261: ghc stopped recognizing some arm triplets that used to work: Failed to lookup the datalayout for armv7a-hardfloat-linux-gnueabi; available targets: -------------------------------------+------------------------------------- Reporter: slyfox | Owner: angerman Type: bug | Status: new Priority: normal | Milestone: 8.4.1 Component: Compiler | Version: 8.3 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * milestone: => 8.4.1 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14261#comment:9 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14261: ghc stopped recognizing some arm triplets that used to work: Failed to lookup the datalayout for armv7a-hardfloat-linux-gnueabi; available targets: -------------------------------------+------------------------------------- Reporter: slyfox | Owner: angerman Type: bug | Status: new Priority: normal | Milestone: 8.6.1 Component: Compiler | Version: 8.3 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by clint): Related: https://ghc.haskell.org/trac/ghc/ticket/15199 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14261#comment:11 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14261: ghc stopped recognizing some arm triplets that used to work: Failed to lookup the datalayout for armv7a-hardfloat-linux-gnueabi; available targets: -------------------------------------+------------------------------------- Reporter: slyfox | Owner: angerman Type: bug | Status: new Priority: normal | Milestone: 8.6.1 Component: Compiler | Version: 8.3 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by matthewbauer): Other missing triplets: - armv7a-unknown-linux-androideabi - armv5tel-unknown-linux-gnueabi - armv6l-unknown-linux-gnueabihf -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14261#comment:12 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14261: ghc stopped recognizing some arm triplets that used to work: Failed to lookup the datalayout for armv7a-hardfloat-linux-gnueabi; available targets: -------------------------------------+------------------------------------- Reporter: slyfox | Owner: angerman Type: bug | Status: new Priority: normal | Milestone: 8.6.1 Component: Compiler | Version: 8.3 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by bgamari): It would be great if someone could offer a patch. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14261#comment:13 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC