From patchwork Thu Nov 13 22:14:40 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilya Verbin X-Patchwork-Id: 410623 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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 9D9B1140082 for ; Fri, 14 Nov 2014 09:15:02 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:subject:message-id:mime-version:content-type; q=dns; s= default; b=plZ+u/yF6Ctn1Pa5O2UK4ntbiFEi/EbWSl3+zMjVgwAXqfCgutzNw itcXqjrzy/A59Ip+Gc0IO3OmcuXueXL2bBkFmDALshvRp4KZ4LzvweSzfaz9PLsk L7HbRe2zb3HqUBgLnjVnvAZzgy6uTPqq4VBQlSGbROU3ehL3Gu/xAM= 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:date :from:to:subject:message-id:mime-version:content-type; s= default; bh=RakdGjhYrHUjZ7S5gg3nyHeVHcE=; b=v0gnCO8p1MZd/hYttawU bRHRQ+Z8T2G/Jj85RbCNWbJFArWHiAn58qU5fRu/j83EAGNgzS8993FACf1Peshm j1H6oX0LNK7XqyCp95wyPfu3IvRVvRRLaFVVCoMzbhriX5Dn78rUnYGUULjZBc92 ppnHceB19GU2Sv+CcVUp9Fo= Received: (qmail 31774 invoked by alias); 13 Nov 2014 22:14:55 -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 31765 invoked by uid 89); 13 Nov 2014 22:14:54 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.2 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-qa0-f43.google.com Received: from mail-qa0-f43.google.com (HELO mail-qa0-f43.google.com) (209.85.216.43) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Thu, 13 Nov 2014 22:14:53 +0000 Received: by mail-qa0-f43.google.com with SMTP id j7so10836533qaq.16 for ; Thu, 13 Nov 2014 14:14:51 -0800 (PST) X-Received: by 10.224.112.2 with SMTP id u2mr6503871qap.14.1415916891584; Thu, 13 Nov 2014 14:14:51 -0800 (PST) Received: from msticlxl57.ims.intel.com (fmdmzpr01-ext.fm.intel.com. [192.55.54.36]) by mx.google.com with ESMTPSA id r20sm11417244qad.5.2014.11.13.14.14.48 for (version=TLSv1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 13 Nov 2014 14:14:50 -0800 (PST) Date: Fri, 14 Nov 2014 01:14:40 +0300 From: Ilya Verbin To: gcc-patches@gcc.gnu.org, dominiq@lps.ens.fr Subject: [PATCH][COMMITTED] Fix PR63853 - Remove strchrnul to fix bootstrap on non-GNU platforms Message-ID: <20141113221440.GC28110@msticlxl57.ims.intel.com> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) X-IsSubscribed: yes Hi, I committed a patch from Dominique d'Humieres to restore bootsrap broken by our offloading patches. Thanks, -- Ilya 2014-11-13 Dominique Dhumieres PR bootstrap/63853 gcc/ * gcc.c (handle_foffload_option): Replace strchrnul with strchr. * lto-wrapper.c (parse_env_var, append_offload_options): Likewise. Index: gcc/gcc.c =================================================================== --- gcc/gcc.c (revision 217523) +++ gcc/gcc.c (working copy) @@ -3375,12 +3375,16 @@ if (arg[0] == '-') return; - end = strchrnul (arg, '='); + end = strchr (arg, '='); + if (end == NULL) + end = strchr (arg, '\0'); cur = arg; while (cur < end) { - next = strchrnul (cur, ','); + next = strchr (cur, ','); + if (next == NULL) + next = strchr (cur, '\0'); next = (next > end) ? end : next; target = XNEWVEC (char, next - cur + 1); @@ -3400,7 +3404,9 @@ c = OFFLOAD_TARGETS; while (c) { - n = strchrnul (c, ','); + n = strchr (c, ','); + if (n == NULL) + n = strchr (c, '\0'); if (strlen (target) == (size_t) (n - c) && strncmp (target, c, n - c) == 0) @@ -3421,7 +3427,9 @@ c = offload_targets; do { - n = strchrnul (c, ':'); + n = strchr (c, ':'); + if (n == NULL) + n = strchr (c, '\0'); if (strlen (target) == (size_t) (n - c) && strncmp (c, target, n - c) == 0) Index: gcc/lto-wrapper.c =================================================================== --- gcc/lto-wrapper.c (revision 217523) +++ gcc/lto-wrapper.c (working copy) @@ -424,7 +424,9 @@ values = (char**) xmalloc (num * sizeof (char*)); curval = str; - nextval = strchrnul (curval, ':'); + nextval = strchr (curval, ':'); + if (nextval == NULL) + nextval = strchr (curval, '\0'); int append_len = append ? strlen (append) : 0; for (i = 0; i < num; i++) @@ -436,7 +438,9 @@ if (append) strcat (values[i], append); curval = nextval + 1; - nextval = strchrnul (curval, ':'); + nextval = strchr (curval, ':'); + if (nextval == NULL) + nextval = strchr (curval, '\0'); } *pvalues = values; return num; @@ -581,7 +585,9 @@ while (cur < opts) { - next = strchrnul (cur, ','); + next = strchr (cur, ','); + if (next == NULL) + next = strchr (cur, '\0'); next = (next > opts) ? opts : next; if (strlen (target) == (size_t) (next - cur)