Monday, January 19, 2009

gcc linking error

Sympton:
/usr/lib/gcc/i586-suse-linux/4.1.2/../../../../i586-suse-linux/bin/ld: errno: TLS definition in /lib/libc.so.6 section .tbss mismatches non-TLS reference in \
/tmp/ccox5xu2.o
/lib/libc.so.6: could not read symbols: Bad value

Diagnosis:
Link error

Analysis:
/usr/include/unistd.h includes features.h which is using errno.h

So errno.h should be included.

Solution:
(Final)
#include before #include

(Temporary)
gcc -include /usr/include/errno.h code.c

Reference:
  1. http://www.robotercoding.com/blog/?p=36
  2. http://blog.chinaunix.net/u1/36607/showart_313647.html

Lab build

Ubuntu Hardy 8.04 LTS

Sun java
sudo apt-get install sun-java6-jdk - For the JDK (Developer)
sudo apt-get install sun-java6-jre - For the JRE (User)
sudo update-alternatives --config java

Acrobat Reader 8
sudo wget http://www.medibuntu.org/sources.list.d/hardy.list -O /etc/apt/sources.list.d/medibuntu.list
sudo apt-get update && sudo apt-get install medibuntu-keyring && sudo apt-get update
sudo apt-get install acroread

emacs
sudo apt-get install emacsx
smart-compile tag
/usr/share/emacs/site-lisp/smart-compile.el