Skip to content

Commit

Permalink
Clean IgProf for GCC 7
Browse files Browse the repository at this point in the history
Signed-off-by: David Abdurachmanov <David.Abdurachmanov@cern.ch>
  • Loading branch information
David Abdurachmanov authored and David Abdurachmanov committed Jan 20, 2017
1 parent 100a91c commit 0f28da5
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 0 deletions.
48 changes: 48 additions & 0 deletions igprof-gcc7.patch
@@ -0,0 +1,48 @@
diff --git a/src/buffer.cc b/src/buffer.cc
index f12dcfd..40c74d1 100644
--- a/src/buffer.cc
+++ b/src/buffer.cc
@@ -62,12 +62,11 @@ IgProfBuffer::allocateRaw(size_t size)
MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
if (data != MAP_FAILED)
return data;
- else
- {
- igprof_debug("failed to allocate memory for profile buffer: %s (%d)\n",
- strerror(errno), errno);
- igprof_abort();
- }
+
+ igprof_debug("failed to allocate memory for profile buffer: %s (%d)\n",
+ strerror(errno), errno);
+ igprof_abort();
+ __builtin_unreachable();
}

void
diff --git a/src/profile.cc b/src/profile.cc
index 33f069c..35bca5a 100644
--- a/src/profile.cc
+++ b/src/profile.cc
@@ -29,7 +29,7 @@
#endif

// Global variables initialised once here.
-HIDDEN void (*igprof_abort)(void) __attribute__((noreturn)) = &abort;
+HIDDEN void (*igprof_abort)(void) throw () = &abort;
HIDDEN char * (*igprof_getenv)(const char *) = &getenv;
HIDDEN int (*igprof_unsetenv)(const char *) = &unsetenv;
HIDDEN bool s_igprof_activated = false;
diff --git a/src/profile.h b/src/profile.h
index 2a980d2..933f2f4 100644
--- a/src/profile.h
+++ b/src/profile.h
@@ -21,7 +21,7 @@ extern IgProfAtomic s_igprof_enabled;
extern pthread_key_t s_igprof_bufkey;
extern pthread_key_t s_igprof_flagkey;
extern int s_igprof_stderrOpen;
-extern void (*igprof_abort) (void) __attribute__((noreturn));
+extern void (*igprof_abort) (void) throw ();
extern char * (*igprof_getenv) (const char *);
extern int (*igprof_unsetenv) (const char *);

3 changes: 3 additions & 0 deletions igprof.spec
Expand Up @@ -5,10 +5,13 @@
%define git_commit c6882f4d8e39893d71466ea23da643dafb60a496
Source0: git://github.com/%{git_repo}/igprof.git?obj=%{git_branch}/%{git_commit}&export=igprof-%{git_commit}&output=/igprof-%{git_commit}.tgz

Patch0: igprof-gcc7

Requires: pcre
BuildRequires: cmake libunwind libatomic_ops
%prep
%setup -T -b 0 -n igprof-%{git_commit}
%patch0 -p1

%build
mkdir -p %i
Expand Down

0 comments on commit 0f28da5

Please sign in to comment.