From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18137 invoked by alias); 17 Oct 2011 11:21:10 -0000 Received: (qmail 18125 invoked by uid 22791); 17 Oct 2011 11:21:09 -0000 X-SWARE-Spam-Status: No, hits=-2.0 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from wmh1.mail.saunalahti.fi (HELO wmh1.mail.saunalahti.fi) (62.142.5.133) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 17 Oct 2011 11:20:50 +0000 Received: from [192.168.1.2] (dsl-kmibrasgw1-fe4ade00-105.dhcp.inet.fi [80.222.74.105]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: kai.ruottu@wippies.com) by wmh1.mail.saunalahti.fi (Postfix) with ESMTPSA id 04F481FC06C for ; Mon, 17 Oct 2011 14:20:48 +0300 (EEST) Message-ID: <4E9C0F88.3020109@wippies.com> Date: Mon, 17 Oct 2011 11:21:00 -0000 From: Kai Ruottu User-Agent: Mozilla/5.0 (Windows NT 5.0; rv:7.0.1) Gecko/20110929 Thunderbird/7.0.1 MIME-Version: 1.0 To: gcc-help@gcc.gnu.org Subject: Re: ld: cannot find -lc (Building gcc for Android toolchain) References: In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org X-SW-Source: 2011-10/txt/msg00150.txt.bz2 17.10.2011 13:41, Alexey Umnov kirjoitti: > Over the last few days I cannot succeed building an android toolchain. > > As far as I know the usual strategy of building toolchain is following: > 1. build binutils > 2. build 1st gcc > 3. build libc by means of 1st gcc > 4. build final gcc by means of 1st gcc Not at all! The usual strategy with already existing targets like with an installed Android is : 1. build binutils using '--with-sysroot=$sysroot' in configure 2. copy/install/unpack the target's own C library into the chosen $sysroot 3. build GCC using '--with-sysroot=$sysroot' in configure If the target's standard C library already exists, there is no sanity in trying to replace it with something self-made. With the traditional proprietary/custom targets like the Unices (Solaris, Ultrix, AIX, HP-UX, Irix,...) there were no sources for their C libraries and the custom Linux distros like Red Hat, SuSE, Debian always had their own patched glibc... Android is AFAIK quite a "custom" Linux and has its own patched C library, patched GUI libraries etc. Just use them with your own crosstoolchain, building only binutils and GCC for your cross-host! > > Binutils has been configured as follows: > ../configure --prefix=$PREFIX --target=$TARGET > , built fine and installed to $PREFIX The '--with-sysroot=$sysroot' to point to the target C libraries was forgotten! Please check that in this maillist is just now another thread for just your problem! What I wrote, was "how things should succeed" but the Android case seems to be harder, like giving : configure: error: No support for this host/target combination. make[1]: *** [configure-target-libstdc++-v3] Erreur 1 during the libstdc++-v3 configure for the target in gcc-4.6.1 sources :(