From patchwork Fri Sep 24 00:40:02 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jack Howarth X-Patchwork-Id: 65610 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 19C0DB70E1 for ; Fri, 24 Sep 2010 10:40:12 +1000 (EST) Received: (qmail 20156 invoked by alias); 24 Sep 2010 00:40:10 -0000 Received: (qmail 20143 invoked by uid 22791); 24 Sep 2010 00:40:09 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL, BAYES_00, TW_CP, TW_RG, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from bromo.med.uc.edu (HELO bromo.med.uc.edu) (129.137.3.146) by sourceware.org (qpsmtpd/0.43rc1) with SMTP; Fri, 24 Sep 2010 00:40:04 +0000 Received: from bromo.med.uc.edu (localhost.localdomain [127.0.0.1]) by bromo.med.uc.edu (Postfix) with ESMTP id B7243B004B; Thu, 23 Sep 2010 20:40:02 -0400 (EDT) Received: (from howarth@localhost) by bromo.med.uc.edu (8.14.3/8.14.3/Submit) id o8O0e2Q0001081; Thu, 23 Sep 2010 20:40:02 -0400 Date: Thu, 23 Sep 2010 20:40:02 -0400 From: Jack Howarth To: gcc-patches@gcc.gnu.org Cc: dominiq@lps.ens.fr, mikestump@comcast.net, iains@gcc.gnu.org Subject: [PATCH] fix darwin bootstrap Message-ID: <20100924004002.GA1079@bromo.med.uc.edu> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.18 (2008-05-17) 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 The commit of r164532 broke the bootstrap on darwin in stage1 due to the incorrect passing to sizeof of a pointer to a struct rather than the struct itself. The attached patch corrects this error and restores the bootstrap on darwin. Bootstrap and regression tested on x86_64-apple-darwin10. Okay for gcc trunk? Jack 2010-09-23 Dominique Dhumieres Jack Howarth PR 45751/target * gcc/config/darwin-driver.c: Pass struct to sizeof. Index: gcc/config/darwin-driver.c =================================================================== --- gcc/config/darwin-driver.c (revision 164573) +++ gcc/config/darwin-driver.c (working copy) @@ -76,7 +76,7 @@ generate_option (OPT_mmacosx_version_min_, macosx_deployment_target, 1, CL_DRIVER, &(*decoded_options)[1]); memcpy (*decoded_options + 2, argv + 1, - (argc - 1) * sizeof (struct cl_decoded_option *)); + (argc - 1) * sizeof (struct cl_decoded_option)); return; } } @@ -128,7 +128,7 @@ generate_option (OPT_mmacosx_version_min_, new_flag, 1, CL_DRIVER, &(*decoded_options)[1]); memcpy (*decoded_options + 2, argv + 1, - (argc - 1) * sizeof (struct cl_decoded_option *)); + (argc - 1) * sizeof (struct cl_decoded_option)); return; parse_failed: