Bug 252865 - WITH_OFED_EXTRA build option fails with multiple errors
Summary: WITH_OFED_EXTRA build option fails with multiple errors
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Some People
Assignee: Kyle Evans
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-01-20 17:21 UTC by Michael Dexter
Modified: 2021-02-04 06:07 UTC (History)
2 users (show)

See Also:
kevans: mfc-stable13?
kevans: mfc-stable12-
kevans: mfc-stable11-


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Dexter 2021-01-20 17:21:48 UTC
The WITH_OFED_EXTRA build option is described in the src.conf manual page as:

Set to build the non-essential components of the "OpenFabrics
Enterprise Distribution" Infiniband software stack, mostly
examples.

These code examples might not be operable:

--- all_subdir_usr.bin ---
In file included from /usr/src/contrib/ofed/opensm/opensm/osm_console.c:59:
In file included from /usr/obj/usr/src/amd64.amd64/tmp//usr/include/infiniband/opensm/osm_console.h:37:
In file included from /usr/obj/usr/src/amd64.amd64/tmp//usr/include/infiniband/opensm/osm_opensm.h:53:
In file included from /usr/obj/usr/src/amd64.amd64/tmp//usr/include/infiniband/opensm/osm_console_io.h:43:
In file included from /usr/obj/usr/src/amd64.amd64/tmp//usr/include/infiniband/opensm/osm_subnet.h:51:
/usr/obj/usr/src/amd64.amd64/tmp//usr/include/infiniband/iba/ib_types.h:4387:18: error: cast from 'const unsigned char *' to 'void *' drops const qualifier [-
        return ((void *)p_smp->data);
                        ^
/usr/obj/usr/src/amd64.amd64/tmp//usr/include/infiniband/iba/ib_types.h:4491:18: error: cast from 'const unsigned char *' to 'void *' drops const qualifier [-
        return ((void *)p_sa_mad->data);
                        ^
--- all_subdir_usr.sbin ---
--- all_subdir_usr.sbin/tcpdump ---
--- all_subdir_usr.sbin/bhyve ---
--- all_subdir_usr.sbin/crunch ---
--- all_subdir_usr.bin ---
/usr/obj/usr/src/amd64.amd64/tmp//usr/include/infiniband/iba/ib_types.h:11480:18: error: cast from 'const unsigned char *' to 'void *' drops const qualifier [-Werror,-Wcast-qual]
        return ((void *)p_cc_mad->log_data);
                        ^
/usr/obj/usr/src/amd64.amd64/tmp//usr/include/infiniband/iba/ib_types.h:11508:18: error: cast from 'const unsigned char *' to 'void *' drops const qualifier [-Werror,-Wcast-qual]
        return ((void *)p_cc_mad->mgt_data);
                        ^
In file included from /usr/src/contrib/ofed/opensm/opensm/osm_console.c:59:
In file included from /usr/obj/usr/src/amd64.amd64/tmp//usr/include/infiniband/opensm/osm_console.h:37:
In file included from /usr/obj/usr/src/amd64.amd64/tmp//usr/include/infiniband/opensm/osm_opensm.h:53:
In file included from /usr/obj/usr/src/amd64.amd64/tmp//usr/include/infiniband/opensm/osm_console_io.h:43:
In file included from /usr/obj/usr/src/amd64.amd64/tmp//usr/include/infiniband/opensm/osm_subnet.h:54:
/usr/obj/usr/src/amd64.amd64/tmp//usr/include/infiniband/complib/cl_map.h:737:22: error: cast from 'const struct _cl_map_item *' to 'unsigned char *' drops const qualifier [-Werror,-Wcast-qual]
        return (cl_qmap_obj(PARENT_STRUCT(itor, cl_map_obj_t, item)));
                            ^
/usr/obj/usr/src/amd64.amd64/tmp//usr/include/infiniband/complib/cl_types.h:150:28: note: expanded from macro 'PARENT_STRUCT'
        ((PARENT_TYPE*)((uint8_t*)(p_member) - offsetof(PARENT_TYPE, MEMBER_NAME)))
                                  ^
In file included from /usr/src/contrib/ofed/opensm/opensm/osm_console.c:59:
In file included from /usr/obj/usr/src/amd64.amd64/tmp//usr/include/infiniband/opensm/osm_console.h:37:
In file included from /usr/obj/usr/src/amd64.amd64/tmp//usr/include/infiniband/opensm/osm_opensm.h:53:
In file included from /usr/obj/usr/src/amd64.amd64/tmp//usr/include/infiniband/opensm/osm_console_io.h:43:
In file included from /usr/obj/usr/src/amd64.amd64/tmp//usr/include/infiniband/opensm/osm_subnet.h:54:
/usr/obj/usr/src/amd64.amd64/tmp//usr/include/infiniband/complib/cl_map.h:737:22: error: cast from 'uint8_t *' (aka 'unsigned char *') to 'cl_map_obj_t *' (aka 'struct _cl_map_obj *') increases required alignment from 1 to 8 [-Werror,-Wcast-align]
        return (cl_qmap_obj(PARENT_STRUCT(itor, cl_map_obj_t, item)));
                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/obj/usr/src/amd64.amd64/tmp//usr/include/infiniband/complib/cl_types.h:150:3: note: expanded from macro 'PARENT_STRUCT'
        ((PARENT_TYPE*)((uint8_t*)(p_member) - offsetof(PARENT_TYPE, MEMBER_NAME)))
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/src/contrib/ofed/opensm/opensm/osm_console.c:59:
In file included from /usr/obj/usr/src/amd64.amd64/tmp//usr/include/infiniband/opensm/osm_console.h:37:
In file included from /usr/obj/usr/src/amd64.amd64/tmp//usr/include/infiniband/opensm/osm_opensm.h:53:
In file included from /usr/obj/usr/src/amd64.amd64/tmp//usr/include/infiniband/opensm/osm_console_io.h:43:
In file included from /usr/obj/usr/src/amd64.amd64/tmp//usr/include/infiniband/opensm/osm_subnet.h:56:
/usr/obj/usr/src/amd64.amd64/tmp//usr/include/infiniband/complib/cl_list.h:602:57: error: cast from 'const struct _cl_list_item *' to 'struct _cl_list_item *' drops const qualifier [-Werror,-Wcast-qual]
        cl_qlist_insert_next(&p_list->list, (cl_list_item_t *) iterator,
                                                               ^
/usr/obj/usr/src/amd64.amd64/tmp//usr/include/infiniband/complib/cl_list.h:655:57: error: cast from 'const struct _cl_list_item *' to 'struct _cl_list_item *' drops const qualifier [-Werror,-Wcast-qual]
        cl_qlist_insert_prev(&p_list->list, (cl_list_item_t *) iterator,
                                                               ^
/usr/obj/usr/src/amd64.amd64/tmp//usr/include/infiniband/complib/cl_list.h:706:18: error: cast from 'const void *' to 'void *' drops const qualifier [-Werror,-Wcast-qual]
        p_obj = (void *)p_pool_obj->p_object;
                        ^
/usr/obj/usr/src/amd64.amd64/tmp//usr/include/infiniband/complib/cl_list.h:754:18: error: cast from 'const void *' to '                                                               ^
/usr/obj/usr/src/amd64.amd64/tmp//usr/include/infiniband/complib/cl_list.h:706:18: error: cast from 'const void *' to 'void *' drops const qualifier [-Werror,
        p_obj = (void *)p_pool_obj->p_object;
                        ^
/usr/obj/usr/src/amd64.amd64/tmp//usr/include/infiniband/complib/cl_list.h:754:18: error: cast from 'const void *' to 'void *' drops const qualifier [-Werror,
        return ((void *)p_pool_obj->p_object);
                        ^
/usr/obj/usr/src/amd64.amd64/tmp//usr/include/infiniband/complib/cl_list.h:852:57: error: cast from 'const struct _cl_list_item *' to 'struct _cl_list_item *' drops const qualifier [-Werror,-Wcast-qual]
        cl_qlist_remove_item(&p_list->list, (cl_list_item_t *) iterator);
                                                               ^
/usr/obj/usr/src/amd64.amd64/tmp//usr/include/infiniband/complib/cl_list.h:855:59: error: cast from 'const struct _cl_list_item *' to 'struct _cl_pool_item *' drops const qualifier [-Werror,-Wcast-qual]
        cl_qpool_put(&p_list->list_item_pool, (cl_pool_item_t *) iterator);
                                                                 ^
/usr/obj/usr/src/amd64.amd64/tmp//usr/include/infiniband/complib/cl_list.h:1116:37: error: cast from 'const struct _cl_list_item *' to 'struct _cl_pool_obj *' drops const qualifier [-Werror,-Wcast-qual]
        return ((void *)((cl_pool_obj_t *) iterator)->p_object);
                                           ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
--- osm_congestion_control.o ---
20 errors generated.
*** [osm_congestion_control.o] Error code 1

make[5]: stopped in /usr/src/usr.bin/ofed/opensm
--- all_subdir_stand ---
--- all_subdir_stand/efi ---
--- all_subdir_usr.sbin ---
--- all_subdir_usr.sbin/wpa ---
--- all_subdir_usr.sbin/acpi ---
--- all_subdir_usr.bin ---
--- osm_console.o ---
20 errors generated.
*** [osm_console.o] Error code 1

make[5]: stopped in /usr/src/usr.bin/ofed/opensm
3 errors

make[5]: stopped in /usr/src/usr.bin/ofed/opensm
--- all_subdir_usr.sbin ---
--- all_subdir_usr.sbin/bluetooth ---
--- all_subdir_kerberos5 ---
--- all_subdir_usr.sbin ---
--- all_subdir_usr.sbin/pkg ---
--- all_subdir_usr.sbin/unbound ---
/usr/src/contrib/unbound/daemon/remote.c:566:12: warning: declaration shadows a local variable [-Wshadow]
--- all_subdir_libexec ---
--- all_subdir_rescue ---
13 warnings generated.
*** [vi_make] Error code 2
Comment 1 Michael Dexter 2021-01-23 23:10:48 UTC
Confirmed on FreeBSD 13.0-ALPHA2 built on 13.0-ALPHA2.

Full built output is linked from: https://callfortesting.org/results/bos-FreeBSD-13A1/
Comment 2 Michael Dexter 2021-01-24 01:11:01 UTC
Confirmed on FreeBSD 13.0-ALPHA2 built on 13.0-ALPHA2 with the dependency set in /etc/src.conf:

WITH_OFED=YES
WITH_OFED_EXTRA=YES
Comment 3 Michael Dexter 2021-01-24 22:11:53 UTC
From kib@: "Probably broken when WARNS was bumped for usr.bin and usr.sbin, no ETA on a fix."
Comment 4 Michael Dexter 2021-01-30 03:05:41 UTC
Confirmed on FreeBSD 13.0-ALPHA3 built on 13.0-ALPHA3.
Comment 5 Michael Dexter 2021-01-30 03:13:16 UTC
Updated Importance
Comment 6 commit-hook freebsd_committer 2021-01-30 05:52:50 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=9ca71db4959f674d75f7b4fd0f72bdc1e2e99abb

commit 9ca71db4959f674d75f7b4fd0f72bdc1e2e99abb
Author:     Kyle Evans <kevans@FreeBSD.org>
AuthorDate: 2021-01-30 05:48:28 +0000
Commit:     Kyle Evans <kevans@FreeBSD.org>
CommitDate: 2021-01-30 05:52:13 +0000

    ofed: fix the WITH_OFED_EXTRA build

    This option was not tested when WARNS was globally lifted in the src tree up
    to 6.  Drop WARNS back down to unbreak the build; note that this is still
    enabling more warnings than it had before the WARNS change, so the gcc build
    may need to be independently evaluated at this level.

    PR:             252865
    Reported-by:    Build Option Servey via Michael Dexter
    MFC-after:      3 days

 usr.bin/ofed/opensm/Makefile | 2 ++
 1 file changed, 2 insertions(+)
Comment 7 commit-hook freebsd_committer 2021-02-04 02:56:51 UTC
A commit in branch stable/13 references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=1535f6701704ef5bc58768490b05cbf0b0958671

commit 1535f6701704ef5bc58768490b05cbf0b0958671
Author:     Kyle Evans <kevans@FreeBSD.org>
AuthorDate: 2021-01-30 05:48:28 +0000
Commit:     Kyle Evans <kevans@FreeBSD.org>
CommitDate: 2021-02-04 02:55:56 +0000

    ofed: fix the WITH_OFED_EXTRA build

    This option was not tested when WARNS was globally lifted in the src tree up
    to 6.  Drop WARNS back down to unbreak the build; note that this is still
    enabling more warnings than it had before the WARNS change, so the gcc build
    may need to be independently evaluated at this level.

    PR:             252865

    (cherry picked from commit 9ca71db4959f674d75f7b4fd0f72bdc1e2e99abb)

 usr.bin/ofed/opensm/Makefile | 2 ++
 1 file changed, 2 insertions(+)
Comment 8 Michael Dexter 2021-02-04 06:07:49 UTC
Thank you!

Closing!