From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 122688 invoked by alias); 13 Aug 2015 21:58:36 -0000 Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org Received: (qmail 122674 invoked by uid 89); 13 Aug 2015 21:58:36 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.4 required=5.0 tests=AWL,BAYES_00,KAM_LAZY_DOMAIN_SECURITY,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=no version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Thu, 13 Aug 2015 21:58:35 +0000 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (Postfix) with ESMTPS id D767A8E3CC; Thu, 13 Aug 2015 21:58:33 +0000 (UTC) Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t7DLwWGS026978; Thu, 13 Aug 2015 17:58:33 -0400 Message-ID: <55CD1308.3020602@redhat.com> Date: Thu, 13 Aug 2015 21:58:00 -0000 From: Pedro Alves User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 MIME-Version: 1.0 To: Ran Shalit , gdb Subject: Re: gdbserver - manually modify Makefile References: In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-SW-Source: 2015-08/txt/msg00027.txt.bz2 On 08/13/2015 09:50 PM, Ran Shalit wrote: > Hello, > > I've cross compile gdbserver according to wiki in: > https://sourceware.org/gdb/wiki/BuildingCrossGDBandGDBserver > ubuntu@ubuntu-laptop:~/gdb-7.9.1/gdb/gdbserver$ sudo ./configure > --host=powerpc-buildroot-linux-gnu --disable-werror You should not need sudo, nor --disable-werror. > > But on doing : > make > I've noticed that it uses the host gcc instead of the cross-compiler gcc. > Only after manually modifying the Makefie with > CC = powerpc-buildroot-linux-gnu-gcc > instead of > CC = gcc > It was cross compiling as expected. > Open the config.log file in the build directory, and look for something that looks like this: configure:2558: checking for powerpc-buildroot-linux-gnu-gcc The following lines should look something like this: configure:2574: found /path/to/whatever/bin/powerpc-buildroot-linux-gnu-gcc configure:2585: result: powerpc-buildroot-linux-gnu-gcc configure:2854: checking for C compiler version configure:2863: powerpc-buildroot-linux-gnu-gcc --version >&5 But in your case, "result" is probably "gcc". If configure doesn't find $host-gcc, then it'll default to "gcc". Most likely, you don't have powerpc-buildroot-linux-gnu-gcc in the PATH. Make sure it is in the PATH, and that you can execute it (e.g., try $ powerpc-buildroot-linux-gnu-gcc -v), and start over. Let me know how it went. Thanks, Pedro Alves