After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 760655 - libgtop (latest git master) fails to build on musl-libc
libgtop (latest git master) fails to build on musl-libc
Status: RESOLVED FIXED
Product: libgtop
Classification: Core
Component: linux
unspecified
Other Linux
: Normal normal
: ---
Assigned To: libgtop maintainers
libgtop maintainers
Depends on:
Blocks:
 
 
Reported: 2016-01-15 05:58 UTC by Kylie McClain
Modified: 2016-02-16 17:16 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
[PATCH] Fix building on musl-libc (1.24 KB, text/plain)
2016-01-15 05:58 UTC, Kylie McClain
Details

Description Kylie McClain 2016-01-15 05:58:34 UTC
Created attachment 319075 [details]
[PATCH] Fix building on musl-libc

libgtop fails to build on musl libc, due to the header #ifdefs on sysdeps/linux/netload.c being a bit too inclusive, resulting in the headers that would be loaded for libc 5 being loaded on musl libc.

Without this patch:

make  all-recursive
make[1]: Entering directory '/home/somasis/git/libgtop'
Making all in po
make[2]: Entering directory '/home/somasis/git/libgtop/po'
make[2]: Nothing to be done for 'all'.
make[2]: Leaving directory '/home/somasis/git/libgtop/po'
Making all in misc
make[2]: Entering directory '/home/somasis/git/libgtop/misc'
make[2]: Nothing to be done for 'all'.
make[2]: Leaving directory '/home/somasis/git/libgtop/misc'
Making all in include
make[2]: Entering directory '/home/somasis/git/libgtop/include'
Making all in glibtop
make[3]: Entering directory '/home/somasis/git/libgtop/include/glibtop'
make[3]: Nothing to be done for 'all'.
make[3]: Leaving directory '/home/somasis/git/libgtop/include/glibtop'
make[3]: Entering directory '/home/somasis/git/libgtop/include'
make[3]: Nothing to be done for 'all-am'.
make[3]: Leaving directory '/home/somasis/git/libgtop/include'
make[2]: Leaving directory '/home/somasis/git/libgtop/include'
Making all in sysdeps
make[2]: Entering directory '/home/somasis/git/libgtop/sysdeps'
Making all in common
make[3]: Entering directory '/home/somasis/git/libgtop/sysdeps/common'
make[3]: Nothing to be done for 'all'.
make[3]: Leaving directory '/home/somasis/git/libgtop/sysdeps/common'
Making all in linux
make[3]: Entering directory '/home/somasis/git/libgtop/sysdeps/linux'
  CC       netload.lo
In file included from /usr/x86_64-pc-linux-musl/include/ifaddrs.h:9:0,
                 from netload.c:59:
/usr/x86_64-pc-linux-musl/include/netinet/in.h:14:8: error: redefinition of 'struct in_addr'
 struct in_addr { in_addr_t s_addr; };
        ^
In file included from netload.c:48:0:
/usr/x86_64-pc-linux-musl/include/linux/in.h:84:8: note: originally defined here
 struct in_addr {
        ^
In file included from /usr/x86_64-pc-linux-musl/include/ifaddrs.h:9:0,
                 from netload.c:59:
/usr/x86_64-pc-linux-musl/include/netinet/in.h:16:8: error: redefinition of 'struct sockaddr_in'
 struct sockaddr_in
        ^
In file included from netload.c:48:0:
/usr/x86_64-pc-linux-musl/include/linux/in.h:230:8: note: originally defined here
 struct sockaddr_in {
        ^
In file included from /usr/x86_64-pc-linux-musl/include/ifaddrs.h:9:0,
                 from netload.c:59:
/usr/x86_64-pc-linux-musl/include/netinet/in.h:248:8: error: redefinition of 'struct ip_mreq'
 struct ip_mreq
        ^
In file included from netload.c:48:0:
/usr/x86_64-pc-linux-musl/include/linux/in.h:166:8: note: originally defined here
 struct ip_mreq  {
        ^
In file included from /usr/x86_64-pc-linux-musl/include/ifaddrs.h:9:0,
                 from netload.c:59:
/usr/x86_64-pc-linux-musl/include/netinet/in.h:254:8: error: redefinition of 'struct ip_mreqn'
 struct ip_mreqn
        ^
In file included from netload.c:48:0:
/usr/x86_64-pc-linux-musl/include/linux/in.h:171:8: note: originally defined here
 struct ip_mreqn {
        ^
In file included from /usr/x86_64-pc-linux-musl/include/ifaddrs.h:9:0,
                 from netload.c:59:
/usr/x86_64-pc-linux-musl/include/netinet/in.h:261:8: error: redefinition of 'struct ip_mreq_source'
 struct ip_mreq_source {
        ^
In file included from netload.c:48:0:
/usr/x86_64-pc-linux-musl/include/linux/in.h:177:8: note: originally defined here
 struct ip_mreq_source {
        ^
In file included from /usr/x86_64-pc-linux-musl/include/ifaddrs.h:9:0,
                 from netload.c:59:
/usr/x86_64-pc-linux-musl/include/netinet/in.h:267:8: error: redefinition of 'struct ip_msfilter'
 struct ip_msfilter {
        ^
In file included from netload.c:48:0:
/usr/x86_64-pc-linux-musl/include/linux/in.h:183:8: note: originally defined here
 struct ip_msfilter {
        ^
In file included from /usr/x86_64-pc-linux-musl/include/ifaddrs.h:9:0,
                 from netload.c:59:
/usr/x86_64-pc-linux-musl/include/netinet/in.h:278:8: error: redefinition of 'struct group_req'
 struct group_req {
        ^
In file included from netload.c:48:0:
/usr/x86_64-pc-linux-musl/include/linux/in.h:195:8: note: originally defined here
 struct group_req {
        ^
In file included from /usr/x86_64-pc-linux-musl/include/ifaddrs.h:9:0,
                 from netload.c:59:
/usr/x86_64-pc-linux-musl/include/netinet/in.h:283:8: error: redefinition of 'struct group_source_req'
 struct group_source_req {
        ^
In file included from netload.c:48:0:
/usr/x86_64-pc-linux-musl/include/linux/in.h:200:8: note: originally defined here
 struct group_source_req {
        ^
In file included from /usr/x86_64-pc-linux-musl/include/ifaddrs.h:9:0,
                 from netload.c:59:
/usr/x86_64-pc-linux-musl/include/netinet/in.h:289:8: error: redefinition of 'struct group_filter'
 struct group_filter {
        ^
In file included from netload.c:48:0:
/usr/x86_64-pc-linux-musl/include/linux/in.h:206:8: note: originally defined here
 struct group_filter {
        ^
In file included from /usr/x86_64-pc-linux-musl/include/ifaddrs.h:9:0,
                 from netload.c:59:
/usr/x86_64-pc-linux-musl/include/netinet/in.h:300:8: error: redefinition of 'struct in_pktinfo'
 struct in_pktinfo
        ^
In file included from netload.c:48:0:
/usr/x86_64-pc-linux-musl/include/linux/in.h:220:8: note: originally defined here
 struct in_pktinfo {
        ^
netload.c: In function 'get_ipv6':
netload.c:164:4: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
    || IN6_IS_ADDR_V4COMPAT (buf->address6)
    ^
netload.c:166:4: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
    || IN6_IS_ADDR_UNSPECIFIED (buf->address6)
    ^
netload.c:170:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
  else if (IN6_IS_ADDR_LOOPBACK (buf->address6))
  ^
Makefile:529: recipe for target 'netload.lo' failed
make[3]: *** [netload.lo] Error 1
make[3]: Leaving directory '/home/somasis/git/libgtop/sysdeps/linux'
Makefile:434: recipe for target 'all-recursive' failed
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory '/home/somasis/git/libgtop/sysdeps'
Makefile:583: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/home/somasis/git/libgtop'
Makefile:467: recipe for target 'all' failed
make: *** [all] Error 2
Comment 1 Benoît Dejean 2016-02-16 17:16:01 UTC
Thank you Kylie.

https://git.gnome.org/browse/libgtop/commit/?id=94968b440646a166b08f79391311eea1dd07ac0a

This problem has been fixed in the unstable development version. The fix will be available in the next major software release. You may need to upgrade your Linux distribution to obtain that newer version.