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

HAVE_SYMBOLIZE not defined when HAVE_LINK_H is #1085

Closed
wants to merge 1 commit into from

Conversation

wzheng21
Copy link
Contributor

Fixing issue #1084 . We are trying to bump glog up to latest version using bazel in our project.

In glog.bzl, there's HAVE_LINK_H defined. However, in symbolize.h, it doesn't lead
to defining HAVE_SYMBOLIZE, resulting in the error

warning: Symbolize functionality is not available for target platform: stack dump will contain empty frames. [-W#pragma-messages]
#  pragma message( \
          ^
1 warning generated.

@wzheng21 wzheng21 force-pushed the 031224-missing-have-link-h branch from 536c060 to e46e9fd Compare March 12, 2024 04:26
Copy link
Collaborator

@sergiud sergiud left a comment

Choose a reason for hiding this comment

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

Thanks for the PR.

What you are seeing is not an error but a warning. Please also make sure to modify Bazel files only if the CMake build is not affected to avoid side effects.

@@ -80,7 +80,7 @@
#ifndef GLOG_NO_SYMBOLIZE_DETECTION
# ifndef HAVE_SYMBOLIZE
// defined by gcc
# if defined(HAVE_ELF_H) || defined(HAVE_SYS_EXEC_ELF_H)
# if defined(HAVE_ELF_H) || defined(HAVE_SYS_EXEC_ELF_H) || defined(HAVE_LINK_H)
# define HAVE_SYMBOLIZE
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why do you need this additional check? In CMake builds this define is not necessary. Thus modifications should be limited to Bazel files only.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

thanks for letting me know this. i agree this would probably introduce undesirable side effects.

In the recent version of glog, HAVE_SYMBOLIZE is not "derived" anymore on linux platform with bazel, unlike previous versions. (i am referring to the one we were using from jan-02-2024)

what's your suggestion getting around with that? just hardcode -DHAVE_SYMBOLIZE in linux_only_copts inside glog.bzl? If so, do you think if anybody else needs this (Im fine (not) sending the patch)

thnx

@wzheng21
Copy link
Contributor Author

Thanks for the PR.

What you are seeing is not an error but a warning. Please also make sure to modify Bazel files only if the CMake build is not affected to avoid side effects.

That makes sense. Sorry it's a warning. Actually we declared things like InstallSymbolizeCallback in our implementation, then we actually get linking error with the new version of glog. (which makes sense since there's no HAVE_SYMBOLIZE anymore, so the function definition is never compiled into the library)

@jms13
Copy link

jms13 commented Mar 23, 2024

Alternative solution with "bazel only changes": add -DHAVE_SYMBOLIZE to bazel/glog.bzl in linux_only_copts.

@sergiud
Copy link
Collaborator

sergiud commented Aug 16, 2024

Fixed by #1116.

@sergiud sergiud closed this Aug 16, 2024
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.

3 participants