nodejs-v8-gregs-fix.patch 1.5 KB

1234567891011121314151617181920212223242526272829
  1. Fix compilation for ARM/uClibc
  2. Patch from Remi Duraffort <remi.duraffort@st.com>, taken from
  3. https://code.google.com/p/v8/source/detail?r=12094
  4. Signed-off-by: Daniel Price <daniel.price@gmail.com>
  5. --- a/deps/v8/src/platform-linux.cc
  6. +++ b/deps/v8/src/platform-linux.cc
  7. @@ -1025,7 +1025,8 @@ static void ProfilerSignalHandler(int signal, siginfo_t* info, void* context) {
  8. sample->fp = reinterpret_cast<Address>(mcontext.gregs[REG_RBP]);
  9. #elif V8_HOST_ARCH_ARM
  10. // An undefined macro evaluates to 0, so this applies to Android's Bionic also.
  11. -#if (__GLIBC__ < 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ <= 3))
  12. +#if (__GLIBC__ < 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ <= 3) && \
  13. + !defined(__UCLIBC__))
  14. sample->pc = reinterpret_cast<Address>(mcontext.gregs[R15]);
  15. sample->sp = reinterpret_cast<Address>(mcontext.gregs[R13]);
  16. sample->fp = reinterpret_cast<Address>(mcontext.gregs[R11]);
  17. @@ -1033,7 +1034,8 @@ static void ProfilerSignalHandler(int signal, siginfo_t* info, void* context) {
  18. sample->pc = reinterpret_cast<Address>(mcontext.arm_pc);
  19. sample->sp = reinterpret_cast<Address>(mcontext.arm_sp);
  20. sample->fp = reinterpret_cast<Address>(mcontext.arm_fp);
  21. -#endif // (__GLIBC__ < 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ <= 3))
  22. +#endif // (__GLIBC__ < 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ <= 3) &&
  23. + // !defined(__UCLIBC__))
  24. #elif V8_HOST_ARCH_MIPS
  25. sample->pc = reinterpret_cast<Address>(mcontext.pc);
  26. sample->sp = reinterpret_cast<Address>(mcontext.gregs[29]);