From patchwork Sun Jul 11 19:20:57 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxim Kuvyrkov X-Patchwork-Id: 58538 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id 22B141007D1 for ; Mon, 12 Jul 2010 05:21:10 +1000 (EST) Received: (qmail 24702 invoked by alias); 11 Jul 2010 19:21:08 -0000 Received: (qmail 24690 invoked by uid 22791); 11 Jul 2010 19:21:07 -0000 X-SWARE-Spam-Status: No, hits=-0.9 required=5.0 tests=AWL, BAYES_20, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (38.113.113.100) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sun, 11 Jul 2010 19:21:02 +0000 Received: (qmail 16636 invoked from network); 11 Jul 2010 19:21:00 -0000 Received: from unknown (HELO ?172.16.1.24?) (maxim@127.0.0.2) by mail.codesourcery.com with ESMTPA; 11 Jul 2010 19:21:00 -0000 Message-ID: <4C3A1999.7090801@codesourcery.com> Date: Sun, 11 Jul 2010 23:20:57 +0400 From: Maxim Kuvyrkov User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2.4) Gecko/20100608 Thunderbird/3.1 MIME-Version: 1.0 To: Anthony Green CC: gcc-patches Subject: Re: Problem configuring uclinux toolchain References: <4C370662.8050906@moxielogic.com> <4C374760.8070705@codesourcery.com> <4C378A3A.8070309@moxielogic.com> In-Reply-To: <4C378A3A.8070309@moxielogic.com> X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org [Moving from gcc@ to gcc-patches@] On 7/10/10 12:44 AM, Anthony Green wrote: > On 7/9/2010 11:59 AM, Maxim Kuvyrkov wrote: >> On 7/9/10 3:22 PM, Anthony Green wrote: >>> Hi Maxim, >>> >>> Recent changes to config.gcc are preventing me from building a >>> moxie-uclinux toolchain. The following patch should fix the build of moxie-uclinux toolchain. The problem was that the piece of config.gcc defining supported linux C libraries isn't executed for most uclinux targets, moxie included. Still, many uclinux targets includes linux.h and linux.opt, which yielded an error. The patch moves definitions of constants enumerating C libraries to top level and moves Android-specific definitions from LINUX_TARGET_OS_CPP_BUILTINS to ANDROID_TARGET_OS_CPP_BUILTINS. Tested with arm-linux-androideabi build and partial moxie-uclinux build. OK to apply? Index: gcc/config.gcc =================================================================== --- gcc/config.gcc (revision 162059) +++ gcc/config.gcc (working copy) @@ -405,6 +405,9 @@ case ${target} in ;; esac +# Common C libraries. There are mere constants. +tm_defines="$tm_defines LIBC_GLIBC=1 LIBC_UCLIBC=2 LIBC_BIONIC=3" + # Common parts for widely ported systems. case ${target} in *-*-darwin*) @@ -508,8 +511,6 @@ case ${target} in *-*-gnu*) tmake_file="$tmake_file t-gnu";; esac - # Common C libraries. - tm_defines="$tm_defines LIBC_GLIBC=1 LIBC_UCLIBC=2 LIBC_BIONIC=3" # glibc / uclibc / bionic switch. # uclibc and bionic aren't usable for GNU/Hurd and neither for GNU/k*BSD. case $target in Index: gcc/config/linux.h =================================================================== --- gcc/config/linux.h (revision 162059) +++ gcc/config/linux.h (working copy) @@ -96,8 +96,6 @@ see the files COPYING3 and COPYING.RUNTI builtin_assert ("system=linux"); \ builtin_assert ("system=unix"); \ builtin_assert ("system=posix"); \ - if (OPTION_ANDROID) \ - builtin_define ("__ANDROID__"); \ } while (0) #if defined(HAVE_LD_EH_FRAME_HDR) Index: gcc/config/linux-android.h =================================================================== --- gcc/config/linux-android.h (revision 162059) +++ gcc/config/linux-android.h (working copy) @@ -20,6 +20,12 @@ along with GCC; see the file COPYING3. If not see . */ +#define ANDROID_TARGET_OS_CPP_BUILTINS() \ + do { \ + if (OPTION_ANDROID) \ + builtin_define ("__ANDROID__"); \ + } while (0) + #if ANDROID_DEFAULT # define NOANDROID "mno-android" #else Index: gcc/config/arm/linux-eabi.h =================================================================== --- gcc/config/arm/linux-eabi.h (revision 162059) +++ gcc/config/arm/linux-eabi.h (working copy) @@ -27,6 +27,7 @@ { \ TARGET_BPABI_CPP_BUILTINS(); \ LINUX_TARGET_OS_CPP_BUILTINS(); \ + ANDROID_TARGET_OS_CPP_BUILTINS(); \ } \ while (false)