Bug 254627

Summary: graphics/drm-fbsd12.0-kmod: compilation error on 12.2-STABLE r369523
Product: Ports & Packages Reporter: Thierry Thomas <thierry>
Component: Individual Port(s)Assignee: Hans Petter Selasky <hselasky>
Status: Closed FIXED    
Severity: Affects Only Me CC: hselasky, manu, tatsuki_makino
Priority: --- Flags: bugzilla: maintainer-feedback? (x11)
Version: Latest   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
Try this patch none

Description Thierry Thomas freebsd_committer freebsd_triage 2021-03-28 14:35:56 UTC
On my workstation,12.2-STABLE upgraded on 27th march 2021 (r369523), compilation fails with this error:

--- linux_device.o ---
cc  -O2 -pipe -fno-strict-aliasing -include /usr/ports/graphics/drm-fbsd12.0-kmod/work/kms-drm-fa1387d/drivers/gpu/drm/drm_os_config.h '-DKBUILD_MODNAME="linuxkpi_gplv2"'  -Werror -D_KERNEL -DKLD_MODULE -nostdinc  -I/usr/ports/graphics/drm-fbsd12.0-kmod/work/kms-drm-fa1387d/include -I/usr/ports/graphics/drm-fbsd12.0-kmod/work/kms-drm-fa1387d/linuxkpi/dummy/include -I/usr/ports/graphics/drm-fbsd12.0-kmod/work/kms-drm-fa1387d/linuxkpi/gplv2/include -I/usr/src/sys/compat/linuxkpi/common/include -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.linux_device.o -MTlinux_device.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 -Wno-pointer-arith  -mno-aes -mno-avx  -std=iso9899:1999 -c /usr/ports/graphics/drm-fbsd12.0-kmod/work/kms-drm-fa1387d/linuxkpi/gplv2/src/linux_device.c -o linux_device.o
--- linux_backlight.o ---
In file included from /usr/ports/graphics/drm-fbsd12.0-kmod/work/kms-drm-fa1387d/linuxkpi/gplv2/src/linux_backlight.c:13:
In file included from /usr/ports/graphics/drm-fbsd12.0-kmod/work/kms-drm-fa1387d/linuxkpi/gplv2/include/linux/backlight.h:12:
In file included from /usr/ports/graphics/drm-fbsd12.0-kmod/work/kms-drm-fa1387d/linuxkpi/gplv2/include/linux/fb.h:4:
In file included from /usr/ports/graphics/drm-fbsd12.0-kmod/work/kms-drm-fa1387d/linuxkpi/gplv2/include/uapi/linux/fb.h:5:
In file included from /usr/ports/graphics/drm-fbsd12.0-kmod/work/kms-drm-fa1387d/linuxkpi/gplv2/include/linux/i2c.h:9:
/usr/ports/graphics/drm-fbsd12.0-kmod/work/kms-drm-fa1387d/linuxkpi/gplv2/include/linux/of.h:51:1: error: expected identifier or '('
of_node_to_nid(struct device_node *device)
^
/usr/src/sys/compat/linuxkpi/common/include/linux/device.h:559:30: note: expanded from macro 'of_node_to_nid'
#define of_node_to_nid(node) -1
                             ^
1 error generated.
*** [linux_backlight.o] Error code 1

make[2]: stopped in /usr/ports/graphics/drm-fbsd12.0-kmod/work/kms-drm-fa1387d/linuxkpi
1 error

make[2]: stopped in /usr/ports/graphics/drm-fbsd12.0-kmod/work/kms-drm-fa1387d/linuxkpi
===> Compilation failed unexpectedly.
Comment 1 Tatsuki Makino 2021-03-28 21:11:16 UTC
This is due to the following changes.

https://cgit.freebsd.org/src/diff/?h=stable/12&id=1a12a42a9ac533c29cb4100ae2481e72d53d424a
Comment 2 Hans Petter Selasky freebsd_committer freebsd_triage 2021-03-29 10:17:43 UTC
Created attachment 223680 [details]
Try this patch

Sorry for the breakage.
Comment 3 Hans Petter Selasky freebsd_committer freebsd_triage 2021-03-29 10:18:43 UTC
Manu:

Can you merge this patch into the source repository. I believe I don't have access there.

--HPS
Comment 4 Emmanuel Vadot freebsd_committer freebsd_triage 2021-03-29 10:26:40 UTC
I don't have access to.
Comment 5 Hans Petter Selasky freebsd_committer freebsd_triage 2021-03-29 10:47:11 UTC
Seems like I can push there. I'll fix.
Comment 6 commit-hook freebsd_committer freebsd_triage 2021-03-29 10:54:53 UTC
A commit references this bug:

Author: hselasky
Date: Mon Mar 29 10:54:05 UTC 2021
New revision: 569463
URL: https://svnweb.freebsd.org/changeset/ports/569463

Log:
  Buildfix for 12-stable after 1a12a42a9ac533c29cb4100ae2481e72d53d424a .

  PR:		254627
  Approved by:	pi (implicit)

Changes:
  head/graphics/drm-fbsd12.0-kmod/Makefile
  head/graphics/drm-fbsd12.0-kmod/distinfo
  head/graphics/drm-fbsd12.0-kmod/pkg-descr
Comment 7 Hans Petter Selasky freebsd_committer freebsd_triage 2021-03-29 10:55:54 UTC
Let me know if the issue still persists. Builds fine over here.
Comment 8 Thierry Thomas freebsd_committer freebsd_triage 2021-03-29 17:06:39 UTC
That did it, thanks!
Comment 9 Tatsuki Makino 2021-03-30 00:38:06 UTC
I was able to build that with 4fd5354e85e4e72b91e7690595173b3bbde21490 as well.
Thank you very much.