Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 3 Jul 2018 11:21:19 -0700
From:      Matthew Macy <mmacy@freebsd.org>
To:        Bryan Drewery <bdrewery@freebsd.org>
Cc:        src-committers <src-committers@freebsd.org>, svn-src-all@freebsd.org,  svn-src-head@freebsd.org
Subject:   Re: svn commit: r335880 - in head/sys: conf kern
Message-ID:  <CAPrugNqu5sPjTFh3aocK7U_tm3tYiD1zaMmxHn=yreic4LLVMQ@mail.gmail.com>
In-Reply-To: <a083202a-fca5-c0e9-a292-fdbff487404b@FreeBSD.org>
References:  <201807030250.w632o7Oa035010@repo.freebsd.org> <a083202a-fca5-c0e9-a292-fdbff487404b@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
What is the "correct" way to make sure that offset.inc is visible to modules?

On Tue, Jul 3, 2018 at 10:39 AM, Bryan Drewery <bdrewery@freebsd.org> wrote:
> On 7/2/2018 7:50 PM, Matt Macy wrote:
>> Author: mmacy
>> Date: Tue Jul  3 02:50:07 2018
>> New Revision: 335880
>> URL: https://svnweb.freebsd.org/changeset/base/335880
>>
>> Log:
>>   expose thread_lite definition to tied modules
>>
>> Modified:
>>   head/sys/conf/kmod.mk
>>   head/sys/kern/genoffset.sh
>>
>> Modified: head/sys/conf/kmod.mk
>> ==============================================================================
>> --- head/sys/conf/kmod.mk     Tue Jul  3 01:55:09 2018        (r335879)
>> +++ head/sys/conf/kmod.mk     Tue Jul  3 02:50:07 2018        (r335880)
>> @@ -463,9 +463,10 @@ acpi_quirks.h: ${SYSDIR}/tools/acpi_quirks2h.awk ${SYS
>>  .endif
>>
>>  .if !empty(SRCS:Massym.inc) || !empty(DPSRCS:Massym.inc)
>> -CLEANFILES+= assym.inc genassym.o
>> -DEPENDOBJS+= genassym.o
>> +CLEANFILES+= assym.inc genassym.o genoffset.o
>> +DEPENDOBJS+= genassym.o genoffset.o
>>  assym.inc: genassym.o
>> +offset.inc: genoffset.o
>>  .if defined(KERNBUILDDIR)
>>  genassym.o: opt_global.h
>>  .endif
>> @@ -475,6 +476,12 @@ genassym.o: ${SYSDIR}/${MACHINE}/${MACHINE}/genassym.c
>>  genassym.o: ${SRCS:Mopt_*.h}
>>       ${CC} -c ${CFLAGS:N-flto:N-fno-common} \
>>           ${SYSDIR}/${MACHINE}/${MACHINE}/genassym.c
>> +offset.inc: ${SYSDIR}/kern/genoffset.sh genoffset.o
>> +     sh ${SYSDIR}/kern/genoffset.sh genoffset.o > ${.TARGET}
>> +genoffset.o: ${SYSDIR}/${MACHINE}/${MACHINE}/genoffset.c
>> +genoffset.o: ${SRCS:Mopt_*.h}
>> +     ${CC} -c ${CFLAGS:N-flto:N-fno-common} \
>> +         ${SYSDIR}/${MACHINE}/${MACHINE}/genoffset.c
>
> Why is this using machine-specific genoffset.c but kern.post.mk uses the
> global genoffset.c?
>
> And what even generates the machine-specific genoffset.c file? I see no
> rule for it anywhere.
>
>>  .endif
>>
>>  .if defined(KERNBUILDDIR)
>>
>> Modified: head/sys/kern/genoffset.sh
>> ==============================================================================
>> --- head/sys/kern/genoffset.sh        Tue Jul  3 01:55:09 2018        (r335879)
>> +++ head/sys/kern/genoffset.sh        Tue Jul  3 02:50:07 2018        (r335880)
>> @@ -39,7 +39,7 @@ work()
>>  {
>>       echo "#ifndef _OFFSET_INC_"
>>       echo "#define _OFFSET_INC_"
>> -     echo "#if !defined(GENOFFSET) && !defined(KLD_MODULE)"
>> +     echo "#if !defined(GENOFFSET) && (!defined(KLD_MODULE) || defined(KLD_TIED))"
>>       ${NM:='nm'} ${NMFLAGS} "$1" | ${AWK:='awk'} '
>>       / C .*_datatype_*/ {
>>               type = substr($3, match($3, "_datatype_") + length("_datatype_"))
>>
>
>
> --
> Regards,
> Bryan Drewery
>



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