Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@graysky2
Copy link

@graysky2 graysky2 commented Aug 7, 2025

On OpenWrt when bulding for arm_cortex-a15_neon-vpfv4 or arm_cortex-a9_vfpv3-d16, the build errors out due to an undefined symbol _URC_NORMAL_STOP. This usually happens when the required header (typically <unwind.h>) is not included, or the toolchain's unwind implementation does not provide this definition.

Error:
src/stacktrace_libgcc-inl.h: In function '_Unwind_Reason_Code libgcc_backtrace_helper(_Unwind_Context*, void*)': src/stacktrace_libgcc-inl.h:69:12: error: '_URC_NORMAL_STOP' was not declared in this scope
69 | return _URC_NORMAL_STOP;
|

A work-around is to add definition.

@alk
Copy link
Contributor

alk commented Aug 7, 2025

Thanks for the patch, but I would like to know more about those toolchains. Are they based on gcc or clang or maybe something else? Can I get one of these downloaded somewhere? We definitely include <unwind.h> header, so this define should be there.

In theory, replacing URC_NORMAL_STOP with _URC_END_OF_STACK could cause trouble for some other toolchains.

@graysky2
Copy link
Author

graysky2 commented Aug 7, 2025

@alk
Copy link
Contributor

alk commented Aug 8, 2025

Thanks. Indeed, turns out arm eabi implementation of unwind.h doesn't have URC_NORMAL_STOP, but URC_END_OF_STACK is supported since at least 2005. That is long enough. I also see that libbacktrace used END_OF_STACK. So gives me piece of mind.

@alk
Copy link
Contributor

alk commented Aug 8, 2025

My only ask is to fix commit message. It says youre adding definition, and what you're doing instead is using URC_END_OF_STACK.

Also can you wrap long lines in the commit message to be no longer than 70 chars?

On OpenWrt when bulding for arm_cortex-a15_neon-vpfv4 or
arm_cortex-a9_vfpv3-d16, the build errors out due to an undefined symbol
_URC_NORMAL_STOP. This usually happens when the required header
(typically <unwind.h>) is not included, or the toolchain's unwind
implementation does not provide this definition.

Error:
src/stacktrace_libgcc-inl.h: In function '_Unwind_Reason_Code libgcc_backtrace_helper(_Unwind_Context*, void*)':
src/stacktrace_libgcc-inl.h:69:12: error: '_URC_NORMAL_STOP' was not declared in this scope
   69 |     return _URC_NORMAL_STOP;
      |

A work-around is to use URC_END_OF_STACK.

Signed-off-by: graysky <therealgraysky AT proton DOT me>
@graysky2
Copy link
Author

graysky2 commented Aug 8, 2025

you bet, done

@alk alk merged commit 2d27713 into gperftools:master Aug 8, 2025
8 checks passed
@alk
Copy link
Contributor

alk commented Aug 8, 2025

Thanks! Merged.

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.

2 participants