From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32485 invoked by alias); 8 Nov 2019 15:06:04 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 32449 invoked by uid 89); 8 Nov 2019 15:06:03 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_PASS autolearn=ham version=3.3.1 spammy=sk:gdb_cac X-HELO: us-smtp-delivery-1.mimecast.com Received: from us-smtp-1.mimecast.com (HELO us-smtp-delivery-1.mimecast.com) (205.139.110.61) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 08 Nov 2019 15:06:02 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1573225561; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=154rIeaPhLPOMNnEm8JLDxsfNkEGdb//8KG00M3g+pc=; b=QE1GFHHDn8L4we2BensS1aX2Fof0+0cMVkG5BOpuEjUUuRjX9aSgX2irkw76U5mE/jxvzz XnZNnD8PmplL6oUdVP9Wq6CjGhqT4W7G1A+AjuzVM9dKDhrBrktgLm5BvdmMzwMvZAc7jw 0T7s3f91SudkMEC5tyh39ou77J9cKpg= Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-352-J31SWiIYPgSsPnILUdCZTw-1; Fri, 08 Nov 2019 10:05:59 -0500 Received: by mail-wm1-f71.google.com with SMTP id 199so3201578wmb.0 for ; Fri, 08 Nov 2019 07:05:56 -0800 (PST) Return-Path: Received: from ?IPv6:2001:8a0:f913:f700:56ee:75ff:fe8d:232b? ([2001:8a0:f913:f700:56ee:75ff:fe8d:232b]) by smtp.gmail.com with ESMTPSA id n23sm5589063wmc.18.2019.11.08.07.05.54 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 08 Nov 2019 07:05:54 -0800 (PST) Subject: Re: [review] Add gdb_compile_openmp to lib/gdb.exp To: gnutoolchain-gerrit@osci.io, gdb-patches@sourceware.org References: <20191106230528.5EA0525B28@gnutoolchain-gerrit.osci.io> Cc: Simon Marchi , Tom Tromey From: Pedro Alves Message-ID: <93a8a303-2ff3-08a6-d736-28108c6b78f6@redhat.com> Date: Fri, 08 Nov 2019 15:06:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 MIME-Version: 1.0 In-Reply-To: <20191106230528.5EA0525B28@gnutoolchain-gerrit.osci.io> X-Mimecast-Spam-Score: 0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-SW-Source: 2019-11/txt/msg00233.txt.bz2 On 11/6/19 11:05 PM, Kevin Buettner (Code Review) wrote: > For "pthreads", I think that we want to call gdb_compile when=20 > making the .o files and gdb_compile_pthreads when making the executable.= =20 > If I make the change that you propose, then gdb_compile_pthreads is used > for both executables and objects. I suppose we could have different $func-like variables for compiling and linking. > I can still make this change if you want; but if I do this, I think that > I should also add some code to gdb_compile_pthreads so that it will > call gdb_compile (and also avoid printing the PASS message) when > $type is not "executable". Hmm, yes, pedantically we're supposed to compile .o files with -pthread als= o, not just when linking, as it may enable predefined #defines that are necess= ary for correct use of threads, like _REENTRANT, which used to be important for glibc, though it isn't nowadays, I believe. On a side note, it seems to me that better than calling gdb_compile_pthreads repeatedly, it'd be better if we called a gdb_caching_proc that probed which variant of -pthread, -lpthread, etc. is necessary and returned it, so that build_executable_from_specs would just append the option to the set of opti= ons. That would make gdb_compile_shlib_pthreads unnecessary, for example. In ge= neral these gdb_compile_foo functions been like a worse idea than options to me, = since they don't allow combinations. Thanks, Pedro Alves