Moritz Angermann via llvm-dev
2016-Jul-04 02:51 UTC
[llvm-dev] Simple program fails to compile depending on target os
Thanks! I also found test/CodeGen/ARM/ghc-tcreturn-lowered.ll, which tests only for thumbv7-eabi, so, i tried a few more variations: [x] arm64-apple-ios [x] arm64-apple-ios7.0.0 [x] arm64-apple-darwin [x] armv7-apple [x] thumbv7-apple [x] thumbv7-apple-darwin [x] i386-apple-ios [x] i386-apple-darwin [f] thumbv7-apple-ios [f] thumbv7-apple-ios7.0.0 [f] armv7-apple-ios I’ve also just build a HEAD version (LLVM version 3.9.0svn), and the code in fact *does* compile with 3.9.0svn. Cheers, Moritz> On Jul 4, 2016, at 10:19 AM, Tim Northover <t.p.northover at gmail.com> wrote: > > On 3 July 2016 at 18:26, Moritz Angermann via llvm-dev > <llvm-dev at lists.llvm.org> wrote: >> Any hints as to why this code only compiles for darwin and not for ios, would be greatly appreciated. > > I saw the same thing on a checkout from a few months back, but I then > updated and ToT seems to get it right (well, slightly different > CodeGen because the iOS linker only started supporting tail calls at > 5.0 or something so -darwin doesn't use them, but both compiled to > correct code). There's certainly been some churn in this bit of code > recently, so the bug was probably fixed incidentally as part of that. > > Tim.
Tim Northover via llvm-dev
2016-Jul-04 02:53 UTC
[llvm-dev] Simple program fails to compile depending on target os
On 3 July 2016 at 19:51, Moritz Angermann <moritz.angermann at gmail.com> wrote:> I’ve also just build a HEAD version (LLVM version 3.9.0svn), and the code in fact *does* > compile with 3.9.0svn.So, just to be clear, your list was from a slightly older version and we might not have anything to worry about? Otherwise I'm happy to help digging. Cheers. Tim.
Moritz Angermann via llvm-dev
2016-Jul-04 03:44 UTC
[llvm-dev] Simple program fails to compile depending on target os
>> I would however suggest to add -mtriple=armv7-apple-ios and -mtriple=armv7-apple-darwin >> to the test in test/CodeGen/ARM/ghc-tcreturn-lowered.ll, so that potential regressions, >> as found. > > The "-darwin" triple shouldn't really be used. Actually, I'm not sure > why it even exists: it could produce pretty much anything without > anyone inside Apple caring as part of their day job. > > I'm happy to add tests, but personally I'd suggest > "thumbv7-apple-ios7.0" and "armv7-apple-ios7.0" as the triples (iOS > 7.0 is a reasonable baseline). But I'd also suggest GHC uses > "thumbv7-apple-iosN". It's likely to be more performant than "armv7" > and is certainly a lot more tested (as the Clang default).That’s the one I stated out to begin with. Currently ghc, uses armv7-apple-darwin10, which however generates: warning: .macosx_version_min should only be used for macosx targets .macosx_version_min 10, 0 this triple that produces usable libs though. (thumbv7-apple-darwin10 does compile, however the produced library fails to work properly, which is likely a separate ghc bug). I’ll see that ghc used x86_64-apple-macosx10 for macOS builds then instead of the current x86_64-apple-darwin10.0.0. In the interim I don’t see a way around armv7-apple-darwin10 for the armv7 builds, as it crashes llc until 3.9 otherwise. For arm64, we’ll use arm64-apple-ios7.0.0. Any further suggestions are welcome! Cheers, Moritz