From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id IYb7HCNEVmMRABAAWB0awg (envelope-from ) for ; Mon, 24 Oct 2022 03:52:03 -0400 Received: by simark.ca (Postfix, from userid 112) id 648581E112; Mon, 24 Oct 2022 03:52:03 -0400 (EDT) Authentication-Results: simark.ca; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.a=rsa-sha256 header.s=default header.b=KSj4F+Nr; dkim-atps=neutral X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-3.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id EDB7B1E0CB for ; Mon, 24 Oct 2022 03:52:02 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 9D2353857BB3 for ; Mon, 24 Oct 2022 07:52:01 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9D2353857BB3 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1666597921; bh=GUW4p0YQLnrsZGbZ0WNlXtZXEIit5nulheMqgxQDKQ0=; h=Date:Subject:To:References:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=KSj4F+NrHdgq7L02SSaB9gbaQ4UQ9Worc+AwVc8TAAMJVOluX3PqTHN6V2+0DfSFL WYhyUwmSTz7p9g0Qtb774gm6Nx/ybmBLZEwD8wAD4aPl0jVledV9OAl0KJU1cqaOOR gPUJjc3YbJFRhqqZ8+fpDvYOZaIdPj+hK56UfFSQ= Received: from mail-sender-0.a4lg.com (mail-sender.a4lg.com [153.120.152.154]) by sourceware.org (Postfix) with ESMTPS id CB5DB38582A8 for ; Mon, 24 Oct 2022 07:51:04 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org CB5DB38582A8 Received: from [127.0.0.1] (localhost [127.0.0.1]) by mail-sender-0.a4lg.com (Postfix) with ESMTPSA id 9A7CF300089; Mon, 24 Oct 2022 07:51:02 +0000 (UTC) Message-ID: <2024f524-35e3-cdc6-8098-a220daf30c23@irq.a4lg.com> Date: Mon, 24 Oct 2022 16:51:00 +0900 Mime-Version: 1.0 Subject: Re: [PATCH] sim, sim/m32c, sim/rl78: Use getopt_long Content-Language: en-US To: Tom Tromey , gdb-patches@sourceware.org References: <3b7e769f-b5e9-4049-786f-d00d997f0280@irq.a4lg.com> <24e83e920d728237c4efe6f4720643d6fbbf1084.1666113214.git.research_trasio@irq.a4lg.com> <87sfjhb0r5.fsf@tromey.com> In-Reply-To: <87sfjhb0r5.fsf@tromey.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Tsukasa OI via Gdb-patches Reply-To: Tsukasa OI Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" On 2022/10/22 1:27, Tom Tromey wrote: >>>>>> Tsukasa OI via Gdb-patches writes: > >> Because of Binutils/GCC hack, getopt on GNU libc (2.25 or before) is >> currently unusable on sim, causing a regression on CentOS 7. Getting rid of >> include/getopt.h is the best solution to avoid hacking > > I don't think we want to do remove this file. getopt_long is required > by a bunch of programs in the tree, and is part of libiberty -- but it's > not in the traditional getopt.h. > > Using getopt_long seems like an improvement though. Glibc (2.25 or before; not too old to drop support) includes from but this causes to include Binutils/GCC's include/getopt.h. It means, using the filename "getopt.h" in an include path (-I) itself is a risk. The only reason it didn't cause a problem is most of Binutils/GCC components used getopt_long and getopt_long_only, not plain getopt. After I started checking getopt in sim/configure (to reduce build failure on Clang), it became a problem on sim because some sim files actually use plain getopt. c.f. Following thread under binutils > >> but as a short-term >> solution, this commit replaces calls to getopt to call getopt_long. > > I notice you didn't update sim/ppc... why is that? Because I simply missed that (I grepped "getopt (" and two occurrences under sim/ppc uses "getopt(" without space between "getopt" and "(" ). Thanks for spotting that and I'll fix it soon. Thanks, Tsukasa > If those don't have the problem then perhaps we can just use that > solution, whatever it is. > > Tom >