Bug 83738 - [modules] kldload hwpmc.ko fails with 'link_elf: symbol lapic undefined'.
Summary: [modules] kldload hwpmc.ko fails with 'link_elf: symbol lapic undefined'.
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: 6.0-BETA1
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-07-19 18:30 UTC by trasz
Modified: 2015-11-10 12:52 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description trasz 2005-07-19 18:30:11 UTC
      an attempt to 'kldload hwpmc.ko' fails with 'link_elf: symbol lapic undefined' on this hardware.  it's unsupported by hwpmc anyway (k6-2), but i guess it should fail in slightly more 'informative' way.
Comment 1 Joseph Koshy freebsd_committer freebsd_triage 2005-12-12 14:16:30 UTC
Responsible Changed
From-To: freebsd-bugs->jkoshy

Take ownership.
Comment 2 Joseph Koshy freebsd_committer freebsd_triage 2005-12-12 15:33:16 UTC
Do you have 'device apic' in your kernel config?

We need a way to communicate the configuration options for a kernel
to the modules being built for it.  If this were possible we could
avoid compiling the code that uses the local apic when the base
kernel doesn't have APIC support enabled.
Comment 3 freebsd 2005-12-28 18:18:52 UTC
Building a kernel 6.0-RELEASE with PMC and without APIC failed:
 
--------------------------------------------
linking kernel
hwpmc_x86.o(.text+0x5): In function `pmc_x86_lapic_enable_pmc_interrupt':
: undefined reference to `lapic'
hwpmc_x86.o(.text+0x206): In function `pmc_md_initialize':
: undefined reference to `lapic'
*** Error code 1
 
Stop in /usr/obj/usr/src/sys/KERNEL.
*** Error code 1
 
Stop in /usr/src.
*** Error code 1
 
Stop in /usr/src.
--------------------------------------------
 
So it seems look like APIC is mandatory for PMC... and this should be
mentioned in KERNEL file.
Comment 4 Joseph Koshy freebsd_committer freebsd_triage 2005-12-29 02:29:15 UTC
>  So it seems look like APIC is mandatory for PMC... and this should be
>  mentioned in KERNEL file.

I've added a mention to the 'NOTES' file that additional architecture specific
configuration options are documented in the hwpmc(4) manual page.

Regards,
Koshy
<jkoshy@freebsd.org>
Comment 5 Joseph Koshy freebsd_committer freebsd_triage 2006-01-05 03:08:48 UTC
State Changed
From-To: open->suspended

'sys/conf/NOTES' now warns that hwpmc may require additional 
architecture specific configuration options, and that these are 
documented in the hwpmc(4) manual page. 

I'm changing the state of the PR to 'suspended' till I find a way 
of compiling the hwpmc module to match the kernel it is going to 
run under.  I.e., if 'device apic' is missing in an i386 kernel 
configuration file then compiled hwpmc.ko should not refer to the 
'lapic' symbol (and therefore not support sampling either).
Comment 6 Mark Linimon freebsd_committer freebsd_triage 2013-07-03 01:50:32 UTC
State Changed
From-To: suspended->suspended

commit bit has been taken in for safekeeping. 


Comment 7 Mark Linimon freebsd_committer freebsd_triage 2013-07-03 01:50:32 UTC
Responsible Changed
From-To: jkoshy->freebsd-bugs
Comment 8 Enji Cooper freebsd_committer freebsd_triage 2015-11-10 12:52:29 UTC
The issue is noted in hwpmc(4) as well as NOTES. Closing old hwpmc bug.