Skip to content

Conversation

@grendello
Copy link
Contributor

Context: 0e4c29a

0e4c29a introduced builds of two library stubs, for libc
and libm libraries, to be used when no NDK is installed.

It appears that it can sometimes cause these link errors:

ld : error : undefined symbol: vtable for __cxxabiv1::__function_type_info [/Users/builder/azdo/_work/3/s/xamarin-android/src/monodroid/monodroid.csproj]
         >>> referenced by stub.cc
         >>>               CMakeFiles/c.dir/libstub/stub.cc.o:(typeinfo for void ())
         >>> the vtable symbol may be undefined because the class is missing its key function (see https://lld.llvm.org/missingkeyfunction)
     >clang++ : error : linker command failed with exit code 1 (use -v to see invocation) [/Users/builder/azdo/_work/3/s/xamarin-android/src/monodroid/monodroid.csproj]

The missing symbol suggests that the problem lies in the
lack of RTTI infrastructure in the library stub. Attempt
to mitigate the issue by disabling both exceptions and
RTTI when building the stubs.

Context: 0e4c29a

0e4c29a introduced builds of two library stubs, for libc
and libm libraries, to be used when no NDK is installed.

It appears that it can sometimes cause these link errors:

    ld : error : undefined symbol: vtable for __cxxabiv1::__function_type_info [/Users/builder/azdo/_work/3/s/xamarin-android/src/monodroid/monodroid.csproj]
             >>> referenced by stub.cc
             >>>               CMakeFiles/c.dir/libstub/stub.cc.o:(typeinfo for void ())
             >>> the vtable symbol may be undefined because the class is missing its key function (see https://lld.llvm.org/missingkeyfunction)
         >clang++ : error : linker command failed with exit code 1 (use -v to see invocation) [/Users/builder/azdo/_work/3/s/xamarin-android/src/monodroid/monodroid.csproj]

The missing symbol suggests that the problem lies in the
lack of RTTI infrastructure in the library stub.  Attempt
to mitigate the issue by disabling both exceptions and
RTTI when building the stubs.
@grendello grendello requested a review from jonpryor as a code owner March 16, 2023 23:14
@grendello grendello requested a review from dellis1972 March 16, 2023 23:14
@jonpryor jonpryor merged commit 43dc9ba into dotnet:main Mar 17, 2023
@grendello grendello deleted the fix-stubs-link-error branch March 17, 2023 08:14
grendello added a commit to grendello/xamarin-android that referenced this pull request Mar 17, 2023
* main:
  [monodroid] Attempt to fix a macOS lib{c,m} link error (dotnet#7891)
@github-actions github-actions bot locked and limited conversation to collaborators Jan 22, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants