Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[LTO, MachO] Tests fail when -objc_relative_method_lists #101419

Open
DataCorrupted opened this issue Jul 31, 2024 · 2 comments
Open

[LTO, MachO] Tests fail when -objc_relative_method_lists #101419

DataCorrupted opened this issue Jul 31, 2024 · 2 comments
Assignees

Comments

@DataCorrupted
Copy link
Member

The following tests fail when -objc_relative_method_lists are added. (commit bb4aeb6)

MachO/objc-category-conflicts.s
MachO/objc-category-merging-complete-test.s
MachO/objc-category-merging-erase-objc-name-test.s
MachO/objc-category-merging-minimal.s

All cases involve an invalid pointer cast at certain point.
For example, in objc-category-conflicts.s gets the following error:

RUN: at line 15: /home/peterrong/llvm-project/build/bin/llvm-mc -filetype=obj -triple=x86_64-apple-macos11.0 -I /home/peterrong/llvm-project/build/tools/lld/test/MachO/Output/objc-category-conflicts.s.tmp /home/peterrong/llvm-project/build/tools/lld/test/MachO/Output/objc-category-conflicts.s.tmp/klass-with-no-rodata.s -o /home/peterrong/llvm-project/build/tools/lld/test/MachO/Output/objc-category-conflicts.s.tmp/klass-with-no-rodata.o
+ /home/peterrong/llvm-project/build/bin/llvm-mc -filetype=obj -triple=x86_64-apple-macos11.0 -I /home/peterrong/llvm-project/build/tools/lld/test/MachO/Output/objc-category-conflicts.s.tmp /home/peterrong/llvm-project/build/tools/lld/test/MachO/Output/objc-category-conflicts.s.tmp/klass-with-no-rodata.s -o /home/peterrong/llvm-project/build/tools/lld/test/MachO/Output/objc-category-conflicts.s.tmp/klass-with-no-rodata.o
RUN: at line 16: ld64.lld -arch x86_64 -platform_version macos 11.0 11.0 -syslibroot /home/peterrong/llvm-project/lld/test/MachO/Inputs/MacOSX.sdk -lSystem -fatal_warnings -dylib -lobjc /home/peterrong/llvm-project/build/tools/lld/test/MachO/Output/objc-category-conflicts.s.tmp/klass.o -o /home/peterrong/llvm-project/build/tools/lld/test/MachO/Output/objc-category-conflicts.s.tmp/libklass.dylib
+ ld64.lld -arch x86_64 -platform_version macos 11.0 11.0 -syslibroot /home/peterrong/llvm-project/lld/test/MachO/Inputs/MacOSX.sdk -lSystem -fatal_warnings -dylib -lobjc /home/peterrong/llvm-project/build/tools/lld/test/MachO/Output/objc-category-conflicts.s.tmp/klass.o -o /home/peterrong/llvm-project/build/tools/lld/test/MachO/Output/objc-category-conflicts.s.tmp/libklass.dylib
ld64.lld: /home/peterrong/llvm-project/llvm/include/llvm/ADT/PointerUnion.h:156: T llvm::PointerUnion<PTs>::get() const [with T = lld::macho::Symbol*; PTs = {lld::macho::Symbol*, lld::macho::InputSection*}]: Assertion `isa<T>(*this) && "Invalid accessor called"' failed.
/home/peterrong/llvm-project/build/tools/lld/test/MachO/Output/objc-category-conflicts.s.script: line 19: 378103 Aborted
@llvmbot
Copy link
Collaborator

llvmbot commented Jul 31, 2024

@llvm/issue-subscribers-lld-macho

Author: Peter Rong (DataCorrupted)

The following tests fail when `-objc_relative_method_lists` are added. (commit bb4aeb6)
MachO/objc-category-conflicts.s
MachO/objc-category-merging-complete-test.s
MachO/objc-category-merging-erase-objc-name-test.s
MachO/objc-category-merging-minimal.s

All cases involve an invalid pointer cast at certain point.
For example, in objc-category-conflicts.s gets the following error:

RUN: at line 15: /home/peterrong/llvm-project/build/bin/llvm-mc -filetype=obj -triple=x86_64-apple-macos11.0 -I /home/peterrong/llvm-project/build/tools/lld/test/MachO/Output/objc-category-conflicts.s.tmp /home/peterrong/llvm-project/build/tools/lld/test/MachO/Output/objc-category-conflicts.s.tmp/klass-with-no-rodata.s -o /home/peterrong/llvm-project/build/tools/lld/test/MachO/Output/objc-category-conflicts.s.tmp/klass-with-no-rodata.o
+ /home/peterrong/llvm-project/build/bin/llvm-mc -filetype=obj -triple=x86_64-apple-macos11.0 -I /home/peterrong/llvm-project/build/tools/lld/test/MachO/Output/objc-category-conflicts.s.tmp /home/peterrong/llvm-project/build/tools/lld/test/MachO/Output/objc-category-conflicts.s.tmp/klass-with-no-rodata.s -o /home/peterrong/llvm-project/build/tools/lld/test/MachO/Output/objc-category-conflicts.s.tmp/klass-with-no-rodata.o
RUN: at line 16: ld64.lld -arch x86_64 -platform_version macos 11.0 11.0 -syslibroot /home/peterrong/llvm-project/lld/test/MachO/Inputs/MacOSX.sdk -lSystem -fatal_warnings -dylib -lobjc /home/peterrong/llvm-project/build/tools/lld/test/MachO/Output/objc-category-conflicts.s.tmp/klass.o -o /home/peterrong/llvm-project/build/tools/lld/test/MachO/Output/objc-category-conflicts.s.tmp/libklass.dylib
+ ld64.lld -arch x86_64 -platform_version macos 11.0 11.0 -syslibroot /home/peterrong/llvm-project/lld/test/MachO/Inputs/MacOSX.sdk -lSystem -fatal_warnings -dylib -lobjc /home/peterrong/llvm-project/build/tools/lld/test/MachO/Output/objc-category-conflicts.s.tmp/klass.o -o /home/peterrong/llvm-project/build/tools/lld/test/MachO/Output/objc-category-conflicts.s.tmp/libklass.dylib
ld64.lld: /home/peterrong/llvm-project/llvm/include/llvm/ADT/PointerUnion.h:156: T llvm::PointerUnion&lt;PTs&gt;::get() const [with T = lld::macho::Symbol*; PTs = {lld::macho::Symbol*, lld::macho::InputSection*}]: Assertion `isa&lt;T&gt;(*this) &amp;&amp; "Invalid accessor called"' failed.
/home/peterrong/llvm-project/build/tools/lld/test/MachO/Output/objc-category-conflicts.s.script: line 19: 378103 Aborted

@alx32 alx32 self-assigned this Aug 15, 2024
@alx32
Copy link
Contributor

alx32 commented Aug 15, 2024

#104081 (review) fixes part of this, but there is a separate issue with MachO/objc-category-merging-complete-test.s

@EugeneZelenko EugeneZelenko removed the lld label Aug 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants