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

libbacktrace: fix build on Windows + resolve build requires conflicts #5575

Merged
merged 5 commits into from
May 22, 2021

Conversation

SpaceIm
Copy link
Contributor

@SpaceIm SpaceIm commented May 20, 2021

Specify library name and version: lib/1.0

This is also a good place to share with all of us why you are submitting this PR (specially if it is a new addition to ConanCenter): is it a dependency of other libraries you want to package? Are you the author of the library? Thanks!


  • I've read the guidelines for contributing.
  • I've followed the PEP8 style guides for Python code in the recipes.
  • I've used the latest Conan client version.
  • I've tried at least one configuration locally with the
    conan-center hook activated.

@conan-center-bot

This comment has been minimized.

@SpaceIm
Copy link
Contributor Author

SpaceIm commented May 20, 2021

I've also tried to build libbacktrace with Visual Studio. After fighting with a build context and autotools parameters, I was able to pass configure step but compilation fails due to pointer arithmetic on void *:

C:/users/spaceim/.conan/data/libbacktrace/cci.20210118/_/_/build/3fb49604f9c2f729b85ba3115852006824e72cab/source_subfolder/pecoff.c(158): warning C4820: 'debug_section_info': '4' bytes padding added after data member 'offset'
C:/users/spaceim/.conan/data/libbacktrace/cci.20210118/_/_/build/3fb49604f9c2f729b85ba3115852006824e72cab/source_subfolder/pecoff.c(188): warning C4100: 'callback': unreferenced formal parameter
C:/users/spaceim/.conan/data/libbacktrace/cci.20210118/_/_/build/3fb49604f9c2f729b85ba3115852006824e72cab/source_subfolder/pecoff.c(187): warning C4100: 'pc': unreferenced formal parameter
C:/users/spaceim/.conan/data/libbacktrace/cci.20210118/_/_/build/3fb49604f9c2f729b85ba3115852006824e72cab/source_subfolder/pecoff.c(186): warning C4100: 'state': unreferenced formal parameter
C:/users/spaceim/.conan/data/libbacktrace/cci.20210118/_/_/build/3fb49604f9c2f729b85ba3115852006824e72cab/source_subfolder/pecoff.c(201): warning C4100: 'callback': unreferenced formal parameter
C:/users/spaceim/.conan/data/libbacktrace/cci.20210118/_/_/build/3fb49604f9c2f729b85ba3115852006824e72cab/source_subfolder/pecoff.c(200): warning C4100: 'addr': unreferenced formal parameter
C:/users/spaceim/.conan/data/libbacktrace/cci.20210118/_/_/build/3fb49604f9c2f729b85ba3115852006824e72cab/source_subfolder/pecoff.c(199): warning C4100: 'state': unreferenced formal parameter
C:/users/spaceim/.conan/data/libbacktrace/cci.20210118/_/_/build/3fb49604f9c2f729b85ba3115852006824e72cab/source_subfolder/pecoff.c(361): warning C4267: 'function': conversion from 'size_t' to 'uint16_t', possible loss of data
C:/users/spaceim/.conan/data/libbacktrace/cci.20210118/_/_/build/3fb49604f9c2f729b85ba3115852006824e72cab/source_subfolder/pecoff.c(407): warning C4267: 'function': conversion from 'size_t' to 'uint16_t', possible loss of data
C:/users/spaceim/.conan/data/libbacktrace/cci.20210118/_/_/build/3fb49604f9c2f729b85ba3115852006824e72cab/source_subfolder/pecoff.c(452): warning C4245: '=': conversion from 'int' to 'uintptr_t', signed/unsigned mismatch
C:/users/spaceim/.conan/data/libbacktrace/cci.20210118/_/_/build/3fb49604f9c2f729b85ba3115852006824e72cab/source_subfolder/pecoff.c(531): warning C4100: 'error_callback': unreferenced formal parameter
C:/users/spaceim/.conan/data/libbacktrace/cci.20210118/_/_/build/3fb49604f9c2f729b85ba3115852006824e72cab/source_subfolder/pecoff.c(651): error C2036: 'const void *': unknown size
C:/users/spaceim/.conan/data/libbacktrace/cci.20210118/_/_/build/3fb49604f9c2f729b85ba3115852006824e72cab/source_subfolder/pecoff.c(685): error C2036: 'const void *': unknown size
C:/users/spaceim/.conan/data/libbacktrace/cci.20210118/_/_/build/3fb49604f9c2f729b85ba3115852006824e72cab/source_subfolder/pecoff.c(729): error C2036: 'const void *': unknown size
C:/users/spaceim/.conan/data/libbacktrace/cci.20210118/_/_/build/3fb49604f9c2f729b85ba3115852006824e72cab/source_subfolder/pecoff.c(731): warning C4267: '=': conversion from 'size_t' to 'off_t', possible loss of data
C:/users/spaceim/.conan/data/libbacktrace/cci.20210118/_/_/build/3fb49604f9c2f729b85ba3115852006824e72cab/source_subfolder/pecoff.c(750): warning C4456: declaration of 'str_off' hides previous local declaration
C:/users/spaceim/.conan/data/libbacktrace/cci.20210118/_/_/build/3fb49604f9c2f729b85ba3115852006824e72cab/source_subfolder/pecoff.c(599): note: see declaration of 'str_off'
C:/users/spaceim/.conan/data/libbacktrace/cci.20210118/_/_/build/3fb49604f9c2f729b85ba3115852006824e72cab/source_subfolder/pecoff.c(825): warning C4267: '=': conversion from 'size_t' to 'off_t', possible loss of data

https://github.com/ianlancetaylor/libbacktrace/blob/dedbe13fda00253fe5d4f2fb812c909729ed5937/pecoff.c#L651
https://github.com/ianlancetaylor/libbacktrace/blob/dedbe13fda00253fe5d4f2fb812c909729ed5937/pecoff.c#L685
https://github.com/ianlancetaylor/libbacktrace/blob/dedbe13fda00253fe5d4f2fb812c909729ed5937/pecoff.c#L729

madebr
madebr previously approved these changes May 20, 2021
@SpaceIm
Copy link
Contributor Author

SpaceIm commented May 20, 2021

I have a patch to build libbacktrace with Visual Studio, but I don't know if it makes sense when unwind is not available at build time.

it's worth noting that generated lib is quite limited in this case: projects calling backtrace_full and backtrace_simple functions will hit an error_callback with "no stack trace because unwind library not available"
@conan-center-bot

This comment has been minimized.

@SpaceIm SpaceIm changed the title libbacktrace: fix mingw build libbacktrace: fix build on Windows May 20, 2021
@SpaceIm SpaceIm closed this May 20, 2021
@SpaceIm SpaceIm reopened this May 20, 2021
@conan-center-bot

This comment has been minimized.

@conan-center-bot

This comment has been minimized.

@conan-center-bot

This comment has been minimized.

@@ -0,0 +1,54 @@
--- a/allocfail.c
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you intend to upstream this patch?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure. I don't know if it really makes sense to support Visual Studio. I didn't fix all the files actually, only the ones built when libunwind is not found.

@SpaceIm SpaceIm changed the title libbacktrace: fix build on Windows libbacktrace: fix build on Windows + resolve build requires conflicts May 21, 2021
@conan-center-bot
Copy link
Collaborator

All green in build 6 (21dee7caf71f57bab64e20c29871d08c3b91f3e6):

  • libbacktrace/cci.20210118@:
    All packages built successfully! (All logs)

@conan-center-bot conan-center-bot merged commit 970974a into conan-io:master May 22, 2021
@SpaceIm SpaceIm deleted the fix/libbacktrace-mingw branch May 22, 2021 15:04
madebr pushed a commit to madebr/conan-center-index that referenced this pull request Jun 21, 2021
…quires conflicts

* fix build with MinGW on Windows

* no os.rename

* clarify invalid configuration message for Visual Studio

* allow to build static lib with Visual Studio

it's worth noting that generated lib is quite limited in this case: projects calling backtrace_full and backtrace_simple functions will hit an error_callback with "no stack trace because unwind library not available"

* add -FS for Visual Studio
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants