From patchwork Sat May 21 12:22:17 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicola Pero X-Patchwork-Id: 96695 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 CF058B71B0 for ; Sat, 21 May 2011 22:22:46 +1000 (EST) Received: (qmail 2600 invoked by alias); 21 May 2011 12:22:36 -0000 Received: (qmail 2480 invoked by uid 22791); 21 May 2011 12:22:35 -0000 X-SWARE-Spam-Status: No, hits=-1.3 required=5.0 tests=AWL, BAYES_00, SARE_SUB_ENC_UTF8, TW_BJ, TW_GT, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from fencepost.gnu.org (HELO fencepost.gnu.org) (140.186.70.10) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sat, 21 May 2011 12:22:21 +0000 Received: from eggs.gnu.org ([140.186.70.92]:39247) by fencepost.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1QNlCG-0003FV-Kw for gcc-patches@gnu.org; Sat, 21 May 2011 08:22:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QNlCF-0006qg-Ci for gcc-patches@gnu.org; Sat, 21 May 2011 08:22:20 -0400 Received: from smtp191.iad.emailsrvr.com ([207.97.245.191]:44787) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QNlCF-0006qc-AY for gcc-patches@gnu.org; Sat, 21 May 2011 08:22:19 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp59.relay.iad1a.emailsrvr.com (SMTP Server) with ESMTP id 68CC43F039E; Sat, 21 May 2011 08:22:18 -0400 (EDT) Received: from dynamic10.wm-web.iad.mlsrvr.com (dynamic10.wm-web.iad1a.rsapps.net [192.168.2.217]) by smtp59.relay.iad1a.emailsrvr.com (SMTP Server) with ESMTP id DCB903F0187; Sat, 21 May 2011 08:22:17 -0400 (EDT) Received: from meta-innovation.com (localhost [127.0.0.1]) by dynamic10.wm-web.iad.mlsrvr.com (Postfix) with ESMTP id BDAD747880A8; Sat, 21 May 2011 08:22:17 -0400 (EDT) Received: by www2.webmail.us (Authenticated sender: nicola.pero@meta-innovation.com, from: nicola.pero@meta-innovation.com) with HTTP; Sat, 21 May 2011 14:22:17 +0200 (CEST) Date: Sat, 21 May 2011 14:22:17 +0200 (CEST) Subject: =?utf-8?Q?objc_patch_=28was_Re=3A_Problem_to_install_GCC_4.6.0_with_Objec?= =?utf-8?Q?tive-C_language=29?= From: "Nicola Pero" To: german@xelalug.org Cc: "Ian Lance Taylor" , "GCC" , "gcc-patches@gnu.org" MIME-Version: 1.0 X-Type: plain Message-ID: <1305980537.775713961@www2.webmail.us> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 207.97.245.191 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 >I get the error (this time the objc language is detected): > >/bin/bash ../../gcc-4.6.0/gcc/../move-if-change tmp-gi.list >gtyp-input.list >echo timestamp > s-gtyp-input >build/gengtype \ > -S ../../gcc-4.6.0/gcc -I gtyp-input.list -w >gtype.state >../../gcc-4.6.0/gcc/objc/objc-act.h:280: unidentified type >`objc_ivar_visibility_kind' > make[3]: *** [s-gtype] Error 1 Thanks German ... I could reproduce it. You found a bug! :-) Apologies for the bug, and thanks for sticking with us. ;-) (you can ignore the following, it's for gcc-patches@gnu.org) It's easy to reproduce the bug by simply deleting the gcc/cp directory from a GCC checkout, then trying to compile with the c,objc languages enabled. It fails with the error above, because gengtype then reads objc/objc-act.h before c-family/c-common-objc.h. The problem is in how the list of language-specific gtfiles is produced. It is produced in configure.ac, which: * will iterate over all the ${srcdir}/*/config-lang.in; * will source config-lang.in for all of them, regardless of whether they are enabled or not, and add $gtfiles to the list of gtfiles; * adds the C language last. As a consequence, GTFILES is different depending on whether ${srcdir}/gcc/cp/ exists or not. If it exists, usually the cp gtfiles come before the objc ones (due to alphabetical ordering by the shell, I'd guess ?), and the cp gtfiles contain c-family/c-common-objc.h, which is then processed before objc/objc-act.h. If it doesn't exist, that doesn't happen, and it stops working. :-( Here is a patch to fix it. It just moves c-family/c-objc.h at the beginning of the objc gtfiles list, to make it independent of cp's gtfiles list; with this, I can build c,objc with or without the gcc/cp directory. :-) Ok to commit ? Thanks PS: In my view this fix is a candidate for backporting to 4.6.x; without it, the gcc-objc-4.6.x tarballs are unusable. Index: ChangeLog =================================================================== --- ChangeLog (revision 173994) +++ ChangeLog (working copy) @@ -1,3 +1,9 @@ +2011-05-21 Nicola Pero + + * config-lang.in (gtfiles): Updated order of files to fix building + when the gcc/cp directory is missing, as in the case of some + release tarballs. + 2011-05-20 Nathan Froyd * objc-act.c (objc_compare_types): Use function_args_iterator Index: config-lang.in =================================================================== --- config-lang.in (revision 173994) +++ config-lang.in (working copy) @@ -33,4 +33,7 @@ # Most of the object files for cc1obj actually come from C. lang_requires="c" -gtfiles="\$(srcdir)/objc/objc-act.h \$(srcdir)/objc/objc-act.c \$(srcdir)/objc/objc-runtime-shared-support.c \$(srcdir)/objc/objc-gnu-runtime-abi-01.c \$(srcdir)/objc/objc-next-runtime-abi-01.c \$(srcdir)/objc/objc-next-runtime-abi-02.c \$(srcdir)/c-parser.c \$(srcdir)/c-tree.h \$(srcdir)/c-decl.c \$(srcdir)/c-lang.h \$(srcdir)/c-objc-common.c \$(srcdir)/c-family/c-common.c \$(srcdir)/c-family/c-common.h \$(srcdir)/c-family/c-objc.h \$(srcdir)/c-family/c-cppbuiltin.c \$(srcdir)/c-family/c-pragma.h \$(srcdir)/c-family/c-pragma.c" +# Order is important. If you change this list, make sure you test +# building without C++ as well; that is, remove the gcc/cp directory, +# and build with --enable-languages=c,objc. +gtfiles="\$(srcdir)/c-family/c-objc.h \$(srcdir)/objc/objc-act.h \$(srcdir)/objc/objc-act.c \$(srcdir)/objc/objc-runtime-shared-support.c \$(srcdir)/objc/objc-gnu-runtime-abi-01.c \$(srcdir)/objc/objc-next-runtime-abi-01.c \$(srcdir)/objc/objc-next-runtime-abi-02.c \$(srcdir)/c-parser.c \$(srcdir)/c-tree.h \$(srcdir)/c-decl.c \$(srcdir)/c-lang.h \$(srcdir)/c-objc-common.c \$(srcdir)/c-family/c-common.c \$(srcdir)/c-family/c-common.h \$(srcdir)/c-family/c-cppbuiltin.c \$(srcdir)/c-family/c-pragma.h \$(srcdir)/c-family/c-pragma.c"