RxSwift: RxCocoa +load conflicts at link time in Xcode 12

Short description of the issue:

Xcode 12 beta 1 produces a compile warning when linking: “ld: warning: method ‘+load’ in category from …RxCocoa.build/Objects-normal-tsan/x86_64/_RXObjCRuntime.o conflicts with same method from another category”

Expected outcome:

No warnings.

What actually happens:

Repeated linker warnings:

ld: warning: method '+load' in category from ...RxCocoa.build/Objects-normal-tsan/x86_64/_RXObjCRuntime.o conflicts with same method from another category
ld: warning: method '+load' in category from ...RxCocoa.build/Objects-normal-tsan/x86_64/_RXObjCRuntime.o conflicts with same method from another category
ld: warning: method '+load' in category from ...RxCocoa.build/Objects-normal-tsan/x86_64/_RXObjCRuntime.o conflicts with same method from another category
ld: warning: method '+load' in category from ...RxCocoa.build/Objects-normal-tsan/x86_64/_RXObjCRuntime.o conflicts with same method from another category
ld: warning: method '+load' in category from ...RxCocoa.build/Objects-normal-tsan/x86_64/_RXObjCRuntime.o conflicts with same method from another category
ld: warning: method '+load' in category from ...RxCocoa.build/Objects-normal-tsan/x86_64/_RXObjCRuntime.o conflicts with same method from another category
ld: warning: method '+load' in category from ...RxCocoa.build/Objects-normal-tsan/x86_64/_RXObjCRuntime.o conflicts with same method from another category
ld: warning: method '+load' in category from ...RxCocoa.build/Objects-normal-tsan/x86_64/_RXObjCRuntime.o conflicts with same method from another category
ld: warning: method '+load' in category from ...RxCocoa.build/Objects-normal-tsan/x86_64/_RXObjCRuntime.o conflicts with same method from another category
ld: warning: method '+load' in category from ...RxCocoa.build/Objects-normal-tsan/x86_64/_RXObjCRuntime.o conflicts with same method from another category
ld: warning: method '+load' in category from ...RxCocoa.build/Objects-normal-tsan/x86_64/_RXObjCRuntime.o conflicts with same method from another category
ld: warning: method '+load' in category from ...RxCocoa.build/Objects-normal-tsan/x86_64/_RXObjCRuntime.o conflicts with same method from another category
ld: warning: method '+load' in category from ...RxCocoa.build/Objects-normal-tsan/x86_64/_RXObjCRuntime.o conflicts with same method from another category
ld: warning: method '+load' in category from ...RxCocoa.build/Objects-normal-tsan/x86_64/_RXObjCRuntime.o conflicts with same method from another category
ld: warning: method '+load' in category from ...RxCocoa.build/Objects-normal-tsan/x86_64/_RXObjCRuntime.o conflicts with same method from another category
ld: warning: method '+load' in category from ...RxCocoa.build/Objects-normal-tsan/x86_64/_RXObjCRuntime.o conflicts with same method from another category
ld: warning: method '+load' in category from ...RxCocoa.build/Objects-normal-tsan/x86_64/_RXObjCRuntime.o conflicts with same method from another category
ld: warning: method '+load' in category from ...RxCocoa.build/Objects-normal-tsan/x86_64/_RXObjCRuntime.o conflicts with same method from another category
ld: warning: method '+load' in category from ...RxCocoa.build/Objects-normal-tsan/x86_64/_RXObjCRuntime.o conflicts with same method from another category
ld: warning: method '+load' in category from ...RxCocoa.build/Objects-normal-tsan/x86_64/_RXObjCRuntime.o conflicts with same method from another category
ld: warning: method '+load' in category from ...RxCocoa.build/Objects-normal-tsan/x86_64/_RXObjCRuntime.o conflicts with same method from another category
ld: warning: method '+load' in category from ...RxCocoa.build/Objects-normal-tsan/x86_64/_RXObjCRuntime.o conflicts with same method from another category
ld: warning: method '+load' in category from ...RxCocoa.build/Objects-normal-tsan/x86_64/_RXObjCRuntime.o conflicts with same method from another category
ld: warning: method '+load' in category from ...RxCocoa.build/Objects-normal-tsan/x86_64/_RXObjCRuntime.o conflicts with same method from another category
ld: warning: method '+load' in category from ...RxCocoa.build/Objects-normal-tsan/x86_64/_RXObjCRuntime.o conflicts with same method from another category
ld: warning: method '+load' in category from ...RxCocoa.build/Objects-normal-tsan/x86_64/_RXObjCRuntime.o conflicts with same method from another category

Self contained code example that reproduces the issue:

N/AA

RxSwift/RxCocoa/RxBlocking/RxTest version/commit

RxCocoa 5.1.1

Platform/Environment

  • iOS

How easy is to reproduce? (chances of successful reproduce after running the self contained code)

  • easy, 100% repro

Xcode version:

Version 12.0 beta (12A6159)

Installation method:

  • CocoaPods
  • Carthage
  • Git submodules

I have multiple versions of Xcode installed: (so we can know if this is a potential cause of your issue)

  • yes (which ones) 12b1, 11.5, 11.4, 11.3, 10.2
  • no

Level of RxSwift knowledge: (this is so we can understand your level of knowledge and formulate the response in an appropriate manner)

  • just starting
  • I have a small code base
  • I have a significant code base

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 1
  • Comments: 16 (13 by maintainers)

Most upvoted comments

I did some digging on this, inspecting the preprocessed Objective-C code, the symbols defined by RxCocoaRuntime.o and the resulting RxCocoa binary. I struggled to find any evidence of duplicated category methods.

I also performed the following experiment:

  1. Build RxCocoa in Xcode 12 beta.
  2. Copy the linker invocation that produces the warnings.
  3. Without changing anything else, change /Applications/Xcode-beta.app to /Applications/Xcode.app in the path to the linker command (i.e., clang).
  4. Observe whether Xcode 11’s linker produces the same warnings when given exactly the same intermediate object files as input.

The answer? Xcode 11 gives no warnings, which is the strongest evidence I could find that maybe this warning is spurious and could be a bug with the Xcode 12 linker.

Thanks, Scott 😃 This seems quite weird, but I’ll see if I can take a look soon.