Bug 221531 - net/wmwifi: Fix runtime on architectures where sizeof(int) != sizeof(size_t)
Summary: net/wmwifi: Fix runtime on architectures where sizeof(int) != sizeof(size_t)
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Tobias Kortkamp
URL: https://forums.freebsd.org/threads/61...
Keywords: patch
Depends on:
Blocks:
 
Reported: 2017-08-14 18:59 UTC by Tobias Kortkamp
Modified: 2017-08-15 19:22 UTC (History)
1 user (show)

See Also:
uqs: maintainer-feedback+
tobik: merge-quarterly+


Attachments
wmwifi.diff (4.19 KB, patch)
2017-08-14 18:59 UTC, Tobias Kortkamp
tobik: maintainer-approval+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Tobias Kortkamp freebsd_committer freebsd_triage 2017-08-14 18:59:02 UTC
Created attachment 185413 [details]
wmwifi.diff

Currently wmwifi doesn't start on amd64 and simply fails with

wmwifi: No wireless interface found!

The problem is that the code assumes that sizeof(int) ==
sizeof(size_t) which isn't the case on amd64 and all
sysctl() calls will fail because of it.

Another problem is that the port fails to build outside of Poudriere
when devel/autoconf and devel/automake are installed in the
environment since patching configure.in triggers the build to try to
regenerate configure which fails with:

gmake[1]: Entering directory '/usr/ports/net/wmwifi/work/wmwifi-0.4-bsd'
cd . && aclocal
aclocal-1.15: warning: autoconf input should be named 'configure.ac', not 'configure.in'
/usr/local/share/aclocal/gdk-pixbuf.m4:12: warning: underquoted definition of AM_PATH_GDK_PIXBUF
/usr/local/share/aclocal/gdk-pixbuf.m4:12:   run info Automake 'Extending aclocal'
/usr/local/share/aclocal/gdk-pixbuf.m4:12:   or see http://www.gnu.org/software/automake/manual/automake.html#Extending-aclocal
cd . && automake --gnu Makefile
automake-1.15: warning: autoconf input should be named 'configure.ac', not 'configure.in'
configure.in:3: warning: AM_INIT_AUTOMAKE: two- and three-arguments forms are deprecated.  For more info, see:
configure.in:3: http://www.gnu.org/software/automake/manual/automake.html#Modernize-AM_005fINIT_005fAUTOMAKE-invocation
configure.in:6: error: required file './compile' not found
configure.in:6:   'automake --add-missing' can install 'compile'
gmake[1]: *** [Makefile:82: Makefile.in] Error 1
gmake[1]: Leaving directory '/usr/ports/net/wmwifi/work/wmwifi-0.4-bsd'
*** Error code 1

I suggest removing the patch and instead pass CFLAGS through
CONFIGURE_ENV to the build to work around this problem.

While here I also add LICENSE, LICENSE_FILE, and the missing
USE_XORG=xext.

Poudriere testport 11.0/amd64 and 10.3/i386 ok
Comment 1 Ulrich Spörlein freebsd_committer freebsd_triage 2017-08-15 18:24:08 UTC
Approved, thanks!
Comment 2 Ulrich Spörlein freebsd_committer freebsd_triage 2017-08-15 18:25:20 UTC
(i don't know what the flag value should be, sorry)
Comment 3 commit-hook freebsd_committer freebsd_triage 2017-08-15 19:10:17 UTC
A commit references this bug:

Author: tobik
Date: Tue Aug 15 19:09:51 UTC 2017
New revision: 448001
URL: https://svnweb.freebsd.org/changeset/ports/448001

Log:
  net/wmwifi: Fix runtime on amd64

  Currently wmwifi doesn't start on amd64 and simply fails with

  wmwifi: No wireless interface found!

  The code assumes that sizeof(int) == sizeof(size_t) which isn't the
  case on amd64 (and other architectures) and all sysctl() calls will
  fail because of it.

  While here:

  - Fix a build failure when automake+autoconf are installed in the
    build environment.  By patching configure.in the build wants to
    regenerate configure which doesn't work correctly:

  gmake[1]: Entering directory '/usr/ports/net/wmwifi/work/wmwifi-0.4-bsd'
  cd . && aclocal
  aclocal-1.15: warning: autoconf input should be named 'configure.ac', not 'configure.in'
  /usr/local/share/aclocal/gdk-pixbuf.m4:12: warning: underquoted definition of AM_PATH_GDK_PIXBUF
  /usr/local/share/aclocal/gdk-pixbuf.m4:12:   run info Automake 'Extending aclocal'
  /usr/local/share/aclocal/gdk-pixbuf.m4:12:   or see http://www.gnu.org/software/automake/manual/automake.html#Extending-aclocal
  cd . && automake --gnu Makefile
  automake-1.15: warning: autoconf input should be named 'configure.ac', not 'configure.in'
  configure.in:3: warning: AM_INIT_AUTOMAKE: two- and three-arguments forms are deprecated.  For more info, see:
  configure.in:3: http://www.gnu.org/software/automake/manual/automake.html#Modernize-AM_005fINIT_005fAUTOMAKE-invocation
  configure.in:6: error: required file './compile' not found
  configure.in:6:   'automake --add-missing' can install 'compile'
  gmake[1]: *** [Makefile:82: Makefile.in] Error 1
  gmake[1]: Leaving directory '/usr/ports/net/wmwifi/work/wmwifi-0.4-bsd'
  *** Error code 1

    Remove files/patch-configure.in and pass CFLAGS through
    CONFIGURE_ENV instead.

  - Add LICENSE, LICENSE_FILE
  - Add missing dependency on libXext

  [1] https://forums.freebsd.org/threads/61981/

  PR:		221531
  Reported by:	forester on the FreeBSD forums [1]
  Approved by:	uqs (maintainer)
  MFH:		2017Q3

Changes:
  head/net/wmwifi/Makefile
  head/net/wmwifi/files/patch-configure.in
  head/net/wmwifi/files/patch-wireless.c
Comment 4 commit-hook freebsd_committer freebsd_triage 2017-08-15 19:22:31 UTC
A commit references this bug:

Author: tobik
Date: Tue Aug 15 19:21:29 UTC 2017
New revision: 448004
URL: https://svnweb.freebsd.org/changeset/ports/448004

Log:
  MFH: r448001

  net/wmwifi: Fix runtime on amd64

  Currently wmwifi doesn't start on amd64 and simply fails with

  wmwifi: No wireless interface found!

  The code assumes that sizeof(int) == sizeof(size_t) which isn't the
  case on amd64 (and other architectures) and all sysctl() calls will
  fail because of it.

  While here:

  - Fix a build failure when automake+autoconf are installed in the
    build environment.  By patching configure.in the build wants to
    regenerate configure which doesn't work correctly:

  gmake[1]: Entering directory '/usr/ports/net/wmwifi/work/wmwifi-0.4-bsd'
  cd . && aclocal
  aclocal-1.15: warning: autoconf input should be named 'configure.ac', not 'configure.in'
  /usr/local/share/aclocal/gdk-pixbuf.m4:12: warning: underquoted definition of AM_PATH_GDK_PIXBUF
  /usr/local/share/aclocal/gdk-pixbuf.m4:12:   run info Automake 'Extending aclocal'
  /usr/local/share/aclocal/gdk-pixbuf.m4:12:   or see http://www.gnu.org/software/automake/manual/automake.html#Extending-aclocal
  cd . && automake --gnu Makefile
  automake-1.15: warning: autoconf input should be named 'configure.ac', not 'configure.in'
  configure.in:3: warning: AM_INIT_AUTOMAKE: two- and three-arguments forms are deprecated.  For more info, see:
  configure.in:3: http://www.gnu.org/software/automake/manual/automake.html#Modernize-AM_005fINIT_005fAUTOMAKE-invocation
  configure.in:6: error: required file './compile' not found
  configure.in:6:   'automake --add-missing' can install 'compile'
  gmake[1]: *** [Makefile:82: Makefile.in] Error 1
  gmake[1]: Leaving directory '/usr/ports/net/wmwifi/work/wmwifi-0.4-bsd'
  *** Error code 1

    Remove files/patch-configure.in and pass CFLAGS through
    CONFIGURE_ENV instead.

  - Add LICENSE, LICENSE_FILE
  - Add missing dependency on libXext

  [1] https://forums.freebsd.org/threads/61981/

  PR:		221531
  Reported by:	forester on the FreeBSD forums [1]
  Approved by:	uqs (maintainer)

  Approved by:	ports-secteam (blanket)

Changes:
_U  branches/2017Q3/
  branches/2017Q3/net/wmwifi/Makefile
  branches/2017Q3/net/wmwifi/files/patch-configure.in
  branches/2017Q3/net/wmwifi/files/patch-wireless.c
Comment 5 Tobias Kortkamp freebsd_committer freebsd_triage 2017-08-15 19:22:57 UTC
Committed. Thank you!