Bug 255955 - devel/mdb: Fix build with clang 12
Summary: devel/mdb: Fix build with clang 12
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: John Baldwin
URL:
Keywords:
Depends on:
Blocks: 255570
  Show dependency treegraph
 
Reported: 2021-05-17 20:04 UTC by Dimitry Andric
Modified: 2021-06-06 18:22 UTC (History)
0 users

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


Attachments
Fix devel/mdb build with clang 12 (576 bytes, patch)
2021-05-17 20:04 UTC, Dimitry Andric
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dimitry Andric freebsd_committer 2021-05-17 20:04:36 UTC
Created attachment 225038 [details]
Fix devel/mdb build with clang 12

During an exp-run for llvm 12 (see bug 255570), it turned out that devel/mdb does not build with clang 12.0.0 [1]:

cc  -O2 -pipe  -DMDB_PREFIX=\"/usr/local\" -g -fstack-protector-strong -fno-strict-aliasing  -I/wrkdirs/usr/ports/devel/mdb/work/illumos-gate-60ff9f11c2/freebsd/cddl/usr.bin/mdb/mdb/../../../../sys/cddl/compat/opensolaris  -I/usr/src/sys/cddl/compat/opensolaris  -I/wrkdirs/usr/ports/devel/mdb/work/illumos-gate-60ff9f11c2/freebsd/cddl/usr.bin/mdb/mdb/../../../../cddl/compat/opensolaris/include  -I/usr/src/cddl/compat/opensolaris/include  -I/usr/src/cddl/contrib/opensolaris/head  -I/wrkdirs/usr/ports/devel/mdb/work/illumos-gate-60ff9f11c2/freebsd/cddl/usr.bin/mdb/mdb/../../../../../usr/src/lib/libdisasm/common  -I/wrkdirs/usr/ports/devel/mdb/work/illumos-gate-60ff9f11c2/freebsd/cddl/usr.bin/mdb/mdb/../../../../../usr/src/common/dis/i386  -I/usr/src/cddl/contrib/opensolaris/lib/libctf/common  -I/usr/src/sys/cddl/contrib/opensolaris/uts/common -I/wrkdirs/usr/ports/devel/mdb/work/illumos-gate-60ff9f11c2/freebsd/cddl/usr.bin/mdb/mdb/../../../../../usr/src/cmd/mdb/intel/mdb -I/wrkdirs/usr/ports/devel/mdb/work/illumos-gate-60ff9f11c2/freebsd/cddl/usr.bin/mdb/mdb/../../../../../usr/src/cmd/mdb/intel/amd64/mdb -I/wrkdirs/usr/ports/devel/mdb/work/illumos-gate-60ff9f11c2/freebsd/cddl/usr.bin/mdb/mdb/../../../../../usr/src/cmd/mdb/intel -I/wrkdirs/usr/ports/devel/mdb/work/illumos-gate-60ff9f11c2/freebsd/cddl/usr.bin/mdb/mdb/../../../../../usr/src/lib/libsaveargs/common -D_MDB -I/wrkdirs/usr/ports/devel/mdb/work/illumos-gate-60ff9f11c2/freebsd/cddl/usr.bin/mdb/mdb/../../../../../usr/src/cmd/mdb/common -I/usr/src -DDIS_TEXT -D_SYS_INT_TYPES_H -Dmemalign=aligned_alloc -DTCGETS=TIOCGETA -DTCSETSW=TIOCSETAW -DIUCLC=0 -DENODATA=ENOENT   -D__amd64 -DIN_BASE -DNEED_SOLARIS_BOOLEAN -fPIE -MD  -MF.depend.kvm_amd64dep_freebsd.o -MTkvm_amd64dep_freebsd.o -std=gnu99 -Wno-format-zero-length -nobuiltininc -idirafter /usr/lib/clang/12.0.0/include -fstack-protector-strong -Wsystem-headers -Werror -Wall -Wno-format-y2k -W -Wno-unused-parameter -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch -Wshadow -Wunused-parameter -Wcast-align -Wchar-subscripts -Wnested-externs -Wredundant-decls -Wold-style-definition -Wno-pointer-sign -Wno-unknown-pragmas -Wmissing-variable-declarations -Wthread-safety -Wno-empty-body -Wno-string-plus-int -Wno-unused-const-variable -Wno-bitwise-op-parentheses  -Wno-cast-align  -Wno-cast-qual  -Wno-char-subscripts  -Wno-incompatible-pointer-types  -Wno-incompatible-pointer-types-discards-qualifiers  -Wno-logical-op-parentheses  -Wno-missing-braces  -Wno-missing-field-initializers  -Wno-missing-variable-declarations  -Wno-shadow  -Wno-sign-compare  -Wno-strict-prototypes  -Wno-error-tautological-pointer-compare  -Wno-unused-parameter  -Qunused-arguments    -c /wrkdirs/usr/ports/devel/mdb/work/illumos-gate-60ff9f11c2/freebsd/cddl/usr.bin/mdb/mdb/../../../../../usr/src/cmd/mdb/intel/mdb/kvm_amd64dep_freebsd.c -o kvm_amd64dep_freebsd.o
error: unknown -Werror warning specifier: '-Wno-error-tautological-pointer-compare' [-Werror,-Wunknown-warning-option]
*** [kvm_amd64dep_freebsd.o] Error code 1

This is because for a while -Wno-error- options should be spelled as -Wno-error=. The attached patch makes it so.

[1] http://package22.nyi.freebsd.org/data/mainamd64PR255570-default/2021-05-08_16h02m24s/logs/mdb-20210125.log
Comment 1 commit-hook freebsd_committer 2021-06-06 18:21:28 UTC
A commit in branch main references this bug:

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

commit 6f7976573c611f946f9ce34a3f21c848ab48d1de
Author:     Dimitry Andric <dim@FreeBSD.org>
AuthorDate: 2021-05-17 20:03:02 +0000
Commit:     Dimitry Andric <dim@FreeBSD.org>
CommitDate: 2021-06-06 18:20:02 +0000

    devel/mdb: fix tautological-pointer-compare warning option

    During an exp-run for llvm 12 (see bug 255570), it turned out that
    devel/mdb does not build with clang 12.0.0:

    cc  -O2 -pipe  -DMDB_PREFIX=\"/usr/local\" -g -fstack-protector-strong -fno-strict-aliasing  -I/wrkdirs/usr/ports/devel/mdb/work/illumos-gate-60ff9f11c2/freebsd/cddl/usr.bin/mdb/mdb/../../../../sys/cddl/compat/opensolaris  -I/usr/src/sys/cddl/compat/opensolaris  -I/wrkdirs/usr/ports/devel/mdb/work/illumos-gate-60ff9f11c2/freebsd/cddl/usr.bin/mdb/mdb/../../../../cddl/compat/opensolaris/include  -I/usr/src/cddl/compat/opensolaris/include  -I/usr/src/cddl/contrib/opensolaris/head  -I/wrkdirs/usr/ports/devel/mdb/work/illumos-gate-60ff9f11c2/freebsd/cddl/usr.bin/mdb/mdb/../../../../../usr/src/lib/libdisasm/common  -I/wrkdirs/usr/ports/devel/mdb/work/illumos-gate-60ff9f11c2/freebsd/cddl/usr.bin/mdb/mdb/../../../../../usr/src/common/dis/i386  -I/usr/src/cddl/contrib/opensolaris/lib/libctf/common  -I/usr/src/sys/cddl/contrib/opensolaris/uts/common -I/wrkdirs/usr/ports/devel/mdb/work/illumos-gate-60ff9f11c2/freebsd/cddl/usr.bin/mdb/mdb/../../../../../usr/src/cmd/mdb/intel/mdb -I/wrkdirs/u
 sr/ports/devel/mdb/work/illumos-gate-60ff9f11c2/freebsd/cddl/usr.bin/mdb/mdb/../../../../../usr/src/cmd/mdb/intel/amd64/mdb -I/wrkdirs/usr/ports/devel/mdb/work/illumos-gate-60ff9f11c2/freebsd/cddl/usr.bin/mdb/mdb/../../../../../usr/src/cmd/mdb/intel -I/wrkdirs/usr/ports/devel/mdb/work/illumos-gate-60ff9f11c2/freebsd/cddl/usr.bin/mdb/mdb/../../../../../usr/src/lib/libsaveargs/common -D_MDB -I/wrkdirs/usr/ports/devel/mdb/work/illumos-gate-60ff9f11c2/freebsd/cddl/usr.bin/mdb/mdb/../../../../../usr/src/cmd/mdb/common -I/usr/src -DDIS_TEXT -D_SYS_INT_TYPES_H -Dmemalign=aligned_alloc -DTCGETS=TIOCGETA -DTCSETSW=TIOCSETAW -DIUCLC=0 -DENODATA=ENOENT   -D__amd64 -DIN_BASE -DNEED_SOLARIS_BOOLEAN -fPIE -MD  -MF.depend.kvm_amd64dep_freebsd.o -MTkvm_amd64dep_freebsd.o -std=gnu99 -Wno-format-zero-length -nobuiltininc -idirafter /usr/lib/clang/12.0.0/include -fstack-protector-strong -Wsystem-headers -Werror -Wall -Wno-format-y2k -W -Wno-unused-parameter -Wstrict-prototypes -Wmissing-prototypes -Wp
 ointer-arith -Wreturn-type -Wcast-qual -Wwri!
 te-strings -Wswitch -Wshadow -Wunused-parameter -Wcast-align -Wchar-subscripts -Wnested-externs -Wredundant-decls -Wold-style-definition -Wno-pointer-sign -Wno-unknown-pragmas -Wmissing-variable-declarations -Wthread-safety -Wno-empty-body -Wno-string-plus-int -Wno-unused-const-variable -Wno-bitwise-op-parentheses  -Wno-cast-align  -Wno-cast-qual  -Wno-char-subscripts  -Wno-incompatible-pointer-types  -Wno-incompatible-pointer-types-discards-qualifiers  -Wno-logical-op-parentheses  -Wno-missing-braces  -Wno-missing-field-initializers  -Wno-missing-variable-declarations  -Wno-shadow  -Wno-sign-compare  -Wno-strict-prototypes  -Wno-error-tautological-pointer-compare  -Wno-unused-parameter  -Qunused-arguments    -c /wrkdirs/usr/ports/devel/mdb/work/illumos-gate-60ff9f11c2/freebsd/cddl/usr.bin/mdb/mdb/../../../../../usr/src/cmd/mdb/intel/mdb/kvm_amd64dep_freebsd.c -o kvm_amd64dep_freebsd.o
    error: unknown -Werror warning specifier: '-Wno-error-tautological-pointer-compare' [-Werror,-Wunknown-warning-option]
    *** [kvm_amd64dep_freebsd.o] Error code 1

    This is because for a while -Wno-error- options should be spelled as
    -Wno-error=, instead.

    Approved by:    maintainer timeout (2 weeks)
    PR:             255955
    MFH:            2021Q2

 devel/mdb/Makefile                       |  1 +
 devel/mdb/files/patch-mdb_Makefile (new) | 11 +++++++++++
 2 files changed, 12 insertions(+)