[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#609961: linux-headers-2.6.32-5-common: scripts symlink breaks module compiling when /usr/src is symlink



Package: linux-headers-2.6.32-5-common
Version: 2.6.32-30
Severity: important

The kernel headers symlink the scripts directory to to ../../lib/linux-kbuild-2.6.32/scripts, 
however as I find /usr/src takes up a lot of space I move it to another location and symlink
/usr/src to that location.
This has been fine in previous versions of the headers, however in 2.6.32 doing this will break
the ablity to compile any additional modules (eg. lirc, nvidia, ndiswrapper...)

This is because when make compiles one of the modules, it changes to the physical directory
of /usr/src/linux-headers-2.6.32-5-686, and accessing ../../lib from there is not /usr/lib as
expected, so in most cases will produce at 'No such file or directory' error.

Because the execution of gcc-x86_32-has-stack-protector.sh fails, make produces the misleading
error: 'stack protector enabled but no compiler support', followed by an fatal error.

For example this is how my system is setup:
hookmyth# ls -ld /usr/src/linux-headers-2.6.32-5-common/* /usr/src /usr/lib/linux-kbuild-2.6.32/scripts \
                 /usr/src/linux-headers-2.6.32-5-common/scripts/
ls: cannot access /usr/src/linux-headers-2.6.32-5-common/scripts/: No such file or directory
drwxr-xr-x  6 root root  4096 Jan 15 00:15 /usr/lib/linux-kbuild-2.6.32/scripts
lrwxrwxrwx  1 root root    15 Oct 26 21:31 /usr/src -> /mnt/mythtv/src
drwxr-xr-x  3 root root    72 Jan 14 22:57 /usr/src/linux-headers-2.6.32-5-common/arch
drwxr-xr-x 20 root root   512 Jan 14 22:57 /usr/src/linux-headers-2.6.32-5-common/include
lrwxrwxrwx  1 root root    36 Jan 14 22:57 /usr/src/linux-headers-2.6.32-5-common/Kbuild -> ../../lib/linux-kbuild-2.6.32/Kbuild
-rw-r--r--  1 root root 55236 Jan 12 15:59 /usr/src/linux-headers-2.6.32-5-common/Makefile
lrwxrwxrwx  1 root root    37 Jan 14 22:57 /usr/src/linux-headers-2.6.32-5-common/scripts -> ../../lib/linux-kbuild-2.6.32/scripts

You can see the /usr/lib/linux-kbuild-2.6.32/scripts path exists, however when trying to access it as 
/usr/src/linux-headers-2.6.32-5-common/scripts/ it fails.

Heres a copy of a module-assistant output for lirc (also happens with nvidia and dkms)
-- 8<--
make[2]: Entering directory `/mnt/mythtv/src/modules/lirc-modules'           
/usr/bin/make -C /lib/modules/2.6.32-5-686/build                             
SUBDIRS=/usr/src/modules/lirc-modules modules                                
make[3]: Entering directory `/mnt/mythtv/src/linux-headers-2.6.32-5-686'     
/mnt/mythtv/src/linux-headers-2.6.32-5-common/Makefile:274:                  
/mnt/mythtv/src/linux-headers-2.6.32-5-common/scripts/Kbuild.include: No     
such file or directory                                                       
/bin/sh:                                                                     
/mnt/mythtv/src/linux-headers-2.6.32-5-common/scripts/gcc-x86_32-has-stack   
-protector.sh: No such file or directory                                     
/mnt/mythtv/src/linux-headers-2.6.32-5-common/arch/x86/Makefile:81: stack    
protector enabled but no compiler support                                    
make: *** empty variable name.  Stop.                                        
make[5]: *** [_module_/usr/src/modules/lirc-modules] Error 2                 
make[4]: *** [sub-make] Error 2    
-- 8<--


This output is from the version in unstable, however this was after multiple attempts
in testing were done - including the reinstall of all gcc packages in order to install
a compiler with stack protection.


There are two fixes for this (for anyone who stumbles across this error):
1. Fix the symlinks in /mnt/mythtv/src/linux-headers-2.6.32-5-common to be absoultly
     linked to /usr/lib not ../../lib. 
2. In the directory above the physical source directory add a symlink for lib back to 
     /usr/lib

-- System Information:
Debian Release: 6.0
  APT prefers testing
  APT policy: (500, 'testing'), (500, 'stable')
Architecture: i386 (i686)

Kernel: Linux 2.6.32-5-686 (SMP w/2 CPU cores)
Locale: LANG=en_NZ.UTF-8, LC_CTYPE=en_NZ.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

-- no debconf information



Reply to: