From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca (simark.ca [158.69.221.121]) by sourceware.org (Postfix) with ESMTPS id 596523858D34 for ; Wed, 21 Feb 2024 16:45:08 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 596523858D34 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=simark.ca Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=simark.ca ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 596523858D34 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=158.69.221.121 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1708533910; cv=none; b=sQ1hm3j08BfdGvNC7TcDCnYFIlCszq9YdhjXw9z9sF3RWgyuPGFoKf+XY472Kejq9jWMNhfiLLBrLR0LcQsiZbC3RLujEy3Y2OSCh2nktrdfa21waKcyJ5cxDFHIPHi5vVo1SKLyzEtVqxhAOokXvX102ezlw7NV0hhv0Ymyad0= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1708533910; c=relaxed/simple; bh=9ACUpjJAtGzciHx+pIJNxyhooCjhFJ0KpGSys0ryMY0=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=Ja5yIXMAVCY4+aRZm5AZf71BSjUMkY1KbusKWCPNpqiYPY0ztcTxXOpk6v0sLod05r807H1AjUWjYti1ODKljTtss7jfIwzHyge9ZjEr+YxiYDB7zANUAiURjCjmeuisSl7Dp48bulVmOZwJQu7tOFmhxSiAO6c7GLyg7O9lEDY= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=simark.ca; s=mail; t=1708533907; bh=9ACUpjJAtGzciHx+pIJNxyhooCjhFJ0KpGSys0ryMY0=; h=Date:Subject:To:References:From:In-Reply-To:From; b=DFrIVvCMFkTxE9Y2zgPFwVXio62+RjvW9LFdG7sCNYLmva1NVibImZAwA+taNCaIE 5mXAvkG5mTyq1YnoYbYlqppTr34ztFZGHZgnSlSQJ3LCWHwa83/Gp4EQi/MchxeuAn SrOfGVxCFuVZ8tOrdgURjmwE6jvWvesxlgLBTI8s= Received: from [10.0.0.170] (modemcable238.237-201-24.mc.videotron.ca [24.201.237.238]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id 61C311E030; Wed, 21 Feb 2024 11:45:07 -0500 (EST) Message-ID: <3a99e7b3-d89b-4ecd-b5f8-e9eee3b63750@simark.ca> Date: Wed, 21 Feb 2024 11:45:06 -0500 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 1/2] gdb: remove some GCC version checks Content-Language: fr To: Pedro Alves , Simon Marchi , gdb-patches@sourceware.org References: <20240221021939.5213-1-simon.marchi@efficios.com> <376e43c3-80b2-4824-87e7-d8564dbb74aa@palves.net> From: Simon Marchi In-Reply-To: <376e43c3-80b2-4824-87e7-d8564dbb74aa@palves.net> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-10.7 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,SPF_HELO_PASS,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On 2/21/24 10:03, Pedro Alves wrote: > On 2024-02-21 02:19, Simon Marchi wrote: > >> >> diff --git a/gdb/nat/x86-gcc-cpuid.h b/gdb/nat/x86-gcc-cpuid.h >> index dfd12587d813..b2eda44a2294 100644 >> --- a/gdb/nat/x86-gcc-cpuid.h >> +++ b/gdb/nat/x86-gcc-cpuid.h >> @@ -195,7 +195,6 @@ __get_cpuid_max (unsigned int __ext, unsigned int *__sig) >> >> #ifndef __x86_64__ >> /* See if we can use cpuid. On AMD64 we always can. */ >> -#if __GNUC__ >= 3 >> __asm__ ("pushf{l|d}\n\t" >> "pushf{l|d}\n\t" >> "pop{l}\t%0\n\t" >> @@ -208,22 +207,6 @@ __get_cpuid_max (unsigned int __ext, unsigned int *__sig) >> "popf{l|d}\n\t" >> : "=&r" (__eax), "=&r" (__ebx) >> : "i" (0x00200000)); >> -#else >> -/* Host GCCs older than 3.0 weren't supporting Intel asm syntax >> - nor alternatives in i386 code. */ >> - __asm__ ("pushfl\n\t" >> - "pushfl\n\t" >> - "popl\t%0\n\t" >> - "movl\t%0, %1\n\t" >> - "xorl\t%2, %0\n\t" >> - "pushl\t%0\n\t" >> - "popfl\n\t" >> - "pushfl\n\t" >> - "popl\t%0\n\t" >> - "popfl\n\t" >> - : "=&r" (__eax), "=&r" (__ebx) >> - : "i" (0x00200000)); >> -#endif >> >> if (!((__eax ^ __ebx) & 0x00200000)) >> return 0; > > It would be better IMO to avoid local changes to this file, especially if they're not > really needed: > > /* > * Helper cpuid.h file copied from gcc-6.0.0. Code in gdb should not > ^^^^^^^^^^^^^^^^^^^^^ > * include this directly, but pull in x86-cpuid.h and use that func. > */ > > At some point, someone may want to pull a newer version from GCC, and local changes > just make that a little more difficult. I didn't realize this was copied from gcc, despite having "gcc" in the name. I'll remove this bit from v2. >> diff --git a/gdbserver/tracepoint.h b/gdbserver/tracepoint.h >> index 8b232324d2ec..6369e91aa276 100644 >> --- a/gdbserver/tracepoint.h >> +++ b/gdbserver/tracepoint.h >> @@ -38,11 +38,7 @@ void initialize_tracepoint (void); >> #if defined _WIN32 || defined __CYGWIN__ >> # define EXPORTED_SYMBOL __declspec (dllexport) >> #else >> -# if __GNUC__ >= 4 >> # define EXPORTED_SYMBOL __attribute__ ((visibility ("default"))) > > That "# define" line should be "reindented". Done. Simon