On 02/07/18 23:25, John Baldwin wrote:
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().


It can be fixed either way. Feel free to fix the SYSINIT KSHIM macros. You can test by running make in stand/usb/test .

--HPS
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to