summaryrefslogtreecommitdiff
path: root/schulung_tools/libduma
diff options
context:
space:
mode:
authorJohn Ogness <john.ogness@linutronix.de>2017-12-19 10:59:40 +0100
committerJohn Ogness <john.ogness@linutronix.de>2017-12-19 10:59:40 +0100
commit270520b4a2eac8725c8575c3180964289722e191 (patch)
treed9512cd96d0c52e14293c3f8bc19fd168ee14025 /schulung_tools/libduma
parent27209bb802048f4803d9cd9a5c2f99d613986446 (diff)
schulung_tools: add various demos and tools
Different tools have been used by various trainers as demos. Put all these into master so they are available to all trainers. ipc_pipe: ipc demo using pipes ipc_shm: ipc demo using shared memory libduma: source and instructions for compiling libduma matrix: demo of good and bad cache access mtrace: patch and infos for using mtrace with ASLR rtex: demo of handling page faults Signed-off-by: John Ogness <john.ogness@linutronix.de>
Diffstat (limited to 'schulung_tools/libduma')
-rw-r--r--schulung_tools/libduma/0003-fix-C++14.patch65
-rw-r--r--schulung_tools/libduma/README10
-rw-r--r--schulung_tools/libduma/duma_2.5.15-1.1.diff.gzbin0 -> 7729 bytes
-rw-r--r--schulung_tools/libduma/duma_2.5.15.orig.tar.gzbin0 -> 240479 bytes
4 files changed, 75 insertions, 0 deletions
diff --git a/schulung_tools/libduma/0003-fix-C++14.patch b/schulung_tools/libduma/0003-fix-C++14.patch
new file mode 100644
index 0000000..d19213c
--- /dev/null
+++ b/schulung_tools/libduma/0003-fix-C++14.patch
@@ -0,0 +1,65 @@
+dumapp: fix for C++14
+
+With C++14, the way exceptions are specified has changed (somehow, don't
+ask me), thus causing build failures:
+
+ dumapp.cpp: In function ‘void* operator new(std::size_t)’:
+ dumapp.cpp:192:19: error: declaration of ‘void* operator new(std::size_t) throw (std::bad_alloc)’ has a different exception specifier
+ void * DUMA_CDECL operator new( DUMA_SIZE_T size )
+ ^~~~~~~~
+ In file included from dumapp.cpp:39:0:
+ dumapp.h:91:23: note: from previous declaration ‘void* operator new(std::size_t)’
+ void * DUMA_CDECL operator new(DUMA_SIZE_T) throw(std::bad_alloc);
+ ^~~~~~~~
+
+This is most evident with gcc-6.x, since the default C++ standard has
+changed from C++11 to C++14, thus exposing these new failures.
+
+Fix that by guarding the exception handling, a bit like was done
+with GRASS GIS (thanks DuckDuckGo):
+
+ https://trac.osgeo.org/grass/changeset?old_path=%2F&old=68817&new_path=%2F&new=68818&sfp_email=&sfph_mail=
+
+Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
+
+---
+Note: The last commit in DUMA's CVS repo was more than 7 years ago.
+I doubt it is still active, so the patch was not sent upstream. :-/
+
+diff -durN duma-2.5.15.orig/dumapp.cpp duma-2.5.15/dumapp.cpp
+--- duma-2.5.15.orig/dumapp.cpp 2008-08-03 22:46:06.000000000 +0200
++++ duma-2.5.15/dumapp.cpp 2016-07-10 21:55:22.670386099 +0200
+@@ -190,7 +190,9 @@
+ * (11) = (a) ; ASW
+ */
+ void * DUMA_CDECL operator new( DUMA_SIZE_T size )
++#ifdef DUMA_EXCEPTION_SPECS
+ throw(std::bad_alloc)
++#endif
+ {
+ return duma_new_operator(size, EFA_NEW_ELEM, true DUMA_PARAMS_UK);
+ }
+@@ -254,7 +256,9 @@
+ * (21) = (a) ; AAW
+ */
+ void * DUMA_CDECL operator new[]( DUMA_SIZE_T size )
++#ifdef DUMA_EXCEPTION_SPECS
+ throw(std::bad_alloc)
++#endif
+ {
+ return duma_new_operator(size, EFA_NEW_ARRAY, true DUMA_PARAMS_UK);
+ }
+diff -durN duma-2.5.15.orig/dumapp.h duma-2.5.15/dumapp.h
+--- duma-2.5.15.orig/dumapp.h 2009-04-11 14:41:44.000000000 +0200
++++ duma-2.5.15/dumapp.h 2016-07-10 21:55:22.670386099 +0200
+@@ -35,6 +35,10 @@
+
+ #include "duma.h"
+
++#if __cplusplus < 201103L
++ #define DUMA_EXCEPTION_SPECS 1
++#endif
++
+ /* remove previous macro definitions */
+ #include "noduma.h"
+
diff --git a/schulung_tools/libduma/README b/schulung_tools/libduma/README
new file mode 100644
index 0000000..41e1109
--- /dev/null
+++ b/schulung_tools/libduma/README
@@ -0,0 +1,10 @@
+#!/bin/sh
+
+tar xzf duma_2.5.15.orig.tar.gz
+cd duma_2_5_15
+zcat ../duma_2.5.15-1.1.diff.gz | patch -p1
+cat ../0003-fix-C++14.patch | patch -p1
+sed -i -e 's/-Wl,-soname,$(DUMASO)/-Wl,-soname,$(DUMASO_LINK1)/' GNUmakefile
+make
+sudo cp libduma.so.0.0.0 /usr/lib/x86_64-linux-gnu
+sudo ldconfig
diff --git a/schulung_tools/libduma/duma_2.5.15-1.1.diff.gz b/schulung_tools/libduma/duma_2.5.15-1.1.diff.gz
new file mode 100644
index 0000000..037872a
--- /dev/null
+++ b/schulung_tools/libduma/duma_2.5.15-1.1.diff.gz
Binary files differ
diff --git a/schulung_tools/libduma/duma_2.5.15.orig.tar.gz b/schulung_tools/libduma/duma_2.5.15.orig.tar.gz
new file mode 100644
index 0000000..504ef58
--- /dev/null
+++ b/schulung_tools/libduma/duma_2.5.15.orig.tar.gz
Binary files differ