discuss-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Clang 14 issues building Objective-C with ARC


From: Frederik Seiffert
Subject: Re: Clang 14 issues building Objective-C with ARC
Date: Wed, 28 Sep 2022 12:26:31 +0200

We’ve gotten this fixed for Clang 16. It did seem to be a Windows-only issue.

We also looked at the ObjC test suite in LLVM, and it seems like most of the tests are currently targeting macOS only, so the GNUstep runtime support doesn’t have a lot of coverage. We’re planning to try to enable as many as possible for Linux and/or Windows (at least the ones that don’t require adjusting the bitcode in the tests).

Frederik


Am 08.08.2022 um 17:13 schrieb Frederik Seiffert <frederik@algoriddim.com>:

As mentioned in Saturday’s meeting I am seeing a couple issues building Objective-C code with ARC using Clang/LLVM 14 or 15rc1 on Windows, whereas the same code works fine using Clang 13.

I managed to distill one issue here, it would be great if someone could check whether this also affects platforms other than Windows:

Additionally I’m seeing some very strange behavior calling class methods in GNUstep with Clang 14 and 15rc1 using ARC and -O1 or -O2, which might be related:

@try {
id processInfoClass = [NSProcessInfo class];
NSLog(@"processInfoClass: %@ (%p)", processInfoClass, processInfoClass);
id processInfo = [NSProcessInfo processInfo];
NSLog(@"processInfo: %@ (%p)", processInfo, processInfo);
id arguments = [processInfo arguments];
NSLog(@"arguments: %@", arguments);
@catch (id exc) {
NSLog(@"Exception: %@", exc);
}


This will result in the following exception when calling -processInfo:
<NSException: 0x8d20a068> NAME:NSInvalidArgumentException REASON:NSObject(class) does not recognize processInfo INFO:(null)

But when I replace [NSProcessInfo processInfo] with [processInfoClass processInfo], I’m getting this exception from calling -arguments instead:
<NSException: 0xebb88048> NAME:NSInvalidArgumentException REASON:NSProcessInfo(class) does not recognize arguments INFO:(null)

It seems like there’s some mixup with what kind of class objects the compiler returns, but it depends on the exact code, e.g. when calling just one of these methods above individually it works fine. Again it would be great if someone could try to reproduce this on other platforms to get a better picture.

At the same time I was wondering if we can come up with a way to catch issues like that sooner in the future, ideally already during LLVM beta/RC phases. One option might be to add a CI phase to always build with the latest LLVM (RC) release from GitHub (https://github.com/llvm/llvm-project/releases). Ideally we’d also have more tests for Objective-C with the GNU runtime in LLVM itself, but I’m not sure if anyone here would have the expertise to add these.

Frederik



reply via email to

[Prev in Thread] Current Thread [Next in Thread]