[depends] fix libssh compile with gcc5 (Ubuntu Xenial)
authorAlwin Esch <alwin.esch@web.de>
Thu, 5 Nov 2015 08:45:30 +0000 (09:45 +0100)
committerAlwin Esch <alwin.esch@web.de>
Thu, 5 Nov 2015 10:04:23 +0000 (11:04 +0100)
tools/depends/target/libssh/Makefile
tools/depends/target/libssh/fix-gcc-5-compile.patch [new file with mode: 0644]

index 7fb244e..d2f6738 100644 (file)
@@ -23,6 +23,7 @@ $(PLATFORM): $(TARBALLS_LOCATION)/$(ARCHIVE) $(DEPS)
        cd $(PLATFORM); patch -p0 < ../ntohl.patch
        cd $(PLATFORM); patch -p0 < ../md5.patch
        cd $(PLATFORM); patch -p1 < ../darwin.patch
+       cd $(PLATFORM); patch -p0 < ../fix-gcc-5-compile.patch
        sed -ie "s|-fstack-protector|-fno-stack-protector|" "$(PLATFORM)/cmake/Modules/DefineCompilerFlags.cmake"
        sed -ie "s|add_subdirectory(examples)||" "$(PLATFORM)/CMakeLists.txt"
        cd $(PLATFORM)/build; $(CMAKE) -DWITH_STATIC_LIB=1 -DWITH_EXAMPLES=0 -DTHREADS_PTHREAD_ARG=0 -DWITH_GSSAPI=0 VERBOSE=1 ..
diff --git a/tools/depends/target/libssh/fix-gcc-5-compile.patch b/tools/depends/target/libssh/fix-gcc-5-compile.patch
new file mode 100644 (file)
index 0000000..d015a9b
--- /dev/null
@@ -0,0 +1,55 @@
+--- include/libssh/pki_priv.h  2015-11-05 09:39:40.011875890 +0100
++++ include/libssh/pki_priv.h  2015-11-05 09:39:34.151849945 +0100
+@@ -29,7 +29,7 @@
+ #define ECDSA_HEADER_END "-----END EC PRIVATE KEY-----"
+ #define ssh_pki_log(...) \
+-    _ssh_pki_log(__FUNCTION__, __VA_ARGS__)
++    _ssh_pki_log(__extension__ __FUNCTION__, __VA_ARGS__)
+ void _ssh_pki_log(const char *function,
+                   const char *format, ...) PRINTF_ATTRIBUTE(2, 3);
+--- include/libssh/priv.h      2015-11-05 09:39:40.011875890 +0100
++++ include/libssh/priv.h      2015-11-05 09:41:01.272239916 +0100
+@@ -179,7 +179,7 @@
+                       const char *function,
+                       const char *buffer);
+ #define SSH_LOG(priority, ...) \
+-    _ssh_log(priority, __FUNCTION__, __VA_ARGS__)
++    _ssh_log(priority, __extension__ __FUNCTION__, __VA_ARGS__)
+ /* LEGACY */
+ void ssh_log_common(struct ssh_common_struct *common,
+@@ -197,18 +197,18 @@
+ };
+ #define ssh_set_error(error, code, ...) \
+-    _ssh_set_error(error, code, __FUNCTION__, __VA_ARGS__)
++    _ssh_set_error(error, code, __extension__ __FUNCTION__, __VA_ARGS__)
+ void _ssh_set_error(void *error,
+                     int code,
+                     const char *function,
+                     const char *descr, ...) PRINTF_ATTRIBUTE(4, 5);
+ #define ssh_set_error_oom(error) \
+-    _ssh_set_error_oom(error, __FUNCTION__)
++    _ssh_set_error_oom(error, __extension__ __FUNCTION__)
+ void _ssh_set_error_oom(void *error, const char *function);
+ #define ssh_set_error_invalid(error) \
+-    _ssh_set_error_invalid(error, __FUNCTION__)
++    _ssh_set_error_invalid(error, __extension__ __FUNCTION__)
+ void _ssh_set_error_invalid(void *error, const char *function);
+--- src/auth.c 2014-12-27 11:30:13.000000000 +0100
++++ src/auth.c 2015-11-05 09:42:41.732698584 +0100
+@@ -1548,7 +1548,7 @@
+          * This should not happen
+          */
+         rc = SSH_AUTH_ERROR;
+-        ssh_set_error(session,SSH_FATAL,"Invalid state in %s", __FUNCTION__);
++        ssh_set_error(session,SSH_FATAL,"Invalid state in %s", __extension__ __FUNCTION__);
+     }
+     return rc;
+ }