From patchwork Mon Dec 9 13:13:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nick Clifton X-Patchwork-Id: 102685 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id D9FFA3858423 for ; Mon, 9 Dec 2024 13:14:44 +0000 (GMT) X-Original-To: binutils@sourceware.org Delivered-To: binutils@sourceware.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTP id 3A5803858432 for ; Mon, 9 Dec 2024 13:14:06 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 3A5803858432 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 3A5803858432 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1733750046; cv=none; b=li9VlKnVUehskumR6fx0vDhPIW+N876c1f00Bk2Ee3zmVAABZ9AIzz1v8TGfjIzbcVZFJmau3cU5GvOVpBdKDYSNFm2yiIBTVZaRs05r13k4uolO2hRXrV6injSqD6T6p2HsbqynIwxJm/jS2YLLto1J+EYvU45a7gAtkBc0JJw= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1733750046; c=relaxed/simple; bh=GIrTrhmoCNPboCODkYjW7ti3vRAsbEVoHHrwZlKkMEE=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=fTt1hImj4S0nOTga2AfctJp3cBUpeW2fug17MVUlkogOg3QAPzky3s3KAZzz4irMuEzOClnNfbKEIJhTLhDzo+bo7wKR/v+LhaXmW/+zgg9XFKTF1t3wijscIOS9Fz0KqRfHXFRSJI6nYx3zUmZYcRiy8LPcXje3fqm8fGLWiPo= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3A5803858432 Authentication-Results: sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=O2LDg/pI DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1733750005; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type; bh=w/ABKJchav4K4a1p1z5cqBl7bh4Zvhp0qlJQgSfZsbQ=; b=O2LDg/pIx2fz8lj17UPW1pChbKcwtosEGH+I+K4nfuSeJU+yV/3c1wnmqi8IJHCJfoGUuy 9ZcF5M7FX5H+GOEmHxozu78gZiC/+6+heRqaQj4q4F76BRBBksP94PUE3M921BhPm6jEco uzkBMOEimhwgdCEgbIk4XOv+nHo/6VY= Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-226-iSehYhtpOweY5_hc4Qp3iQ-1; Mon, 09 Dec 2024 08:13:24 -0500 X-MC-Unique: iSehYhtpOweY5_hc4Qp3iQ-1 X-Mimecast-MFC-AGG-ID: iSehYhtpOweY5_hc4Qp3iQ Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (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 mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id C8F491955E80 for ; Mon, 9 Dec 2024 13:13:23 +0000 (UTC) Received: from prancer.redhat.com (unknown [10.42.28.39]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 2902B1955F41 for ; Mon, 9 Dec 2024 13:13:22 +0000 (UTC) From: Nick Clifton To: binutils@sourceware.org Subject: Commit: Add linker diagnostic message about missing static libraries Date: Mon, 09 Dec 2024 13:13:20 +0000 Message-ID: <87ldwpm233.fsf@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: Px-3VW9yglFIXiIePjNEhy_IKSiV4TmBUL0FyL7e_Cw_1733750003 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-10.0 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_NONE, 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: binutils@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Binutils mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: binutils-bounces~patchwork=sourceware.org@sourceware.org Hi Guys, I am applying the patch below in response to a user request for a more helpful error message from the linker if it fails to find a static library. (The request is RHEL-69758 for those with access to the RHEL jira system). Cheers Nick diff --git a/ld/ldfile.c b/ld/ldfile.c index f1107a1b7d7..050f505c31e 100644 --- a/ld/ldfile.c +++ b/ld/ldfile.c @@ -711,6 +711,12 @@ ldfile_open_file (lang_input_statement_type *entry) else einfo (_("%P: cannot find %s: %E\n"), entry->local_sym_name); + /* Be kind to users who are creating static executables, but + have forgotten to install the necessary static libraries. */ + if (entry->flags.dynamic == false && startswith (entry->local_sym_name, "-l")) + einfo (_("%P: have you installed the static version of the %s library ?\n"), + entry->local_sym_name + 2); + /* PR 25747: Be kind to users who forgot to add the "lib" prefix to their library when it was created. */ for (arch = search_arch_head; arch != NULL; arch = arch->next)