void-packages/srcpkgs/icecat/patches/fix-tools.patch

43 lines
1.4 KiB
Diff

--- tools/profiler/lul/LulElf.cpp.orig 2019-01-29 12:05:34.223834130 +0100
+++ tools/profiler/lul/LulElf.cpp 2019-01-29 12:08:02.480400845 +0100
@@ -469,10 +469,10 @@
// Return the non-directory portion of FILENAME: the portion after the
// last slash, or the whole filename if there are no slashes.
string BaseFileName(const string& filename) {
- // Lots of copies! basename's behavior is less than ideal.
- char* c_filename = strdup(filename.c_str());
- string base = basename(c_filename);
- free(c_filename);
+ // basename's behavior is less than ideal so avoid it
+ const char *c_filename = filename.c_str();
+ const char *p = strrchr(c_filename, '/');
+ string base = p ? p+1 : c_filename;
return base;
}
--- tools/profiler/core/platform-linux-android.cpp.orig 2019-01-29 12:09:40.980448579 +0100
+++ tools/profiler/core/platform-linux-android.cpp 2019-01-29 12:11:09.689590967 +0100
@@ -253,7 +253,11 @@
// Request profiling signals.
struct sigaction sa;
+#if defined(GP_ARCH_arm)
+ sa.sa_sigaction = SigprofHandler;
+#else
sa.sa_sigaction = MOZ_SIGNAL_TRAMPOLINE(SigprofHandler);
+#endif
sigemptyset(&sa.sa_mask);
sa.sa_flags = SA_RESTART | SA_SIGINFO;
if (sigaction(SIGPROF, &sa, &mOldSigprofHandler) != 0) {
@@ -497,8 +501,10 @@
ucontext_t sSyncUContext;
void Registers::SyncPopulate() {
+#if defined(__GLIBC__)
if (!getcontext(&sSyncUContext)) {
PopulateRegsFromContext(*this, &sSyncUContext);
}
+#endif
}
#endif