Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 8 Mar 2011 10:19:30 -0500
From:      "J. Hellenthal" <jhell@DataIX.net>
To:        FreeBSD Stable <freebsd-stable@freebsd.org>
Subject:   Re: sys/x86/isa/clock.c:189: undefined reference to `cyclic_clock_func'
Message-ID:  <alpine.BSF.2.00.1103080947340.40738@qvfongpu.qngnvk.ybpny>
In-Reply-To: <alpine.BSF.2.00.1103080415520.58425@qvfongpu.qngnvk.ybpny>
References:  <alpine.BSF.2.00.1103080311520.13536@qvfongpu.qngnvk.ybpny> <alpine.BSF.2.00.1103080415520.58425@qvfongpu.qngnvk.ybpny>

next in thread | previous in thread | raw e-mail | index | archive | help
  This message is in MIME format.  The first part should be readable text,
  while the remaining parts are likely unreadable without MIME-aware tools.

--80310268-209080405-1299597590=:40738
Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1



On Tue, 8 Mar 2011 04:18, jhell@ wrote:
> On Tue, 8 Mar 2011 03:29, jhell@ wrote:
>> 
>> Hello Stable@,
>> 
>> Compiling a kernel on stable/8 with DTrace support is failing with the 
>> above
>> subject line upon linking kernel.debug.
>> 
>> The text leading up to this is:
>> ...
>> ctfconvert -L VERSION -g vers.o
>> linking kernel.debug
>> clock.o(.text+0x84c): In function `clkintr':
>> /usr/src/sys/x86/isa/clock.c:189: undefined reference to 
>> `cyclic_clock_func'
>> 
>> And upon inspection of clock.c:
>> #ifdef KDTRACE_HOOKS
>> #include <sys/dtrace_bsd.h>
>> #endif
>> 
>> And in clkintr():
>> #ifdef KDTRACE_HOOKS
>>        /*
>>         * If the DTrace hooks are configured and a callback function
>>         * has been registered, then call it to process the high speed
>>         * timers.
>>         */
>>        int cpu = PCPU_GET(cpuid);
>>        if (cyclic_clock_func[cpu] != NULL)
>>                (*cyclic_clock_func[cpu])(frame);
>> #endif
>> 
>> 
>> It seems for some odd reason that <sys/dtrace_bsd.h> is being forgotten 
>> when
>> it comes time for linking ? What is going on here ?
>> 
>> Id like to just remove the ifdef's for KDTRACE_HOOKS just to get the build 
>> to
>> finish but in the case that I want to build another kernel without dtrace I
>> would have to add them back. Anyone have a better fitting solution to this 
>> ?
>> 
>> Would it be just as good to re-ifdef this to ?WITH_CTF? instead.
>> 
>> Anyway... this is latest code from stable/8 on i386. And yes options
>> KDTRACE_HOOKS is in the kernel config.
>> 
>> And the command that caused all this:
>> ( make kernel WITH_CTF=1 )
>> 
>
> In light of this I decided to just remove the effected section of clock.c
> and move forward as this part of the kernel with DTrace is not what I am
> looking into.
>
> Attached is a small patch that removes it in case someone else comes
> across the same thing and needs a quick workaround.
>

To my best belief the cause is this i386 build is being done without 
"device apic" that includes I/O APIC (local_apic.c) which defines in a 
ifdef KDTRACE_HOOKS ( cyclic_clock_func_t cyclic_clock_func[MAXCPU]; ). 
Since the lack of I/O APIC being used, sys/x86/isa/clock.c needs its own 
definition of the same cyclic_clock_func, so I have added this in the same 
way that its implemented in local_apic.c to clock.c and the build succeeds 
and is usable.

Would it be best to just move cyclic_clock_func definition to dtrace_bsd.h 
instead ? and remove the definition in local_apic.c ?

Additional references: ( Thanks to rwatson@ )
http://fxr.watson.org/fxr/ident?v=FREEBSD8&i=cyclic_clock_func

Attached is the patch that solved this here but its just adding another 
definition that could probably be avoided by adding it somewhere else.

- -- 

  Regards,

  J. Hellenthal
  (0x89D8547E)
  JJH48-ARIN

-----BEGIN PGP SIGNATURE-----
Comment: THIS SOFTWARE AND/OR CONTENTS IS PROVIDED BY THE AUTHOR ``AS IS'' AND
Comment: ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
Comment: IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
Comment: PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
Comment: DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
Comment: DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
Comment: OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
Comment: HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
Comment: STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
Comment: IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
Comment: POSSIBILITY OF SUCH DAMAGE.

iQEcBAEBAgAGBQJNdkkMAAoJEJBXh4mJ2FR+8j4H/3qcymOBXvbMj2fqILJA/2xx
Xj+Og+INWT+3NAM95Ljeq375lLeV0h3FzXUKrHB+z/bQlY8NYdBdZHOtEUWl1ZvV
5W5RGAncSJq1cBU+EMOoGprvmwWaNIYIHJUUHSpSrJbhwdW53unP285ts4bqvk0I
eirtOitgmaiyOzBpJAIfDBBWU7RgQWCc/IFsm6GAU90JmjATy65kEeBtba6fNVcV
SlHqu5OmtuVN6eHEq/rf3Ai8jGktwvuS9Flgf4rM+u/tZTA1nC9cfo97Rbtek9TH
lQ/yZe9U7Wz4OFSdidMoY1nJN3CYisp3Kq+gqabsd3XDkJQQiXcBIIh61hnnjog=
=tC6l
-----END PGP SIGNATURE-----
--80310268-209080405-1299597590=:40738
Content-Type: TEXT/PLAIN; charset=US-ASCII; name=cyclic_clock_func_t.patch
Content-Transfer-Encoding: BASE64
Content-ID: <alpine.BSF.2.00.1103081019300.40738@qvfongpu.qngnvk.ybpny>
Content-Description: 
Content-Disposition: attachment; filename=cyclic_clock_func_t.patch

Y2hhbmdlc2V0OiAgIDk1Mjo1ZWI3ZGU4ZGNkYzANCmJyYW5jaDogICAgICBE
YXRhSVgNCnRhZzogICAgICAgICB0aXANCnVzZXI6ICAgICAgICBKLiBIZWxs
ZW50aGFsIDxqaGVsbEBEYXRhSVgubmV0Pg0KZGF0ZTogICAgICAgIFR1ZSBN
YXIgMDggMDg6MjA6MjggMjAxMSAtMDUwMA0Kc3VtbWFyeTogICAgIGN5Y2xp
Y19jbG9ja19mdW5jX3QgY3ljbGljX2Nsb2NrX2Z1bmNbTUFYQ1BVXTsgZGVm
aW5pdGlvbi4NCg0KZGlmZiAtciBlMWM4YTIwZWI0YjIgLXIgNWViN2RlOGRj
ZGMwIHN5cy94ODYvaXNhL2Nsb2NrLmMNCi0tLSBhL3N5cy94ODYvaXNhL2Ns
b2NrLmMJVHVlIE1hciAwOCAwODoxNjo1OSAyMDExIC0wNTAwDQorKysgYi9z
eXMveDg2L2lzYS9jbG9jay5jCVR1ZSBNYXIgMDggMDg6MjA6MjggMjAxMSAt
MDUwMA0KQEAgLTgyLDYgKzgyLDcgQEANCiANCiAjaWZkZWYgS0RUUkFDRV9I
T09LUw0KICNpbmNsdWRlIDxzeXMvZHRyYWNlX2JzZC5oPg0KK2N5Y2xpY19j
bG9ja19mdW5jX3QJY3ljbGljX2Nsb2NrX2Z1bmNbTUFYQ1BVXTsNCiAjZW5k
aWYNCiANCiAjZGVmaW5lCVRJTUVSX0RJVih4KSAoKGk4MjU0X2ZyZXEgKyAo
eCkgLyAyKSAvICh4KSkNCg0K

--80310268-209080405-1299597590=:40738--



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