From patchwork Wed Aug 21 19:21:32 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Alexander Ivchenko X-Patchwork-Id: 268890 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]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "localhost", Issuer "www.qmailtoaster.com" (not verified)) by ozlabs.org (Postfix) with ESMTPS id 682362C00D1 for ; Thu, 22 Aug 2013 05:21:43 +1000 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :mime-version:in-reply-to:references:date:message-id:subject :from:to:cc:content-type:content-transfer-encoding; q=dns; s= default; b=ysSCiYem1WDly4bFIZJoTdmVibq5Zd5dQKpTYp1VST0HFkZpbEN3q AVYk9B1JQFzysnX/wtwwytsIo/g/QXWsPKO3Qd47aE37J0smaAMQrOSdUdaRz7z4 dcOhylxXqpS30FhrUtmL6TvEyxlw5uFY+AbygXvB/mIKdRn0/NhIlM= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :mime-version:in-reply-to:references:date:message-id:subject :from:to:cc:content-type:content-transfer-encoding; s=default; bh=7BSEX4OWjwITcuRCVbxMMxKYd4o=; b=UfUsKUmlB5XKyA/XX1haqEyrLSu/ xklEYOzGas6xCn7fQEyAu49MDTaIttEKXNNTKqrnRIXU7NKOH7s2H0LyLZG7FiEY ZAmN7MkyaLgq1kDf+BRBDsYvMnTdalcA4XnnQiFc61SVnEllFoo1pmzYfyuHTrvv 47s9ImRPuvNbmKs= Received: (qmail 10788 invoked by alias); 21 Aug 2013 19:21:35 -0000 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 Received: (qmail 10773 invoked by uid 89); 21 Aug 2013 19:21:35 -0000 X-Spam-SWARE-Status: No, score=-3.4 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, KHOP_THREADED, RCVD_IN_DNSWL_LOW, RCVD_IN_HOSTKARMA_YE, SPF_PASS autolearn=ham version=3.3.2 Received: from mail-pa0-f43.google.com (HELO mail-pa0-f43.google.com) (209.85.220.43) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Wed, 21 Aug 2013 19:21:34 +0000 Received: by mail-pa0-f43.google.com with SMTP id hz10so1163913pad.2 for ; Wed, 21 Aug 2013 12:21:32 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.66.161.38 with SMTP id xp6mr1274904pab.145.1377112892425; Wed, 21 Aug 2013 12:21:32 -0700 (PDT) Received: by 10.68.26.130 with HTTP; Wed, 21 Aug 2013 12:21:32 -0700 (PDT) In-Reply-To: References: Date: Wed, 21 Aug 2013 23:21:32 +0400 Message-ID: Subject: Re: [PATCH] Enable non-complex math builtins from C99 for Bionic From: Alexander Ivchenko To: Rainer Orth Cc: "Joseph S. Myers" , GCC Patches Hi, there are still a couple of problems with my patch: The build is broken for the following targets: 1) *linux* targets that do not include config/linux.h in their tm.h (e.g alpha-linux, ppc64-linux etc). For them we have: ../../../../gcc/gcc/config/linux-android.c: In function ‘bool linux_android_libc_has_function(function_class)’: ../../../../gcc/gcc/config/linux-android.c:40:7: error: ‘OPTION_BIONIC’ was not declared in this scope if (OPTION_BIONIC) ^ make[2]: *** [linux-android.o] Error 1 This is adressed in the changes of config/linux-android.c: linux_libc, LIBC_GLIBC and LIBC_BIONIC seem to be declared for all *linux* targets. 2) *uclinux* targets that include config/linux.h. For *uclinux* we do not use linux-protos.h, and therefore linux_android_libc_has_function is not declared there. I don't want to add aditional tmake_file, tm_p_file and extra_objs, so I added explicit define of TARGET_LIBC_HAS_FUNCTION as no_c99_libc_has_function for those targets. I'm sorry for that. The following patch cured my build of those targets; it is also preserving the initial presence of c99. There were plenty of targets that were changed by my patch, I hope this time I didn't miss anything. Is it ok? +#define TARGET_LIBC_HAS_FUNCTION no_c99_libc_has_function thanks, Alexander 2013/8/21 Rainer Orth : > Alexander Ivchenko writes: > >> Hi Joseph, thanks for your comments. >> >> I updated the patch: >> >> 1) The function name as a second argument in libc_has_function target >> hook was removed - was not usefull so far. >> 2) By using contrib/config-list.mk (thanks for the hint - great tool!) >> and analysing tm.h files and what is included in them I have checked >> 197 targets. That analysis includes all issues that you raised in your >> comments - everything is fixed now. I don't like that sometimes we >> have to redefine the version of the hook back to the default one due >> to a poisoning of including elfos.h, but I couldn't find a better >> solution - I commented all those cases. >> >> Regtesting is in progress now. I have already tested the patch before, >> so I don't expect to see any new problems. >> >> If all the tests pass, is the patch OK for trunk? > > Unfortunately, this patch broke Solaris 10+ bootstrap; it cannot have > been tested properly there: > > In file included from ./tm.h:27:0, > from /vol/gcc/src/hg/trunk/local/gcc/gencheck.c:23: > /vol/gcc/src/hg/trunk/local/gcc/config/sol2-10.h:21:4: error: "/*" within comment [-Werror=comment] > /* /* Solaris 10 has the float and long double forms of math functions. > ^ > cc1plus: all warnings being treated as errors > make[3]: *** [build/gencheck.o] Error 1 > > Fixed as follows; bootstrapped without regressions on > i386-pc-solaris2.10, installed on mainline. > > Rainer > > > 2013-08-21 Rainer Orth > > * config/sol2-10.h (TARGET_LIBC_HAS_FUNCTION): Don't nest > comment. > > > > -- > ----------------------------------------------------------------------------- > Rainer Orth, Center for Biotechnology, Bielefeld University > diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 6e27be2..02679f3 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,14 @@ +2013-08-21 Alexander Ivchenko + + * config/linux-android.c (linux_android_libc_has_function): Fix + checks for libc. + * config/bfin/uclinux.h: Define TARGET_LIBC_HAS_FUNCTION as + no_c99_libc_has_function. + * config/c6x/uclinux-elf.h: Ditto. + * config/lm32/uclinux-elf.h: Ditto. + * config/m68k/uclinux.h: Ditto. + * config/moxie/uclinux.h: Ditto. + 2013-08-21 Joern Rennecke * reload.h (struct reg_equivs): Rename to .. diff --git a/gcc/config/bfin/uclinux.h b/gcc/config/bfin/uclinux.h index ca0f4ee..63cba99 100644 --- a/gcc/config/bfin/uclinux.h +++ b/gcc/config/bfin/uclinux.h @@ -44,3 +44,6 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see #define TARGET_SUPPORTS_SYNC_CALLS 1 #define SUBTARGET_FDPIC_NOT_SUPPORTED + +#undef TARGET_LIBC_HAS_FUNCTION +#define TARGET_LIBC_HAS_FUNCTION no_c99_libc_has_function diff --git a/gcc/config/c6x/uclinux-elf.h b/gcc/config/c6x/uclinux-elf.h index 5d61f4d..fa0937e 100644 --- a/gcc/config/c6x/uclinux-elf.h +++ b/gcc/config/c6x/uclinux-elf.h @@ -62,3 +62,5 @@ : "0" (_beg), "b" (_end), "b" (_scno)); \ } +#undef TARGET_LIBC_HAS_FUNCTION +#define TARGET_LIBC_HAS_FUNCTION no_c99_libc_has_function diff --git a/gcc/config/linux-android.c b/gcc/config/linux-android.c index 4a4b48d..e9d9e9a 100644 --- a/gcc/config/linux-android.c +++ b/gcc/config/linux-android.c @@ -35,9 +35,9 @@ linux_android_has_ifunc_p (void) bool linux_android_libc_has_function (enum function_class fn_class) { - if (OPTION_GLIBC) + if (linux_libc == LIBC_GLIBC) return true; - if (OPTION_BIONIC) + if (linux_libc == LIBC_BIONIC) if (fn_class == function_c94 || fn_class == function_c99_misc || fn_class == function_sincos) diff --git a/gcc/config/lm32/uclinux-elf.h b/gcc/config/lm32/uclinux-elf.h index 3a556d7..a5e8163 100644 --- a/gcc/config/lm32/uclinux-elf.h +++ b/gcc/config/lm32/uclinux-elf.h @@ -77,3 +77,5 @@ #undef CC1_SPEC #define CC1_SPEC "%{G*} %{!fno-PIC:-fPIC}" +#undef TARGET_LIBC_HAS_FUNCTION +#define TARGET_LIBC_HAS_FUNCTION no_c99_libc_has_function diff --git a/gcc/config/m68k/uclinux.h b/gcc/config/m68k/uclinux.h index 8d74312..b1af7d2 100644 --- a/gcc/config/m68k/uclinux.h +++ b/gcc/config/m68k/uclinux.h @@ -67,3 +67,6 @@ along with GCC; see the file COPYING3. If not see sections. */ #undef M68K_OFFSETS_MUST_BE_WITHIN_SECTIONS_P #define M68K_OFFSETS_MUST_BE_WITHIN_SECTIONS_P 1 + +#undef TARGET_LIBC_HAS_FUNCTION +#define TARGET_LIBC_HAS_FUNCTION no_c99_libc_has_function diff --git a/gcc/config/moxie/uclinux.h b/gcc/config/moxie/uclinux.h index 498037e..85c65f2 100644 --- a/gcc/config/moxie/uclinux.h +++ b/gcc/config/moxie/uclinux.h @@ -37,3 +37,6 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --wrap=mmap --wrap=munmap --wrap=alloca\ %{fmudflapth: --wrap=pthread_create\ }} %{fmudflap|fmudflapth: --wrap=main}" + +#undef TARGET_LIBC_HAS_FUNCTION