Control: tags 853693 + patch
Control: tags 853693 + pending

Dear maintainer,

I've prepared an NMU for undertaker (versioned as 1.6.1-4.1) and 
uploaded it to DELAYED/10. Please feel free to tell me if I should 
cancel it.

cu
Adrian

-- 

       "Is there not promise of rain?" Ling Tan asked suddenly out
        of the darkness. There had been need of rain for many days.
       "Only a promise," Lao Er said.
                                       Pearl S. Buck - Dragon Seed

diff -Nru undertaker-1.6.1/debian/changelog undertaker-1.6.1/debian/changelog
--- undertaker-1.6.1/debian/changelog	2016-12-21 23:08:23.000000000 +0200
+++ undertaker-1.6.1/debian/changelog	2017-09-03 14:54:27.000000000 +0300
@@ -1,3 +1,10 @@
+undertaker (1.6.1-4.1) unstable; urgency=medium
+
+  * Non-maintainer upload.
+  * Fix FTBFS with gcc 7. (Closes: #853693)
+
+ -- Adrian Bunk <[email protected]>  Sun, 03 Sep 2017 14:54:27 +0300
+
 undertaker (1.6.1-4) unstable; urgency=medium
 
   * Bug fix: "FTBFS in parallel builds", thanks to Lucas Nussbaum
diff -Nru undertaker-1.6.1/debian/patches/gcc7-ftbfs.patch undertaker-1.6.1/debian/patches/gcc7-ftbfs.patch
--- undertaker-1.6.1/debian/patches/gcc7-ftbfs.patch	1970-01-01 02:00:00.000000000 +0200
+++ undertaker-1.6.1/debian/patches/gcc7-ftbfs.patch	2017-09-03 14:54:27.000000000 +0300
@@ -0,0 +1,204 @@
+Description: Fix FTBFS with gcc 7
+ Make some functions static.
+ .
+ "inline" without "extern" was not correct,
+ and there is  anyway no reason for them to be global.
+Author: Adrian Bunk <[email protected]>
+Bug-Debian: https://bugs.debian.org/853693
+
+--- undertaker-1.6.1.orig/tailor/src/traceutil-boost.cc
++++ undertaker-1.6.1/tailor/src/traceutil-boost.cc
+@@ -43,7 +43,7 @@ int ignoreFileReopenCounter = 0;
+  * inside a certain module's address range.
+  */
+ 
+-void readModules() {
++static void readModules() {
+     string moduleLine;
+     ifstream moduleFile;
+     loadedModules.clear();
+@@ -69,7 +69,7 @@ void readModules() {
+  * currently present.
+  */
+ 
+-bool addModuleAddr(unsigned long long addr) {
++static bool addModuleAddr(unsigned long long addr) {
+     for (map<unsigned long long,module>::iterator it=loadedModules.begin() ;
+          it != loadedModules.end(); it++ ) {
+         unsigned long long lowAddr = (*it).first;
+@@ -89,7 +89,7 @@ bool addModuleAddr(unsigned long long ad
+  * didn't scan the module table yet, a call to addModuleAddr(addr) is triggered.
+  */
+ 
+-bool addAddr(unsigned long long addr) {
++static bool addAddr(unsigned long long addr) {
+     // address new?
+     if (calledAddr.insert(addr).second) {
+         // module address (if modules enabled)?
+@@ -119,7 +119,7 @@ bool addAddr(unsigned long long addr) {
+  * functions are being encountered.
+  */
+ 
+-void ignoreFunc(string name) {
++static void ignoreFunc(string name) {
+     // Otherwise, we add the function's name to the ignore list.
+     if (ignoreFile == NULL
+         || ++ignoreFileReopenCounter >= ignoreFileReopenUpperBound) {
+--- undertaker-1.6.1.orig/tailor/src/traceutil-native.c
++++ undertaker-1.6.1/tailor/src/traceutil-native.c
+@@ -56,7 +56,7 @@ int numberSize=0;
+  * later test whether a given address is inside a certain module's address range
+  */
+ 
+-void readModules() {
++static void readModules() {
+     int size = 0;
+     int parsingMode = 0;
+     // Open module file
+@@ -168,7 +168,7 @@ void readModules() {
+  * currently present.
+  */
+ 
+-inline bool addModuleAddr(unsigned long long addr) {
++static inline bool addModuleAddr(unsigned long long addr) {
+     for (j=0; j<loadedModules; j++) {
+         unsigned long long lowAddr = loadedModule[j].base;
+         unsigned long long highAddr = lowAddr + loadedModule[j].length;
+@@ -215,7 +215,7 @@ inline bool addModuleAddr(unsigned long
+  * table yet, a call to addModuleAddr(addr) is triggered.
+  */
+ 
+-inline bool addAddr(unsigned long long addr) {
++static inline bool addAddr(unsigned long long addr) {
+     if (hashadd(addr)) {
+         // Check if module
+         if (modulePath != NULL && addr >= moduleBaseAddr) {
+@@ -264,7 +264,7 @@ inline bool addAddr(unsigned long long a
+  * functions are being encountered.
+  */
+ 
+-inline void ignoreFunc(char * callerBuffer, int callerSize) {
++static inline void ignoreFunc(char * callerBuffer, int callerSize) {
+     // Flushing does not work on debugfs, so we close and reopen the ignore file
+     if (ignoreFile == -1
+         || ++ignorePathReopenCounter >= ignorePathReopenUpperBound) {
+--- undertaker-1.6.1.orig/tailor/src/traceutil-native.h
++++ undertaker-1.6.1/tailor/src/traceutil-native.h
+@@ -74,10 +74,4 @@ typedef struct module {
+ int hexCharToDec[256];
+ char decToHexChar[16];
+ 
+-//function declarations
+-void readModules();
+-inline bool addModuleAddr(unsigned long long addr);
+-inline bool addAddr(unsigned long long addr);
+-inline void ignoreFunc(char * funcbuf, int funcbufp);
+-
+ #endif
+--- undertaker-1.6.1.orig/tailor/src/traceutil-stdio.c
++++ undertaker-1.6.1/tailor/src/traceutil-stdio.c
+@@ -41,7 +41,7 @@ int ignoreFileReopenCounter = 0;
+  * later test whether a given address is inside a certain module's address range
+  */
+ 
+-inline void readModules() {
++static inline void readModules() {
+     FILE * moduleFile;
+     moduleFile = fopen (modulePath,"r");
+     // On error, use old version of procmodules
+@@ -65,13 +65,39 @@ inline void readModules() {
+     fclose(moduleFile);
+ }
+ 
++/* This function adds an address from an LKM to the output. Therefore we iterate
++ * the table of modules, and check if the address is between the lower and the
++ * upper bound of any module. If we find the module, we return *true* to signal
++ * success. If we don't find any module matching, we return *false*; this will
++ * tell the caller to call readModules() and therefore rescan the module table
++ * currently present.
++ */
++
++static inline bool addModuleAddr(unsigned long long addr) {
++    int currentModule = 0;
++    // Look in every module
++    while (currentModule < MODULESIZE) {
++        module m = loadedModule[currentModule++];
++        unsigned long long lowAddr = m.base;
++        unsigned long long highAddr = lowAddr + m.length;
++        // If the address is inside the range of a module
++        if (addr>=lowAddr && addr<=highAddr) {
++            unsigned long long relativeAddr = addr-lowAddr;
++            // output the offset and the module's name
++            fprintf(outputFile,"%llx %s\n",relativeAddr, m.name);
++            return true;
++        }
++    }
++    return false;
++}
++
+ /* This function adds a found address to the output. It also adds the address to
+  * the internal hash map, so that we can filter out already found addresses.  If
+  * the given address was located inside an LKM or we didn't scan the module
+  * table yet, a call to addModuleAddr(addr) is triggered.
+  */
+ 
+-inline bool addAddr(unsigned long long addr) {
++static inline bool addAddr(unsigned long long addr) {
+     // address new?
+     if (hashadd(addr)) {
+         // module address (if modules enabled)?
+@@ -93,32 +119,6 @@ inline bool addAddr(unsigned long long a
+     return false;
+ }
+ 
+-/* This function adds an address from an LKM to the output. Therefore we iterate
+- * the table of modules, and check if the address is between the lower and the
+- * upper bound of any module. If we find the module, we return *true* to signal
+- * success. If we don't find any module matching, we return *false*; this will
+- * tell the caller to call readModules() and therefore rescan the module table
+- * currently present.
+- */
+-
+-inline bool addModuleAddr(unsigned long long addr) {
+-    int currentModule = 0;
+-    // Look in every module
+-    while (currentModule < MODULESIZE) {
+-        module m = loadedModule[currentModule++];
+-        unsigned long long lowAddr = m.base;
+-        unsigned long long highAddr = lowAddr + m.length;
+-        // If the address is inside the range of a module
+-        if (addr>=lowAddr && addr<=highAddr) {
+-            unsigned long long relativeAddr = addr-lowAddr;
+-            // output the offset and the module's name
+-            fprintf(outputFile,"%llx %s\n",relativeAddr, m.name);
+-            return true;
+-        }
+-    }
+-    return false;
+-}
+-
+ /* This function adds a function to ftraces ignore list and flushes it. We found
+  * that calling flush() on a file in the debugfs had no effect, so we close and
+  * reopen the file at given intervals.  As there is a lot written to the file in
+@@ -127,7 +127,7 @@ inline bool addModuleAddr(unsigned long
+  * functions are being encountered.
+  */
+ 
+-inline void ignoreFunc(char *name) {
++static inline void ignoreFunc(char *name) {
+     // Otherwise, we add the function's name to the ignore list.
+     if (ignoreFile == NULL
+         || ++ignoreFileReopenCounter >= ignoreFileReopenUpperBound) {
+--- undertaker-1.6.1.orig/tailor/src/traceutil-stdio.h
++++ undertaker-1.6.1/tailor/src/traceutil-stdio.h
+@@ -40,10 +40,4 @@ typedef struct module {
+     char name[MODULENAMELENGTH+3];
+ } module;
+ 
+-//function declarations
+-inline void readModules();
+-inline bool addAddr(unsigned long long addr);
+-inline bool addModuleAddr(unsigned long long addr);
+-inline void ignoreFunc(char *name);
+-
+ #endif
diff -Nru undertaker-1.6.1/debian/patches/series undertaker-1.6.1/debian/patches/series
--- undertaker-1.6.1/debian/patches/series	2016-12-21 23:08:23.000000000 +0200
+++ undertaker-1.6.1/debian/patches/series	2017-09-03 14:43:36.000000000 +0300
@@ -3,3 +3,4 @@
 0001-Fix-compilation-with-AspectC-1.2.patch
 0001-undertaker-fix-compilation-error-with-clang-and-g-5..patch
 0003-Fix-FTBFS-With-Newer-Puma.patch
+gcc7-ftbfs.patch

Reply via email to