Bug 209924 - 11.0 -r301815 buildkernel via amd64-gcc fails for: .../dev/drm2/i915/dvo_ch7xxx.c related redundant declarations
Summary: 11.0 -r301815 buildkernel via amd64-gcc fails for: .../dev/drm2/i915/dvo_ch7x...
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: 11.0-BETA3
Hardware: amd64 Any
: --- Affects Only Me
Assignee: Enji Cooper
URL:
Keywords:
: 210997 (view as bug list)
Depends on:
Blocks:
 
Reported: 2016-06-01 09:04 UTC by Mark Millard
Modified: 2016-08-03 00:23 UTC (History)
2 users (show)

See Also:
ngie: mfc-stable9-
ngie: mfc-stable10-
ngie: mfc-stable11+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mark Millard 2016-06-01 09:04:41 UTC
[This was after locally clearing up some cxgb and cxgbe source issues.]

--- all_subdir_drm2/i915kms ---
In file included from /usr/src/sys/modules/drm2/i915kms/../../../dev/drm2/i915/intel_drv.h:31:0,
                from /usr/src/sys/modules/drm2/i915kms/../../../dev/drm2/i915/dvo.h:35,
                from /usr/src/sys/modules/drm2/i915kms/../../../dev/drm2/i915/dvo_ch7xxx.c:32:
/usr/src/sys/dev/drm2/i915/i915_drv.h:1621:6: error: redundant redeclaration of 'i915_gem_dump_object' [-Werror=redundant-decls]
void i915_gem_dump_object(struct drm_i915_gem_object *obj, int len,
     ^
/usr/src/sys/dev/drm2/i915/i915_drv.h:1612:6: note: previous declaration of 'i915_gem_dump_object' was here
void i915_gem_dump_object(struct drm_i915_gem_object *obj, int len,
     ^
In file included from /usr/src/sys/modules/drm2/i915kms/../../../dev/drm2/i915/dvo.h:35:0,
                from /usr/src/sys/modules/drm2/i915kms/../../../dev/drm2/i915/dvo_ch7xxx.c:32:
/usr/src/sys/modules/drm2/i915kms/../../../dev/drm2/i915/intel_drv.h:671:13: error: redundant redeclaration of 'intel_fbc_enabled' [-Werror=redundant-decls]
extern bool intel_fbc_enabled(struct drm_device *dev);
            ^
In file included from /usr/src/sys/modules/drm2/i915kms/../../../dev/drm2/i915/intel_drv.h:31:0,
                from /usr/src/sys/modules/drm2/i915kms/../../../dev/drm2/i915/dvo.h:35,
                from /usr/src/sys/modules/drm2/i915kms/../../../dev/drm2/i915/dvo_ch7xxx.c:32:
/usr/src/sys/dev/drm2/i915/i915_drv.h:1676:13: note: previous declaration of 'intel_fbc_enabled' was here
extern bool intel_fbc_enabled(struct drm_device *dev);
            ^

. . .
--- all_subdir_drm2 ---
cc1: all warnings being treated as errors
*** [dvo_ch7xxx.o] Error code 1


There may be more: I stopped exploring with this.
Comment 1 Mark Millard 2016-06-13 07:02:13 UTC
(In reply to Mark Millard from comment #0)

This is still true of 11.0 -r301815.
Comment 2 Mark Millard 2016-07-11 10:21:40 UTC
*** Bug 210997 has been marked as a duplicate of this bug. ***
Comment 3 Mark Millard 2016-07-11 10:26:12 UTC
Still true as of -r302457. I've updated the version to reflect that.
Comment 4 commit-hook freebsd_committer 2016-07-11 15:48:00 UTC
A commit references this bug:

Author: ngie
Date: Mon Jul 11 15:47:43 UTC 2016
New revision: 302571
URL: https://svnweb.freebsd.org/changeset/base/302571

Log:
  Remove redundant declaration for radeon_pm_acpi_event_handler(..) to fix
  -Wredundant-decls warning

  MFC after:	1 week
  PR:		209924
  Reported by:	Mark Millard <markmi@dsl-only.net>
  Tested with:	devel/amd64-gcc (5.3.0)
  Sponsored by:	EMC / Isilon Storage Division

Changes:
  head/sys/dev/drm2/radeon/radeon_acpi.c
Comment 5 commit-hook freebsd_committer 2016-07-11 15:51:02 UTC
A commit references this bug:

Author: ngie
Date: Mon Jul 11 15:50:06 UTC 2016
New revision: 302572
URL: https://svnweb.freebsd.org/changeset/base/302572

Log:
  Remove redundant declarations for intel_fbc_enabled(..) and
  i915_gem_dump_object(..) to fix -Wredundant-decls warning

  MFC after:	1 week
  PR:		209924
  Reported by:	Mark Millard <markmi@dsl-only.net>
  Tested with:	devel/amd64-gcc (5.3.0)
  Sponsored by:	EMC / Isilon Storage Division

Changes:
  head/sys/dev/drm2/i915/i915_drv.h
Comment 6 Enji Cooper freebsd_committer 2016-07-11 16:17:15 UTC
CR opened for cxgb: https://reviews.freebsd.org/D7187
CR opened for drm2's capable(..) function: https://reviews.freebsd.org/D7188

All other drm2 issues have been resolved per amd64-gcc.
Comment 7 commit-hook freebsd_committer 2016-07-11 16:53:06 UTC
A commit references this bug:

Author: ngie
Date: Mon Jul 11 16:52:05 UTC 2016
New revision: 302574
URL: https://svnweb.freebsd.org/changeset/base/302574

Log:
  Remove redundant declaration for tcp_dooptions

  netinet/tcp_var.h already defines this function

  PR:		209924
  Reported by:	Mark Millard <markmi@dsl-only.net>
  Reviewed by:	np
  Tested with:	clang 3.8.0, gcc 4.2.1, gcc 5.3.0
  Sponsored by:	EMC / Isilon Storage Division

Changes:
  head/sys/dev/cxgb/ulp/tom/cxgb_listen.c
Comment 8 Mark Millard 2016-08-02 09:29:46 UTC
I've updated the version to indicate 11.0-BETA3 because the updates from CURRENT have not been MFC'd to 11.0-STABLE yet.

My guess at this point is that the MFC will not happen until after 11.0-RELEASE. In other words: 11.0-RELEASE will not build under amd64-gcc when -Werror=redundant-decls is in use. But eventually 11.0-STABLE might.
Comment 9 commit-hook freebsd_committer 2016-08-03 00:03:52 UTC
A commit references this bug:

Author: ngie
Date: Wed Aug  3 00:03:03 UTC 2016
New revision: 303689
URL: https://svnweb.freebsd.org/changeset/base/303689

Log:
  MFC r302571,r302572,r302577,r302841:

  Approved by: re (gjb)

  r302571:

  Remove redundant declaration for radeon_pm_acpi_event_handler(..) to fix
  -Wredundant-decls warning

  PR:		209924
  Tested with:	devel/amd64-gcc (5.3.0)

  r302572:

  Remove redundant declarations for intel_fbc_enabled(..) and
  i915_gem_dump_object(..) to fix -Wredundant-decls warning

  PR:		209924
  Tested with:	devel/amd64-gcc (5.3.0)

  r302577:

  Add missing default case to capable(..) function definition

  By definition (enum __drm_capabilities), cases other than CAP_SYS_ADMIN
  aren't possible. Add in a KASSERT safety belt and return false in
  !INVARIANTS case if an invalid value is passed in, as it would be a
  programmer error.

  This fixes a -Wreturn-type error with gcc 5.3.0.

  r302841:

  Always panic if an invalid capability is passed to `capable(..)` instead of
  just with INVARIANTS

  rwatson's point was valid in the sense that if the data passed at runtime is
  invalid, it should always trip the invariant, not just in the debug case.
  This is a deterrent against malicious input, or input caused by hardware
  errors.

  Requested by: rwatson

Changes:
_U  stable/11/
  stable/11/sys/dev/drm2/drm_os_freebsd.h
  stable/11/sys/dev/drm2/i915/i915_drv.h
  stable/11/sys/dev/drm2/radeon/radeon_acpi.c
Comment 10 commit-hook freebsd_committer 2016-08-03 00:03:53 UTC
A commit references this bug:

Author: ngie
Date: Wed Aug  3 00:03:03 UTC 2016
New revision: 303689
URL: https://svnweb.freebsd.org/changeset/base/303689

Log:
  MFC r302571,r302572,r302577,r302841:

  Approved by: re (gjb)

  r302571:

  Remove redundant declaration for radeon_pm_acpi_event_handler(..) to fix
  -Wredundant-decls warning

  PR:		209924
  Tested with:	devel/amd64-gcc (5.3.0)

  r302572:

  Remove redundant declarations for intel_fbc_enabled(..) and
  i915_gem_dump_object(..) to fix -Wredundant-decls warning

  PR:		209924
  Tested with:	devel/amd64-gcc (5.3.0)

  r302577:

  Add missing default case to capable(..) function definition

  By definition (enum __drm_capabilities), cases other than CAP_SYS_ADMIN
  aren't possible. Add in a KASSERT safety belt and return false in
  !INVARIANTS case if an invalid value is passed in, as it would be a
  programmer error.

  This fixes a -Wreturn-type error with gcc 5.3.0.

  r302841:

  Always panic if an invalid capability is passed to `capable(..)` instead of
  just with INVARIANTS

  rwatson's point was valid in the sense that if the data passed at runtime is
  invalid, it should always trip the invariant, not just in the debug case.
  This is a deterrent against malicious input, or input caused by hardware
  errors.

  Requested by: rwatson

Changes:
_U  stable/11/
  stable/11/sys/dev/drm2/drm_os_freebsd.h
  stable/11/sys/dev/drm2/i915/i915_drv.h
  stable/11/sys/dev/drm2/radeon/radeon_acpi.c