Bug 249954 - graphics/drm-kmod : Fails to build on FreeBSD 12.2-BETA1 r365618 GENERIC powerpc 32 bit : /usr/src/sys/vm/vm_page.h:204: error: field 'md' has incomplete type
Summary: graphics/drm-kmod : Fails to build on FreeBSD 12.2-BETA1 r365618 GENERIC powe...
Status: Closed Overcome By Events
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: powerpc Any
: --- Affects Only Me
Assignee: freebsd-x11 (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-09-28 12:29 UTC by canardo
Modified: 2021-11-19 14:59 UTC (History)
5 users (show)

See Also:
bugzilla: maintainer-feedback? (x11)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description canardo 2020-09-28 12:29:41 UTC
Problem found when building graphics/drm-kmod on FreeBSD 12.2-BETA1 r365618 GENERIC powerpc 32 bit, running on Apple Powerbook 17".


# cd /usr/ports/graphics/drm-kmod/
/usr/ports/graphics/drm-kmod # make -DBATCH install clean
===>  Staging for drm-kmod-g20190710
===>   drm-kmod-g20190710 depends on file: /boot/modules/drm.ko - not found
===>  Building for drm-legacy-kmod-g20200825
===> drm (all)
===> drm/drm (all)
Warning: Object directory not changed from original /usr/ports/graphics/drm-legacy-kmod/work/drm-legacy-3f527d9/drm/drm
cc  -O2 -pipe -fno-strict-aliasing  -Wno-error -D_KERNEL -DKLD_MODULE -nostdinc  -I/usr/ports/graphics/drm-legacy-kmod/work/drm-legacy-3f527d9/drm/../src/ -I. -I/usr/src/sys -I/usr/src/sys/contrib/ck/include -fno-common  -mlongcall -fno-omit-frame-pointer   -MD  -MF.depend.drm_agpsupport.o -MTdrm_agpsupport.o -mno-altivec -msoft-float -ffreestanding -fwrapv -fstack-protector -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wcast-qual -Wundef -Wno-pointer-sign -fformat-extensions -Wmissing-include-dirs -fdiagnostics-show-option -Wno-unknown-pragmas -Wno-uninitialized  -finline-limit=15000 -fms-extensions --param inline-unit-growth=100 --param large-function-growth=1000  -std=iso9899:1999 -c /usr/ports/graphics/drm-legacy-kmod/work/drm-legacy-3f527d9/src/dev/drm/drm_agpsupport.c -o drm_agpsupport.o
In file included from /usr/ports/graphics/drm-legacy-kmod/work/drm-legacy-3f527d9/drm/../src/dev/drm/drmP.h:75,
                 from /usr/ports/graphics/drm-legacy-kmod/work/drm-legacy-3f527d9/src/dev/drm/drm_agpsupport.c:39:
/usr/src/sys/vm/vm_page.h:204: error: field 'md' has incomplete type
*** [drm_agpsupport.o] Error code 1

make[4]: stopped in /usr/ports/graphics/drm-legacy-kmod/work/drm-legacy-3f527d9/drm/drm
1 error

make[4]: stopped in /usr/ports/graphics/drm-legacy-kmod/work/drm-legacy-3f527d9/drm/drm
===> Compilation failed unexpectedly.
Try to set MAKE_JOBS_UNSAFE=yes and rebuild before reporting the failure to
the maintainer.
*** Error code 1

Stop.
make[1]: stopped in /usr/ports/graphics/drm-legacy-kmod
*** Error code 1

Stop.
make: stopped in /usr/ports/graphics/drm-kmod
Comment 1 steve hill esq. 2020-12-24 10:53:48 UTC
Confirmed on my G4 powerpc machines.
Comment 2 lfmorrison 2020-12-24 13:21:24 UTC
I saw this some time ago as well, but the specifics may be a little rusty. I never found a solution.

As I recall, this seems to be a consequence of the way the kernel deals with two different ways in which various PowerPC hardware deals with virtual memory. Some use the legacy "AIM" (Apple-IBM-Motorola) model, and others use an alternate Book-E" model, which was added to make PowerPC more palatable for embedded systems.

Application code works identically on processors using either VM model, but the kernel code needs to work differently. The FreeBSD kernel has support for both VM models, but a compile-time define needs to be supplied to specify which model is used for the targeted CPU; this configuration parameter leads to, among other things, different definitions of the struct in question.

When building drm-kmod, the build system somehow needs to be told whether the kernel module is being built for AIM or Book-E in order to get past this error.

Since running into this issue, the increasing in dependency that various ports have on a bootstrap rustc compiler (which doesn't exist upstream for 32-bit PowerPC on FreeBSD) has left me reluctant to go much further in my experiments with graphical environments.
Comment 3 Alexey Dokuchaev freebsd_committer freebsd_triage 2020-12-24 14:17:11 UTC
(In reply to lfmorrison from comment #2)
> the increasing in dependency that various ports have on a bootstrap rustc
> compiler (which doesn't exist upstream for 32-bit PowerPC on FreeBSD) has
> left me reluctant to go much further in my experiments with graphical
> environments.
This is probably due to the new version of librsvg2 which uses rust now.  Fortunately, it is possible to stick to the legacy version, see bug #251014 and ports r555776.
Comment 4 Emmanuel Vadot freebsd_committer freebsd_triage 2021-11-19 14:59:04 UTC
Closing, please re-open if this happens with supported FreeBSD version and up to date ports tree.