Bug 259275 - [PATCH] audio/oss fails to build on 14-CURRENT
Summary: [PATCH] audio/oss fails to build on 14-CURRENT
Status: In Progress
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Cy Schubert
URL: https://reviews.freebsd.org/D32560
Keywords:
Depends on:
Blocks:
 
Reported: 2021-10-19 15:49 UTC by Cy Schubert
Modified: 2021-10-19 18:48 UTC (History)
1 user (show)

See Also:
crees: maintainer-feedback+
cy: merge-quarterly?


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Cy Schubert freebsd_committer 2021-10-19 15:49:40 UTC
The audio/oss build failure on 14-CURRENT is:

--- osscore.o ---
/usr/local/bin/ccache cc  -O2 -pipe -Wno-misleading-indentation -Wno-tautological-overlap-compare -fno-strict-aliasing -Wno-misleading-indentation -Wno-tautological-overlap-compare  -Werror -D_KERNEL -DKLD_MODULE -nostdinc   -include /wrkdirs/usr/ports/audio/oss/work/.build/prototype/usr/local/lib/oss/build/opt_global.h -I. -I/usr/src/sys -I/usr/src/sys/contrib/ck/include -fno-common  -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -fdebug-prefix-map=./machine=/usr/src/sys/amd64/include -fdebug-prefix-map=./x86=/usr/src/sys/x86/include     -MD  -MF.depend.osscore.o -MTosscore.o -mcmodel=kernel -mno-red-zone -mno-mmx -mno-sse -msoft-float  -fno-asynchronous-unwind-tables -ffreestanding -fwrapv -fstack-protector -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wcast-qual -Wundef -Wno-pointer-sign -D__printf__=__freebsd_kprintf__ -Wmissing-include-dirs -fdiagnostics-show-option -Wno-unknown-pragmas -Wno-error=tautological-compare -Wno-error=empty-body -Wno-error=parentheses-equality -Wno-error=unused-function -Wno-error=pointer-sign -Wno-error=shift-negative-value -Wno-address-of-packed-member -Wno-format-zero-length   -mno-aes -mno-avx  -std=iso9899:1999 -c osscore.c -o osscore.o
osscore.c:150:38: error: incompatible pointer types passing 'dev_info_t *' (aka 'struct device *') to parameter of type 'device_t' (aka 'struct _device *') [-Werror,-Wincompatible-pointer-types]
  intr->irqres = bus_alloc_resource (osdev->dip, SYS_RES_IRQ, &(intr->irqid),
                                     ^~~~~~~~~~
/usr/src/sys/sys/bus.h:518:46: note: passing argument to parameter 'dev' here
struct  resource *bus_alloc_resource(device_t dev, int type, int *rid,
                                              ^
osscore.c:159:31: error: incompatible pointer types passing 'dev_info_t *' (aka 'struct device *') to parameter of type 'device_t' (aka 'struct _device *') [-Werror,-Wincompatible-pointer-types]
  intr->irq = bus_setup_intr (osdev->dip, intr->irqres,
                              ^~~~~~~~~~
/usr/src/sys/sys/bus.h:538:29: note: passing argument to parameter 'dev' here
int     bus_setup_intr(device_t dev, struct resource *r, int flags,
                                ^
osscore.c:182:21: error: incompatible pointer types passing 'dev_info_t *' (aka 'struct device *') to parameter of type 'device_t' (aka 'struct _device *') [-Werror,-Wincompatible-pointer-types]
        bus_teardown_intr (osdev->dip, intr->irqres, intr->cookie);
                           ^~~~~~~~~~
/usr/src/sys/sys/bus.h:541:32: note: passing argument to parameter 'dev' here
int     bus_teardown_intr(device_t dev, struct resource *r, void *cookie);
                                   ^
osscore.c:183:24: error: incompatible pointer types passing 'dev_info_t *' (aka 'struct device *') to parameter of type 'device_t' (aka 'struct _device *') [-Werror,-Wincompatible-pointer-types]
        bus_release_resource (osdev->dip, SYS_RES_IRQ, intr->irqid,
                              ^~~~~~~~~~
/usr/src/sys/sys/bus.h:535:35: note: passing argument to parameter 'dev' here
int     bus_release_resource(device_t dev, int type, int rid,
                                      ^
osscore.c:201:27: error: incompatible pointer types passing 'dev_info_t *' (aka 'struct device *') to parameter of type 'device_t' (aka 'struct _device *') [-Werror,-Wincompatible-pointer-types]
  *val = pci_read_config (osdev->dip, where, 1);
                          ^~~~~~~~~~
/usr/src/sys/dev/pci/pcivar.h:401:26: note: passing argument to parameter 'dev' here
pci_read_config(device_t dev, int reg, int width)
                         ^
osscore.c:208:27: error: incompatible pointer types passing 'dev_info_t *' (aka 'struct device *') to parameter of type 'device_t' (aka 'struct _device *') [-Werror,-Wincompatible-pointer-types]
  *val = pci_read_config (osdev->dip, where, 1);
                          ^~~~~~~~~~
/usr/src/sys/dev/pci/pcivar.h:401:26: note: passing argument to parameter 'dev' here
pci_read_config(device_t dev, int reg, int width)
                         ^
osscore.c:216:27: error: incompatible pointer types passing 'dev_info_t *' (aka 'struct device *') to parameter of type 'device_t' (aka 'struct _device *') [-Werror,-Wincompatible-pointer-types]
  *val = pci_read_config (osdev->dip, where, 2);
                          ^~~~~~~~~~
/usr/src/sys/dev/pci/pcivar.h:401:26: note: passing argument to parameter 'dev' here
pci_read_config(device_t dev, int reg, int width)
                         ^
osscore.c:224:27: error: incompatible pointer types passing 'dev_info_t *' (aka 'struct device *') to parameter of type 'device_t' (aka 'struct _device *') [-Werror,-Wincompatible-pointer-types]
  *val = pci_read_config (osdev->dip, where, 4);
                          ^~~~~~~~~~
/usr/src/sys/dev/pci/pcivar.h:401:26: note: passing argument to parameter 'dev' here
pci_read_config(device_t dev, int reg, int width)
                         ^
osscore.c:232:21: error: incompatible pointer types passing 'dev_info_t *' (aka 'struct device *') to parameter of type 'device_t' (aka 'struct _device *') [-Werror,-Wincompatible-pointer-types]
  pci_write_config (osdev->dip, where, val, 1);
                    ^~~~~~~~~~
/usr/src/sys/dev/pci/pcivar.h:407:27: note: passing argument to parameter 'dev' here
pci_write_config(device_t dev, int reg, uint32_t val, int width)
                          ^
osscore.c:240:21: error: incompatible pointer types passing 'dev_info_t *' (aka 'struct device *') to parameter of type 'device_t' (aka 'struct _device *') [-Werror,-Wincompatible-pointer-types]
  pci_write_config (osdev->dip, where, val, 2);
                    ^~~~~~~~~~
/usr/src/sys/dev/pci/pcivar.h:407:27: note: passing argument to parameter 'dev' here
pci_write_config(device_t dev, int reg, uint32_t val, int width)
                          ^
osscore.c:248:21: error: incompatible pointer types passing 'dev_info_t *' (aka 'struct device *') to parameter of type 'device_t' (aka 'struct _device *') [-Werror,-Wincompatible-pointer-types]
  pci_write_config (osdev->dip, where, val, 4);
                    ^~~~~~~~~~
/usr/src/sys/dev/pci/pcivar.h:407:27: note: passing argument to parameter 'dev' here
pci_write_config(device_t dev, int reg, uint32_t val, int width)
                          ^
11 errors generated.
*** [osscore.o] Error code 1

make[2]: stopped in /wrkdirs/usr/ports/audio/oss/work/.build/prototype/usr/local/lib/oss/build
1 error

make[2]: stopped in /wrkdirs/usr/ports/audio/oss/work/.build/prototype/usr/local/lib/oss/build
*** [install] Error code 1

make[1]: stopped in /wrkdirs/usr/ports/audio/oss/work/.build
1 error

make[1]: stopped in /wrkdirs/usr/ports/audio/oss/work/.build
===> Compilation failed unexpectedly.
Try to set MAKE_JOBS_UNSAFE=yes and rebuild before reporting the failure to
the maintainer.
*** Error code 1

Stop.
make: stopped in /usr/ports/audio/oss
=>> Cleaning up wrkdir
===>  Cleaning for oss-4.2.b2019_2
build of audio/oss | oss-4.2.b2019_2 ended at Mon Oct 18 20:02:11 PDT 2021
build time: 00:04:53
!!! build failure encountered !!!
Comment 1 Cy Schubert freebsd_committer 2021-10-19 15:50:24 UTC
The patch can be found at https://reviews.freebsd.org/D32560/.
Comment 2 Chris Rees freebsd_committer 2021-10-19 17:17:22 UTC
Awesome, thanks!

BTW, adding the trailing slash breaks Phabricator apparently :/

Are you happy to commit?
Comment 3 Cy Schubert freebsd_committer 2021-10-19 17:31:48 UTC
I'll commit it. Thanks.
Comment 4 commit-hook freebsd_committer 2021-10-19 18:48:36 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=ff67375036355e9cfb8b92b1d694cd936068c2cf

commit ff67375036355e9cfb8b92b1d694cd936068c2cf
Author:     Cy Schubert <cy@FreeBSD.org>
AuthorDate: 2021-10-19 17:32:17 +0000
Commit:     Cy Schubert <cy@FreeBSD.org>
CommitDate: 2021-10-19 18:47:41 +0000

    audio/oss: Fix build on 14-CURRENT

    As of dfff37765ce4ea4fd7db4d293b459dc84008f411 (1400010),
    struct device on 14-CURRENT was renamed to struct _device. This
    commit chases this change by adding a __FreeBSD_version CPP
    conditional.

    PR:                     259275
    Submitted by:           cy
    Reported by:            cy
    Reviewed by:            crees
    Tested by:              cy
    Approved by:            crees
    MFH:                    2021Q4
    Differential Revision:  https://reviews.freebsd.org/D32560

 .../files/patch-kernel_OS_FreeBSD_wrapper_bsddefs.h    | 18 +++++++++++++++---
 1 file changed, 15 insertions(+), 3 deletions(-)