Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 07 Feb 2018 14:25:14 -0800
From:      John Baldwin <jhb@freebsd.org>
To:        Hans Petter Selasky <hselasky@freebsd.org>
Cc:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   Re: svn commit: r328985 - head/sys/dev/usb/template
Message-ID:  <2147494.gDNdGGi869@ralph.baldwin.cx>
In-Reply-To: <201802071846.w17Ik894055491@repo.freebsd.org>
References:  <201802071846.w17Ik894055491@repo.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wednesday, February 07, 2018 06:46:08 PM Hans Petter Selasky wrote:
> Author: hselasky
> Date: Wed Feb  7 18:46:08 2018
> New Revision: 328985
> URL: https://svnweb.freebsd.org/changeset/base/328985
> 
> Log:
>   Give USB template SYSUNINIT()'s a uniq name to avoid symbol name collision
>   when building stand/usb. Regression after r328194.

This seems like a bug in the USB bits in stand instead.  In the kernel
SYSINIT and SYSUNINIT use separate namespace by appending different suffixes
to the first parameter:

        DATA_SET(sysinit_set,uniquifier ## _sys_init)

vs.

        DATA_SET(sysuninit_set,uniquifier ## _sys_uninit)

The bug is in stand/kshim/bsd_kernel.h:

#define SYSINIT(uniq, subs, order, _func, _data)        \
const struct sysinit UNIQ_NAME(sysinit_##uniq) = {      \
        .func = (_func),                                \
        .data = __DECONST(void *, _data)                \
};                                                      \
SYSINIT_ENTRY(uniq##_entry, "sysinit", (subs),          \
    (order), "const struct sysinit",                    \
    UNIQ_NAME_STR(sysinit_##uniq), "SYSINIT")

#define SYSUNINIT(uniq, subs, order, _func, _data)      \
const struct sysinit UNIQ_NAME(sysuninit_##uniq) = {    \
        .func = (_func),                                \
        .data = __DECONST(void *, _data)                \
};                                                      \
SYSINIT_ENTRY(uniq##_entry, "sysuninit", (subs),        \
    (order), "const struct sysuninit",                  \
    UNIQ_NAME_STR(sysuninit_##uniq), "SYSUNINIT")

This should be using uniq##_uninit_entry or some such for the first argument
to SYSINIT_ENTRY().

-- 
John Baldwin



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?2147494.gDNdGGi869>