Bug 255222 - drm-fbsd13-mod: Build failure
Summary: drm-fbsd13-mod: Build failure
Status: Open
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: freebsd-x11 (Nobody)
Depends on:
Reported: 2021-04-19 12:37 UTC by Jason W. Bacon
Modified: 2021-05-05 17:17 UTC (History)
1 user (show)

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


Note You need to log in before you can comment on or make changes to this bug.
Description Jason W. Bacon freebsd_committer 2021-04-19 12:37:44 UTC
13.0-RELEASE, Fully updated packages and ports tree:

/usr/ports/graphics/drm-fbsd13-kmod/work/drm-kmod-drm_v5.4.92_3/drivers/gpu/drm/ttm/ttm_page_alloc.c:1039:15: error: variable 'first' is uninitialized when used here [-Werror,-Wuninitialized]
                if (count > first && pages[count - 1] == tmp - 1)
/usr/ports/graphics/drm-fbsd13-kmod/work/drm-kmod-drm_v5.4.92_3/drivers/gpu/drm/ttm/ttm_page_alloc.c:933:23: note: initialize the variable 'first' to silence this warning
        unsigned count, first;
                              = 0
1 error generated.
*** [ttm_page_alloc.o] Error code 1

make[3]: stopped in /usr/ports/graphics/drm-fbsd13-kmod/work/drm-kmod-drm_v5.4.92_3/ttm
--- ttm_tt.o ---
/usr/ports/graphics/drm-fbsd13-kmod/work/drm-kmod-drm_v5.4.92_3/drivers/gpu/drm/ttm/ttm_tt.c:464:10: error: unused variable 'i' [-Werror,-Wunused-variable]
        pgoff_t i;
/usr/ports/graphics/drm-fbsd13-kmod/work/drm-kmod-drm_v5.4.92_3/drivers/gpu/drm/ttm/ttm_tt.c:494:16: error: unused variable 'vm_page' [-Werror,-Wunused-variable]
        struct page **page = ttm->pages;
/usr/src/sys/compat/linuxkpi/common/include/linux/page.h:49:14: note: expanded from macro 'page'
#define page    vm_page
/usr/ports/graphics/drm-fbsd13-kmod/work/drm-kmod-drm_v5.4.92_3/drivers/gpu/drm/ttm/ttm_tt.c:493:10: error: unused variable 'i' [-Werror,-Wunused-variable]
        pgoff_t i;
3 errors generated.
*** [ttm_tt.o] Error code 1

make[3]: stopped in /usr/ports/graphics/drm-fbsd13-kmod/work/drm-kmod-drm_v5.4.92_3/ttm
2 errors

make[3]: stopped in /usr/ports/graphics/drm-fbsd13-kmod/work/drm-kmod-drm_v5.4.92_3/ttm

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

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

make: stopped in /usr/ports/graphics/drm-fbsd13-kmod
Comment 1 Emmanuel Vadot freebsd_committer 2021-04-19 12:58:11 UTC
Cannot reproduce in :
- Cirrus-ci https://cirrus-ci.com/task/5023012320706560
- Poudriere with a 13.0 jail
- Locally from the ports tree on a 13.0 box
- Locally from https://github.com/freebsd/drm-kmod/ on a 13.0 box

Do you have any modification to the system ? (/etc/src.conf or /etc/make.conf)

Comment 2 Jason W. Bacon freebsd_committer 2021-04-19 15:42:50 UTC
Yeah, interesting.  For some reason it's sensitive to

CFLAGS+=-O -Wall -g

which I had added for some local builds.  I remove that and the error goes away.
Comment 3 Jason W. Bacon freebsd_committer 2021-05-05 17:17:48 UTC
Note to posterity:

The following addition to /etc/make.conf allows building ports without the extra CFLAGS, while they are used for building and testing code elsewhere:

# Enable full conmpiler warnings and debug symbols outside ports
PWD!=   pwd
.if empty(PWD:M/usr/ports*)
CFLAGS+=-O -Wall -g