From unknown Mon Aug 18 19:29:11 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#57606 <57606@debbugs.gnu.org> To: bug#57606 <57606@debbugs.gnu.org> Subject: Status: LD_LIBRARY_PATH is not set if compiler uses RPATH Reply-To: bug#57606 <57606@debbugs.gnu.org> Date: Tue, 19 Aug 2025 02:29:11 +0000 retitle 57606 LD_LIBRARY_PATH is not set if compiler uses RPATH reassign 57606 libtool submitter 57606 minyard@acm.org severity 57606 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Tue Sep 06 00:31:57 2022 Received: (at submit) by debbugs.gnu.org; 6 Sep 2022 04:31:57 +0000 Received: from localhost ([127.0.0.1]:49343 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oVQFg-0007ce-CD for submit@debbugs.gnu.org; Tue, 06 Sep 2022 00:31:57 -0400 Received: from lists.gnu.org ([209.51.188.17]:34824) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oVJGE-0002js-5B for submit@debbugs.gnu.org; Mon, 05 Sep 2022 17:04:02 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49132) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oVJGD-0001cp-Uq for bug-libtool@gnu.org; Mon, 05 Sep 2022 17:04:02 -0400 Received: from mail-qk1-x72e.google.com ([2607:f8b0:4864:20::72e]:40665) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oVJGC-0001k6-Gx for bug-libtool@gnu.org; Mon, 05 Sep 2022 17:04:01 -0400 Received: by mail-qk1-x72e.google.com with SMTP id f4so6940760qkl.7 for ; Mon, 05 Sep 2022 14:04:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-disposition:mime-version:reply-to:message-id:subject:to :from:date:sender:from:to:cc:subject:date; bh=vdlxXrwaVnFqFqG2ct0WEQCvsPbyASikDN6JVJ9rgFA=; b=SIvn5RodBBsr/0amzvkgS/C2i2DQLevXNPv54e4U+mjAjLUyZvfCUKha+DrPg47jf7 2ZXV6Z4TgaY3kZj5M/3s3FGrPwD/cdBRjtmiax0+5Ykm+GGGcp7qYjQSqG2ryzujrIbF 5XSw9+2wYPW9txEsJlBcj75HDeV/vmWItAgw7OJy/2hSCWfqPYtg1Wmu35JFaGjpwyE0 N0x9MuD/gdFK6n1z1F3wsJyLM8U7SroJFR6v77pwllFUmoTmSiQR2+C8UrYKTHSV14h0 43HxUaww+/39+Jq4S1XdxAxqspKUhhIGytOfB16dU/1nyjmDlGBwLrxtQlATG66EpvSW 7MvA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-disposition:mime-version:reply-to:message-id:subject:to :from:date:sender:x-gm-message-state:from:to:cc:subject:date; bh=vdlxXrwaVnFqFqG2ct0WEQCvsPbyASikDN6JVJ9rgFA=; b=j/SnbaRMrlVEVdj6+VVLWnuEXt7XbWVzi7VAw88oFAtiwgNa78tge0r6lztSv91gF4 xl/Lmby8kXKNrAMX/Vl6jrWynPt3VBBzNNP/TuocXcR5QBCGrkVXIPeVfDtc0ck4SyO6 Q34bqB4wISOKColOgxT7dLcIhbs9BtlgmM9GfDwIrn2YUJMeIQ+pc430rSCYHu3dIdw/ Y06aqPTTk1ByARzRXeZyQwVDu/p4DTzk+9Q/dN/ONKvQ5CSh8wPMiMGTaO/XAsKTNo+K c4lDjpTC2rfaxmUL8pgWCQmvXUwlqXGk0AcLS5Qqm8STGNwXz70WlFHSLiVH4XNlj7n4 3PdA== X-Gm-Message-State: ACgBeo3XeXPV4RdFKqHz+xc6adDjmK+GzEDUh0nkCx1lJkXT3patKvrN iShCqsnMuFeUJzDZZvp9+IivhiJyYg== X-Google-Smtp-Source: AA6agR4VYVESIfRMdtixHwuv4HzR7Grcknf04hvaIsDOJOiTSyKQieKEPDfHPIgqgmH8KK82zmLfIQ== X-Received: by 2002:a05:620a:201a:b0:6bb:c395:c9d9 with SMTP id c26-20020a05620a201a00b006bbc395c9d9mr32637811qka.208.1662411839095; Mon, 05 Sep 2022 14:03:59 -0700 (PDT) Received: from serve.minyard.net ([47.184.185.126]) by smtp.gmail.com with ESMTPSA id bi13-20020a05620a318d00b006b59f02224asm8536873qkb.60.2022.09.05.14.03.58 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 05 Sep 2022 14:03:58 -0700 (PDT) Received: from localhost.localdomain (unknown [IPv6:2001:470:b8f6:1b:1d02:bb60:e417:f04e]) by serve.minyard.net (Postfix) with ESMTPSA id B741C1828A0 for ; Mon, 5 Sep 2022 21:03:57 +0000 (UTC) Date: Mon, 5 Sep 2022 16:03:56 -0500 From: Corey Minyard To: bug-libtool@gnu.org Subject: LD_LIBRARY_PATH is not set if compiler uses RPATH Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Received-SPF: pass client-ip=2607:f8b0:4864:20::72e; envelope-from=tcminyard@gmail.com; helo=mail-qk1-x72e.google.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.25, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-Spam-Score: -0.8 (/) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Tue, 06 Sep 2022 00:31:55 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: minyard@acm.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.8 (-) The libtool documentation states that searching LD_LIBRARY_PATH for modules should work, under "10.4 Finding the correct name to dlopen": If your program uses this approach, then it should search the directories listed in the 'LD_LIBRARY_PATH'(1) environment variable, as well as the directory where libraries will eventually be installed. Searching this variable (or equivalent) will guarantee that your program can find its dlopened modules, even before installation, provided you have linked them using libtool. I have a library and tools that were successfully using that technique on Ubuntu. When I tried to get them working on Redhat, it didn't work. It turns out that on Redhat system RPATH is set in the library, not RUNPATH, and in that case libtool will not set LD_LIBRARY_PATH, presumably since RPATH will override LD_LIBRARY_PATH. However, that doesn't match the documentation and breaks my code that was trying to conform. In my estimation, setting LD_LIBRARY_PATH in that case won't hurt, so it should be easy to make the code match the documentation. -corey