# Kernel compile question

## dustfinger

When I compile my kernel using make && make modules_install I notice lines begining with CC and some begining with LD.  What is CC and LD?  I figure CC is the cc compiler.  I have never heard of LD.  I am a newbie so I appologize if I just asked a really stupid question.  The reason why I am wondering is because I have made changes in my kernel before and then recompiled it with very little of these lines showing up.  However I just added freq scaling and removed SMP and compiled and a whole ton of those lines appeared on the screen and it took quite a lot longer to compile the kernel.  I guess there was a lot of dependencies on the changes I made?

-- EDIT --

At the end of the compile I have.

if [ -r System.map ]; then /sbin/depmod -ae -F System.map  2.6.7-gentoo-r9; fi

WARNING: /lib/modules/2.6.7-gentoo-r9/misc/ndiswrapper.ko needs unknown symbol __per_cpu_offset

WARNING: /lib/modules/2.6.7-gentoo-r9/misc/ndiswrapper.ko needs unknown symbol __preempt_spin_lock

WARNING: /lib/modules/2.6.7-gentoo-r9/misc/ndiswrapper.ko needs unknown symbol del_timer_sync

WARNING: /lib/modules/2.6.7-gentoo-r9/video/nvidia.ko needs unknown symbol smp_call_function

WARNING: /lib/modules/2.6.7-gentoo-r9/video/nvidia.ko needs unknown symbol cpu_online_map

WARNING: /lib/modules/2.6.7-gentoo-r9/video/nvidia.ko needs unknown symbol __preempt_spin_lock

WARNING: /lib/modules/2.6.7-gentoo-r9/video/fglrx.ko needs unknown symbol smp_call_function

WARNING: /lib/modules/2.6.7-gentoo-r9/video/fglrx.ko needs unknown symbol __preempt_spin_lock

Now under Power Managment under CPU Frequency Scaling I enabled Intel Pentium 4 clock modulation.  I figured I should do this since I am running the Inspiron 5150 which uses a mobile Intel P4.  Did I make a mistake in doing this?

-----------

dustfinger

----------

## slycordinator

LD = dynamic linker

At least that's what I think it must be since this is the description of the ldconfig program:

ldconfig - configure dynamic linker run-time bindings

[taken from linux manpage]

Like when it says CC that means it's compiling something and when it says LD it's going into the linking phase.

----------

## dustfinger

Thanks slycordinator.  So I did ask a silly question.  My appologies.

I disabled the Intel Pentium 4 clock modulation option and recompiled with exactally the same warnings at the end.  I re-enabled it now.  does anyone know what these warnings mean?  Perhaps I must unmerge and then re-emerge my ndiswrapper, and fglrx.  I have no idea why nvidia.ko appears since I am using an ati radeon M9 graphics card.  When I ran emerge --search nvidia all 5 apps appeared as Not Installed.  Why would I be getting a warning about the nvidia.ko?  Should I just locate nvidia.ko and rm?

-- EDIT --

Okay I just decided to rm the nvidia.ko and that got rid of that warning.  so now I only have the following warnings:

if [ -r System.map ]; then /sbin/depmod -ae -F System.map  2.6.7-gentoo-r9; fi

WARNING: /lib/modules/2.6.7-gentoo-r9/misc/ndiswrapper.ko needs unknown symbol __per_cpu_offset

WARNING: /lib/modules/2.6.7-gentoo-r9/misc/ndiswrapper.ko needs unknown symbol __preempt_spin_lock

WARNING: /lib/modules/2.6.7-gentoo-r9/misc/ndiswrapper.ko needs unknown symbol del_timer_sync

WARNING: /lib/modules/2.6.7-gentoo-r9/video/fglrx.ko needs unknown symbol smp_call_function

WARNING: /lib/modules/2.6.7-gentoo-r9/video/fglrx.ko needs unknown symbol __preempt_spin_lock

-----------

dustfinger

----------

## cokey

why have you removed SMP if you have a hyperthreading processor?

----------

## mike4148

1. LD (ld) is just the standard linker. It only does static linking (i.e., linking at link time), though it can handle both regular objects (.o's and .a's, which are archives of .o's) and shared objects (dynamic libs; .so's). At runtime, the dynamic linker does the actual dynamic linking; it's called ld.so. The linux kernel itself doesn't use .so's (if it did, it would rely on a userspace application to run; if that were so, who would run the userspace application in the first place?).

2. Make sure that your /usr/src/linux symlink is pointing at the kernel you are building (just to be sure), and reemerge ndiswrapper and fglrx. Reboot your system, making sure that you are booting into the new kernel. If you have problems with ndiswrapper or fglrx, reemerge them. If that still doesn't fix the problem, verify once again that you are running the kernel you just built and that the /usr/src/linux symlink is pointing to its source tree.

----------

## dustfinger

Mike4148,

What generates the fglrx module?  I have recompiled the kernel and re emerged ati-drivers and re update-opengl -ati.  When I do a locate fglrx.ko it is nowhere to be found.  I deleted it earlier.  Don't ask!  

cokehabit,

I did not compile in SMP because I read here that  *Quote:*   

> acpi and smp cannot be run concurrently

  I have also read here that  *Quote:*   

> you really dont need to make an smp kernel, just change the makeopts option

 

However there is a lot of conflict on that thread as to whether or not SMP is required.  I was going to try it once one way and once the other.

-- EDIT --

I tried modprobe fglrx and that failed.

I try a locate fglrx.ko and it turns up nothing.  However, when I ls /lib/modules/<KERNEL>/video/

then I find the fglrx.ko

When I try /sbin/insmod /lib/modules/<KERNEL>/video/fglrx.ko

I get an error stating that it is an invalid module format.

Why does locate fglrx.ko not trun up anything?  Why is my module invalid?

By the way I also cannot lode my Broadcom ethernet driver.  It also says it is an invalid module format.  What has happend?

-----------

----------

## dustfinger

I changed my /etc/make.conf MAKEOPTS="-j3" back to MAKEOPTS="-J2" and rebuilt the kernel.  I then re emerged the ati drivers, re opengl-update ati, and re compiled and installed my broadcom drivers.  Now all my modules load again.  If I want to take advantage of Hyperthreading what steps do I need to take?  I know i need to change my MAKEOPTS from "-J2" to "-J3" because the number is suppose to be one more than the number of processors your system has.  However when I do this and compile my kernel then none of my modules will load.  Any ideas?

dustfinger.

----------

## slycordinator

MAKEOPTS="-J2" is wrong.  It's supposed to be a lowercase j.

----------

## dustfinger

slycordinator,

I actually do have it as lower case.  I mistakenly typed it out on the forum as cappital.  Oops.  I don't entirley understand the make.conf file.  To me it would seem that if I make a change in the make.conf and I want it to be applicable to my whole system I would have to re make everything?  For instance, if I change MAKEOPTS="-j2" which means I have 1 processor to MAKEOPTS="-j3" woudln't I have to re-make my kernel so that it can take advantage of the 2 processors.  Also if I want my applications to take advantage of that fact wouldn't I also have to re-make those applications?

dustfinger.

----------

## mike4148

The "-j" make option merely affects compile times. For example, MAKEOPTS="-j2" will result in faster emerges on a multiprocessor system than MAKEOPTS="". It affects all future emerges immediately, without requiring any rebuilds of anything.

Applications don't see multiple (physical or HT/logical) CPUs. Instead, they have to be developed to support some form of parallelism (multiple threads/multiple processes) in order for multiple CPUs to really give them a performance boost (in general, having multiple CPUs increases system responsiveness regardless). Basically, there's nothing you can do. Some apps will run faster while others run at the same speed. The latter will be particularly true of a single HT processor, as opposed to a multiprocessor box.

Enabling HT on your side is exclusively a kernel issue. Build it (SMP+HT scheduling support? I'm not sure precisely what the options are; search around) into your kernel, install the kernel (as usual), reboot, and enjoy. To make sure that it has been enabled, look at dmesg right after booting; the kernel is bound to dump some nice diagnostic messages about it.

----------

## dustfinger

Thank you for the reply mike4148.  According to Halanegri on this thread

 *Quote:*   

> 
> 
> Comments in /etc/make.conf suggest using the number of proccessors + 1, and since you have HT, your proccessor counts as two, so you use MAKEOPTS="-j3".
> 
> 

 

So now I am confused.  I am going to re-read through the gentoo installation guide and see what I can dig up there.  When I do enable SMP and SMT I still get the message in the dmesg that Hyperthreading is disabled.  So there must be something else I am missing or doing wrong.

dustfinger.

----------

## dustfinger

In the gentoo installation guide at this url it says:

 *Quote:*   

> 
> 
> MAKEOPTS
> 
> With MAKEOPTS you define how many parallel compilations should occur when you install a package. The suggested number is the number of CPUs in your system plus one.
> ...

 

So now I can see the point being made by both mike4148 and Halanegri.  Given that I have a coprocessor and not a full on dual processor will changing the MAKEOPTS="-j3" be a good idea?  Will it have a positive effect?

----------

## pjp

Moved from Installing Gentoo.

----------

