Page MenuHomePhabricator

Building v9.0.0 with gcc 7.4.0 fails.
Open, Needs TriagePublic

Description

Compìlation fails when doing an out of source build with gcc 7.4.0:

In file included from /path/to/build/src/libcrypto.c:31:0:
/path/to/build/include/libssh/priv.h:400:22: error: expected ‘)’ before ‘__attribute__’
 #  define __unused__ __attribute__((unused))
                      ^
In file included from /path/to/build/src/libcrypto.c:59:0:
/usr/include/valgrind/valgrind.h:6753:56: error: expected ‘,’ or ‘;’ before ‘)’ token
    __attribute__((format(__printf__, 1, 2), __unused__));
                                                        ^
In file included from /path/to/build/src/libcrypto.c:31:0:
/path/to/build/include/libssh/priv.h:400:22: error: expected ‘)’ before ‘__attribute__’
 #  define __unused__ __attribute__((unused))
                      ^
In file included from /path/to/build/src/libcrypto.c:59:0:
/usr/include/valgrind/valgrind.h:6791:56: error: expected ‘,’ or ‘;’ before ‘)’ token
    __attribute__((format(__printf__, 1, 2), __unused__));

Seems like the unused attribute is not playing nice with the compiler. A quick fix is to just comment it out:

sed -i 's/define __unused__ __attribute__((unused))/define __unused__ \/*__attribute__((unused))*\//g' libssh/priv.h

But that's not surely what the author had in mind.

Event Timeline

Jakuje added a project: Restricted Project.Mon, Sep 16, 9:47 AM
Jakuje added a subscriber: Jakuje.Fri, Sep 20, 3:05 PM

Can you clarify on what platform you are experiencing these issues?

We are running the CI with GCC 7.4.1 on Tumbleweed and it looks like it works fine (the master as well as the v0.9 release). Here is the respective build for the 0.9 release:

https://gitlab.com/libssh/libssh-mirror/-/jobs/241740932

Yes, of course. I am not at it right now, but it is am almost sure it is an Ubuntu 16, 64bit, with GCC 7.4.0. The system itself is standard issue but GCC i had to add some PPAs (I think) and apt-get install. Let me know if you need anything else.