From 3c77bab2eeace3ee675bd745ca335fa3dd1630bb Mon Sep 17 00:00:00 2001 From: Thomas Petazzoni Date: Tue, 27 Jul 2010 16:25:15 +0200 Subject: Create /lib -> /lib symlink before installing cross gcc This commit solves bug #1051. The problem in this bug in that WebKit compiles a sample C program, which uses WebKit. As WebKit is written in C++, even though the program it built with CROSS-gcc, it must be linked with libstdc++. However, CROSS-gcc can't find the libstdc++ has it's hidden inside //lib. Therefore, this commit creates a symbolic link //lib -> /lib before running the CROSS-gcc installation. While this may look like a hack, this is the solution used by both Crosstool-NG and OpenWRT. Moreover, with this symbolic link in place, I think bug #1741 may also be solved. The problem in this bug is that the linker tries to link against /lib/libc.so.0. This is due to the fact that the linker finds a libc.so script file in the original toolchain location and not inside the copy of the toolchain sysroot in $(STAGING_DIR). As the script file is found outside of the current toolchain sysroot, ld considers the script has non-sysrooted, and therefore doesn't prefix all paths found in the script file (such as /lib/libc.so.0) with the sysroot path, leading to the failure. So, in details, this commit : * Adds a BR2_ARCH_IS_64 invisible config knob that is used to know if the arch is a 64 bits architecture or not. * Creates the //lib -> /lib symbolic link, and the //lib64 -> /lib64 symbolic link if needed. * Fixes the external toolchain sysroot detection code so that the 'sed' replacement is done *after* the readlink -f evaluation. I have tested this by building ARM, x86 and x86_64 toolchains with Buildroot, and then use these toolchains as external toolchains to build a full X.org/Gtk/WebKit/Midori stack. I have also done a complete ARM Buildroot internal toolchain build with the same full X.org/Gtk/WebKit/Midori stack. Signed-off-by: Thomas Petazzoni --- target/Config.in.arch | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'target/Config.in.arch') diff --git a/target/Config.in.arch b/target/Config.in.arch index 62721c9c6..3efebb86a 100644 --- a/target/Config.in.arch +++ b/target/Config.in.arch @@ -1,3 +1,6 @@ +config BR2_ARCH_IS_64 + bool + choice prompt "Target Architecture" default BR2_i386 @@ -38,8 +41,10 @@ config BR2_sparc bool "sparc" config BR2_sparc64 bool "sparc64" + select BR2_ARCH_IS_64 config BR2_x86_64 bool "x86_64" + select BR2_ARCH_IS_64 config BR2_xtensa bool "xtensa" endchoice -- cgit v1.2.3