gcc-package-target.inc: add the symbol link /lib/cpp

When I was trying self-hosted-image, eglibc's do_install failed in the target:
ERROR: cannot stat bootparam_prot.h:
the cause is: rpcgen doesn't work properly: rpcgen can't exec /lib/cpp since
it doesn't exist.

According to http://tldp.org/LDP/Linux-Filesystem-Hierarchy/html/lib.html:
"if a C preprocessor is installed, /lib/cpp must be a reference to it, for
historical reasons. The usual placement of this binary is /usr/bin/cpp".

Typical distros, like Ubuntu, openSuSE, Fedora and RHEL, all comply with
the rule.

Actually in meta/recipes-devtools/gcc/gcc-package-target.inc, we do try to
package ${base_libdir}/cpp:
 FILES_cpp = "\
  ${bindir}/${TARGET_PREFIX}cpp \
  ${base_libdir}/cpp \
  ${libexecdir}/gcc/${TARGET_SYS}/${BINV}/cc1"
But unluckily we didn't create a symbol link in do_install.
This patch adds the symbol link.

(From OE-Core rev: 58fb9fbce2af05a469691390e75aebb2de16ca96)

Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Dexuan Cui 2011-11-16 17:49:44 +08:00 committed by Richard Purdie
parent c27a005ea9
commit 1cfd618493
2 changed files with 3 additions and 1 deletions

View File

@ -1,6 +1,6 @@
require gcc-common.inc
PR = "r17"
PR = "r18"
# Third digit in PV should be incremented after a minor release
# happens from this branch on gcc e.g. currently its 4.6.0

View File

@ -122,6 +122,8 @@ do_install () {
ln -sf ${TARGET_PREFIX}g++ g++
ln -sf ${TARGET_PREFIX}gcc gcc
ln -sf ${TARGET_PREFIX}cpp cpp
install -d ${D}${base_libdir}
ln -sf ${bindir}/${TARGET_PREFIX}cpp ${D}${base_libdir}/cpp
ln -sf g++ c++
ln -sf gcc cc