From patchwork Mon Aug 5 08:18:48 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Thomas Schwinge X-Patchwork-Id: 1968949 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.a=rsa-sha256 header.s=20230601 header.b=uNoQbBht; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=server2.sourceware.org; envelope-from=gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Wcq9n1g8dz1yZl for ; Mon, 5 Aug 2024 18:19:57 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id A6DFB385C6C8 for ; Mon, 5 Aug 2024 08:19:54 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-ed1-x52a.google.com (mail-ed1-x52a.google.com [IPv6:2a00:1450:4864:20::52a]) by sourceware.org (Postfix) with ESMTPS id A25943858428 for ; Mon, 5 Aug 2024 08:18:54 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org A25943858428 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=baylibre.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org A25943858428 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::52a ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1722845951; cv=none; b=NUnLkaA+WVZ5EcHR8feRMq8+gH3YItnobRcVe3KX9xA5wJlCjfCZMIsuYzOMwPMh24WMSWlkHT0vbUra8l25DOioRojQAhx7t9FuxLK1rXcvOX/v3fSBTIuj4TMMTq8bHM2IB9X2CcHZdgi0V7SSUI5+rUaZUwT8bD1sVf2ZX+s= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1722845951; c=relaxed/simple; bh=Hcs68Abx33e26YB2VhekHil3E5boFxD+KO0c9FwxbhI=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=SSfsAQLXqzY6Wmqx2CPDgj4ZOb4yzmP+6O9Aa+OXXtqhrAy0pfNaZpAz+WxN1RAHvf0mnq/e39NtctKaWaT6nIEWeacj8VjBD9MKaPvqMflApsLRtlourjEOUs6wUd/VapxauEMbO24SQqYq1/Edh+pvZzLfNW2aFkrKl81FETk= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-ed1-x52a.google.com with SMTP id 4fb4d7f45d1cf-5b8c2a611adso2869027a12.1 for ; Mon, 05 Aug 2024 01:18:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1722845933; x=1723450733; darn=gcc.gnu.org; h=mime-version:message-id:date:user-agent:references:in-reply-to :subject:to:from:from:to:cc:subject:date:message-id:reply-to; bh=n1pjOVwoy4QRzwo4sWMTxzr3WIEiwTlT78nnZl0pt0E=; b=uNoQbBhtag05UL+uKjsPH1JcomU1MmHjcKUV7dP2kn6uBNlinXMIRplcbSnNvi14Ut RfLiZJwqcftQtAQGRW4Iz9J6SgzzGVHmD/T3B3ETUJMplxMibhYhQ2VnrnxoXFPNqE0p e/65E67Kx53nOnUVPiSX/AuGld+HiZ3FLKbPmOF3KAK7cexlqZc3X9gjsdmxT3TJsmGx 5xgHCbXXK8+6BMemBpr6cQ+BbhXz8/DcskWu+IIPoyu6Qc8ysH9aRxcHGpHXdXWW2gcF aWI1L3NIGUvR3NMTZ+uTRjGA3y0VvyVhgUnkZAsgmcZJ8l9VC10SUvYTvIFzi/npCBzH vWWQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722845933; x=1723450733; h=mime-version:message-id:date:user-agent:references:in-reply-to :subject:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=n1pjOVwoy4QRzwo4sWMTxzr3WIEiwTlT78nnZl0pt0E=; b=J/2edN2f73p6ZbbAulfj08HY38r/83HbmDh/EfZ+WivI+xJoFKytRKTu6kp7FY/IRX fXncThV01M/chNmeP9tY1qXB+QntSpSkfxpHcTdWSg1Bn6KRQE7U1RD9r1tyf1wWEgXU ET97Pclz9kWkWIWQ0aUjaLeR1D25vVUUgzVek3I2F5iDtDXKl6u9xiCJnQsBPXRimIif EKZzj7AOw+Gl3GTS7PDHzDM8C1SWxFHsOH11qTGODcshLaepTBpgUR0fCcfkMtsA9xTf w2k3IfkzNcJCPaoKzr0T0OEmxfeJpf3fd8Z5nnuge5lRvepXjRre539vKN5mqveqLTJq pCVg== X-Forwarded-Encrypted: i=1; AJvYcCVkcJJArAgx5+91uE3Iqzvg4691qhJYnN8jy9T63mmW7godiU2NLCRUt10K2ydLUM+athVIY8DJNETiLdQaqs425GBgCK3GpQ== X-Gm-Message-State: AOJu0YzdFNi/d0hKpw9+f7morD7/mcP694RIpPMyAQhNvSnU+DwOcvn6 9YQHcT/E3Jc75KjsAmSZzRLJcLZ24eY3d9AEsBwZIy00wD9zmDy+zytOfoeIuKA= X-Google-Smtp-Source: AGHT+IE7aETmaLXIY9hs/FdENpXJ5agkaNlAFNmpIkOHnfLzRbKtmOWrezdXMl00fshXVER5Be/MrQ== X-Received: by 2002:aa7:c692:0:b0:5a1:bda1:3e23 with SMTP id 4fb4d7f45d1cf-5b7f3cc7435mr7113197a12.14.1722845932879; Mon, 05 Aug 2024 01:18:52 -0700 (PDT) Received: from euler.schwinge.ddns.net (p200300c8b733b9005e8fc6f38b6af531.dip0.t-ipconnect.de. [2003:c8:b733:b900:5e8f:c6f3:8b6a:f531]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5b83bf3ad38sm4603966a12.84.2024.08.05.01.18.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 05 Aug 2024 01:18:52 -0700 (PDT) From: Thomas Schwinge To: Arthur Cohen , gcc-patches@gcc.gnu.org, gcc-rust@gcc.gnu.org Subject: Don't override 'LIBS' if '--enable-languages=rust'; use 'CRAB1_LIBS' (was: [PATCH 005/125] gccrs: libgrust: Add format_parser library) In-Reply-To: <20240801145809.366388-7-arthur.cohen@embecosm.com> References: <20240801145809.366388-2-arthur.cohen@embecosm.com> <20240801145809.366388-7-arthur.cohen@embecosm.com> User-Agent: Notmuch/0.30+8~g47a4bad (https://notmuchmail.org) Emacs/29.4 (x86_64-pc-linux-gnu) Date: Mon, 05 Aug 2024 10:18:48 +0200 Message-ID: <87o767mlg7.fsf@euler.schwinge.ddns.net> MIME-Version: 1.0 X-Spam-Status: No, score=-11.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org Hi! On 2024-08-01T16:56:01+0200, Arthur Cohen wrote: > Compile libformat_parser and link to it. > --- a/gcc/rust/Make-lang.in > +++ b/gcc/rust/Make-lang.in > +LIBS += -ldl -lpthread That's still not correct. I've pushed to trunk branch commit 816c4de4d062c89f5b7a68f68f29b2b033f5b136 "Don't override 'LIBS' if '--enable-languages=rust'; use 'CRAB1_LIBS'", see attached. Grüße Thomas From 816c4de4d062c89f5b7a68f68f29b2b033f5b136 Mon Sep 17 00:00:00 2001 From: Thomas Schwinge Date: Mon, 5 Aug 2024 10:06:05 +0200 Subject: [PATCH] Don't override 'LIBS' if '--enable-languages=rust'; use 'CRAB1_LIBS' Recent commit 6fef4d6ffcab0fec8518adcb05458cba5dbeac25 "gccrs: libgrust: Add format_parser library", added a general override of 'LIBS += -ldl -lpthread' if '--enable-languages=rust'. This is wrong conceptually, and will make the build fail on systems not providing such libraries. Instead, 'CRAB1_LIBS', added a while ago in commit 75299e4fe50aa8d9b3ff529e48db4ed246083e64 "rust: Do not link with libdl and libpthread unconditionally", should be used, and not generally, but for 'crab1' only. gcc/rust/ * Make-lang.in (LIBS): Don't override. (crab1$(exeext):): Use 'CRAB1_LIBS'. --- gcc/rust/Make-lang.in | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/gcc/rust/Make-lang.in b/gcc/rust/Make-lang.in index 24229c02770..c3be5f9d81b 100644 --- a/gcc/rust/Make-lang.in +++ b/gcc/rust/Make-lang.in @@ -54,8 +54,6 @@ GCCRS_D_OBJS = \ rust/rustspec.o \ $(END) -LIBS += -ldl -lpthread - gccrs$(exeext): $(GCCRS_D_OBJS) $(EXTRA_GCC_OBJS) libcommon-target.a $(LIBDEPS) +$(LINKER) $(ALL_LINKERFLAGS) $(LDFLAGS) -o $@ \ $(GCCRS_D_OBJS) $(EXTRA_GCC_OBJS) libcommon-target.a \ @@ -237,7 +235,7 @@ RUST_LIBDEPS = $(LIBDEPS) $(LIBPROC_MACRO_INTERNAL) crab1$(exeext): $(RUST_ALL_OBJS) attribs.o $(BACKEND) $(RUST_LIBDEPS) $(rust.prev) @$(call LINK_PROGRESS,$(INDEX.rust),start) +$(LLINKER) $(ALL_LINKERFLAGS) $(LDFLAGS) -o $@ \ - $(RUST_ALL_OBJS) attribs.o $(BACKEND) $(LIBS) $(LIBPROC_MACRO_INTERNAL) $(LIBFORMAT_PARSER) $(BACKENDLIBS) + $(RUST_ALL_OBJS) attribs.o $(BACKEND) $(LIBS) $(CRAB1_LIBS) $(LIBPROC_MACRO_INTERNAL) $(LIBFORMAT_PARSER) $(BACKENDLIBS) @$(call LINK_PROGRESS,$(INDEX.rust),end) # Build hooks. -- 2.34.1