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

coreclr build fails when specifying cmakeargs -DCLR_CMAKE_USE_SYSTEM_LIBUNWIND=TRUE #2014

Closed
dseefeld opened this issue Jan 22, 2020 · 17 comments
Assignees
Milestone

Comments

@dseefeld
Copy link
Contributor

When trying to build coreclr using the system version of libunwind, the build fails with the following error:

$ ./build.sh cmakeargs -DCLR_CMAKE_USE_SYSTEM_LIBUNWIND=TRUE
...
../../dlls/mscordac/libmscordaccore.so: undefined reference to `_OOP_find_proc_info'
clang-9: error: linker command failed with exit code 1 (use -v to see invocation)
gmake[2]: *** [src/debug/createdump/createdump] Error 1
gmake[1]: *** [src/debug/createdump/CMakeFiles/createdump.dir/all] Error 2
gmake[1]: *** Waiting for unfinished jobs....
[100%] Built target mscordbi
gmake: *** [all] Error 2
Failed to build CoreCLR component.
@Dotnet-GitSync-Bot Dotnet-GitSync-Bot added area-Infrastructure-coreclr untriaged New issue has not been triaged by the area owner labels Jan 22, 2020
@hoyosjs
Copy link
Member

hoyosjs commented Jan 22, 2020

What system/OS is this?

@hoyosjs
Copy link
Member

hoyosjs commented Jan 22, 2020

@mikem8361 looks like this comes from our work in ARM unwinding (b61cc2f). Looks like _OOP_find_proc_info was added directly to libunwind. However this function only gets build then:

add_subdirectory(libunwind)
The easiest solution would be to hoist such logic into another statically linkable asset, but if memory serves he right we use types that are not available in the public libunwind surface area.

@dseefeld is this for sourcebuild? What's the impact if so? Or is this more around serviceability or the ability to build like that?

@dseefeld
Copy link
Contributor Author

@hoyosjs Yes. This is for sourcebuild. The impact is that RedHat has requested that we use the local system's libunwind for portable builds. See dotnet/source-build#391 The OS that I'm using to build this is CentOS.

@mikem8361 mikem8361 self-assigned this Jan 22, 2020
@mikem8361 mikem8361 added this to the 5.0 milestone Jan 22, 2020
@mikem8361 mikem8361 added area-Diagnostics-coreclr and removed untriaged New issue has not been triaged by the area owner labels Jan 22, 2020
@mikem8361 mikem8361 added the p1 label Mar 24, 2020
@sdmaclea
Copy link
Contributor

libunwind/libunwind#187 is starting the process of adding _OOP_find_proc_info to libunwind, but it is unlikely to make it into system version of libunwind for a while. It would need to wait at least to the 1.6 release. (1.5 isn't released yet).

Since this is only needed for the DAC unwind, the solution maybe to either:

  • Disable the the DAC Out of Process unwind feature.
  • Use the local libunwind source for DAC only.

@mikem8361
Copy link
Member

mikem8361 commented Jun 18, 2020 via email

@sdmaclea
Copy link
Contributor

sdmaclea commented Jun 19, 2020

I guess the third option would be to revert part of #26082 (to keep our custom oop code) when CLR_CMAKE_USE_SYSTEM_LIBUNWIND=TRUE until libunwind/libunwind#187 is released and available to RHEL.

@omajid
Copy link
Member

omajid commented Jun 24, 2020

cc @tmds

@mikem8361
Copy link
Member

Adding @jashook

@tmds
Copy link
Member

tmds commented Jun 30, 2020

I guess the third option would be to revert part of #26082 (to keep our custom oop code) when CLR_CMAKE_USE_SYSTEM_LIBUNWIND=TRUE until libunwind/libunwind#187 is released and available to RHEL.

So this option is: allow to use the system libunwind, and provide _OOP_find_proc_info as part of the runtime repo?

This seems like the most interesting option to me.

@mikem8361
Copy link
Member

The problem is the functions that _OOP_find_proc_info uses are internal to libunwind.

@tmds
Copy link
Member

tmds commented Jul 1, 2020

Until @sdmaclea 's libunwind PR gets merged and becomes available, the least work is to use the packed libunwind.
We can look at backporting the PR for distros we care about.

We should keep this issue open to get CLR_CMAKE_USE_SYSTEM_LIBUNWIND=true back in a working state.

@omajid wdyt?

@tmds
Copy link
Member

tmds commented Jul 15, 2020

@sdmaclea are you still actively pursuing libunwind/libunwind#187?

@omajid are you ok with using the packed libunwind until the feature is available as part of system libunwind?
We can consider backporting it once the feature is merged upstream.

@sdmaclea
Copy link
Contributor

I have been working on other issues. I can probably look at libunwind/libunwind#187 later this week.

@sdmaclea
Copy link
Contributor

#39213 restored some of the code which was removed in #26082. It makes it simpler to fix this issue more directly. @mikem8361 has been considering an approach like this...

@mikem8361
Copy link
Member

Now that PR #39213 is in I was planning to add the rest of the necessary code and build stuff in the next month. It missed today's preview8 snap but it be done in the next week or two.

@mikem8361
Copy link
Member

I have this coded up and I'm testing.

@omajid
Copy link
Member

omajid commented Jul 15, 2020

@omajid are you ok with using the packed libunwind until the feature is available as part of system libunwind? We can consider backporting it once the feature is merged upstream.

Yes, we can use the bundled libunwind until the features are available upstream.

mikem8361 added a commit to mikem8361/runtime that referenced this issue Jul 15, 2020
Fixes issue #dotnet#2014

Adds back ELF unwind info parsing code that has been around since 3.0 so it is fairly well tested. It is conditional on CLR_CMAKE_USE_SYSTEM_LIBUNWIND, otherwise, PAL_VirtualUnwindOutOfProc uses the new libunwind8 _OOP_find_proc_info function.
mikem8361 added a commit that referenced this issue Jul 16, 2020
Fixes issue ##2014

Adds back ELF unwind info parsing code that has been around since 3.0 so it is fairly well tested. It is conditional on CLR_CMAKE_USE_SYSTEM_LIBUNWIND, otherwise, PAL_VirtualUnwindOutOfProc uses the new libunwind8 _OOP_find_proc_info function.
mikem8361 added a commit to mikem8361/runtime that referenced this issue Jul 16, 2020
Fixes issue #dotnet#2014

Adds back ELF unwind info parsing code that has been around since 3.0 so it is fairly well tested. It is conditional on CLR_CMAKE_USE_SYSTEM_LIBUNWIND, otherwise, PAL_VirtualUnwindOutOfProc uses the new libunwind8 _OOP_find_proc_info function.
mikem8361 added a commit that referenced this issue Jul 16, 2020
Fixes issue ##2014

Adds back ELF unwind info parsing code that has been around since 3.0 so it is fairly well tested. It is conditional on CLR_CMAKE_USE_SYSTEM_LIBUNWIND, otherwise, PAL_VirtualUnwindOutOfProc uses the new libunwind8 _OOP_find_proc_info function.
@ghost ghost locked as resolved and limited conversation to collaborators Dec 11, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

8 participants