Bug 194187 - devel/libgtop using the wrong definitions for struct ifnet
Summary: devel/libgtop using the wrong definitions for struct ifnet
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: arm Any
: --- Affects Many People
Assignee: freebsd-gnome (Nobody)
URL: http://chips.ysv.freebsd.org/data/11a...
Keywords:
Depends on:
Blocks:
 
Reported: 2014-10-06 13:56 UTC by Sean Bruno
Modified: 2020-09-03 12:27 UTC (History)
4 users (show)

See Also:
sbruno: maintainer-feedback? (gnome)


Attachments
Reflect r272244 changes in base. (2.62 KB, patch)
2014-10-10 06:09 UTC, Eric Camachat
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Sean Bruno freebsd_committer freebsd_triage 2014-10-06 13:56:53 UTC
somehow, when compiling for ARMv6, libgtop is assuming that struct ifnet has elements that are not defined on FreeBSD.  Probably these are linux definitions that are being brought in when assuming that ARM==linux?

libtool: compile:  /nxb-bin/usr/bin/cc -DHAVE_CONFIG_H -I. -I../.. -I../.. -I../.. -I../../sysdeps/freebsd -I../../include -I/usr/local/include/glib-2.0 -I/usr/local/include -I/usr/local/include -I/usr/local/include -DHAVE_NET_IF_VAR_H -D_WANT_IFADDR -Winline -Wall -std=gnu89 -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -O -pipe -MT procmap.lo -MD -MP -MF .deps/procmap.Tpo -c procmap.c -o procmap.o >/dev/null 2>&1
mv -f .deps/procmap.Tpo .deps/procmap.Plo
/bin/sh ../../libtool --tag=CC   --mode=compile /nxb-bin/usr/bin/cc -DHAVE_CONFIG_H -I. -I../.. -I../.. -I../.. -I../../sysdeps/freebsd -I../../include -I/usr/local/include/glib-2.0 -I/usr/local/include    -I/usr/local/include  -I/usr/local/include -DHAVE_NET_IF_VAR_H -D_WANT_IFADDR  -Winline 	-Wall 	-std=gnu89 	-Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes 	-Wnested-externs -Wpointer-arith 	-Wcast-align -Wsign-compare 	-O -pipe  -MT netload.lo -MD -MP -MF .deps/netload.Tpo -c -o netload.lo netload.c
libtool: compile:  /nxb-bin/usr/bin/cc -DHAVE_CONFIG_H -I. -I../.. -I../.. -I../.. -I../../sysdeps/freebsd -I../../include -I/usr/local/include/glib-2.0 -I/usr/local/include -I/usr/local/include -I/usr/local/include -DHAVE_NET_IF_VAR_H -D_WANT_IFADDR -Winline -Wall -std=gnu89 -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -O -pipe -MT netload.lo -MD -MP -MF .deps/netload.Tpo -c netload.c  -fPIC -DPIC -o .libs/netload.o
netload.c:182:41: error: no member named 'if_ipackets' in 'struct ifnet'
                buf->packets_in = ifnet.if_ipackets;
                                  ~~~~~ ^
netload.c:183:42: error: no member named 'if_opackets' in 'struct ifnet'
                buf->packets_out = ifnet.if_opackets;
                                   ~~~~~ ^
netload.c:186:39: error: no member named 'if_ibytes' in 'struct ifnet'
                buf->bytes_in = ifnet.if_ibytes;
                                ~~~~~ ^
netload.c:187:40: error: no member named 'if_obytes' in 'struct ifnet'
                buf->bytes_out = ifnet.if_obytes;
                                 ~~~~~ ^
netload.c:190:40: error: no member named 'if_ierrors' in 'struct ifnet'
                buf->errors_in = ifnet.if_ierrors;
                                 ~~~~~ ^
netload.c:191:41: error: no member named 'if_oerrors' in 'struct ifnet'
                buf->errors_out = ifnet.if_oerrors;
                                  ~~~~~ ^
netload.c:194:41: error: no member named 'if_collisions' in 'struct ifnet'
                buf->collisions = ifnet.if_collisions;
                                  ~~~~~ ^
netload.c:211:58: warning: cast from 'struct sockaddr *' to 'struct sockaddr_dl *' increases required alignment from 1 to 2 [-Wcast-align]
                                struct sockaddr_dl *dl = (struct sockaddr_dl *) sa;
                                                         ^~~~~~~~~~~~~~~~~~~~~~~~~
netload.c:217:39: warning: cast from 'struct sockaddr *' to 'struct sockaddr_in *' increases required alignment from 1 to 4 [-Wcast-align]
                                sin = (struct sockaddr_in *)sa;
                                      ^~~~~~~~~~~~~~~~~~~~~~~~
netload.c:225:61: warning: cast from 'struct sockaddr *' to 'struct sockaddr_in6 *' increases required alignment from 1 to 4 [-Wcast-align]
                                struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *) sa;
                                                            ^~~~~~~~~~~~~~~~~~~~~~~~~~
3 warnings and 7 errors generated.
gmake[4]: *** [netload.lo] Error 1
gmake[4]: Leaving directory `/wrkdirs/usr/ports/devel/libgtop/work/libgtop-2.28.4/sysdeps/freebsd'
gmake[3]: *** [all-recursive] Error 1
gmake[3]: Leaving directory `/wrkdirs/usr/ports/devel/libgtop/work/libgtop-2.28.4/sysdeps'
gmake[2]: *** [all-recursive] Error 1
gmake[2]: Leaving directory `/wrkdirs/usr/ports/devel/libgtop/work/libgtop-2.28.4'
gmake[1]: *** [all] Error 2
gmake[1]: Leaving directory `/wrkdirs/usr/ports/devel/libgtop/work/libgtop-2.28.4'
*** Error code 1
Comment 1 Bugzilla Automation freebsd_committer freebsd_triage 2014-10-06 13:56:53 UTC
Auto-assigned to maintainer gnome@FreeBSD.org
Comment 2 Antoine Brodin freebsd_committer freebsd_triage 2014-10-06 19:01:59 UTC
This is not specific to arm and glebius has a patch for this
Comment 3 Eric Camachat 2014-10-10 06:09:57 UTC
Created attachment 148152 [details]
Reflect r272244 changes in base.
Comment 4 commit-hook freebsd_committer freebsd_triage 2014-10-17 22:04:34 UTC
A commit references this bug:

Author: antoine
Date: Fri Oct 17 22:04:04 UTC 2014
New revision: 371082
URL: https://svnweb.freebsd.org/changeset/ports/371082

Log:
  - Fix build on head [1]
  - Fix displaying of MAC address [2]

  PR:		ports/194187
  Submitted by:	glebius [1], self [2]
  Tested with:	gnome-nettool

Changes:
  head/devel/libgtop/Makefile
  head/devel/libgtop/files/patch-sysdeps_freebsd_netload.c
Comment 5 davegerber 2017-05-30 17:07:46 UTC
MARKED AS SPAM
Comment 6 johnewicks 2020-09-03 12:27:32 UTC
MARKED AS SPAM