Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:107541 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 8295 invoked from network); 14 Oct 2019 11:38:51 -0000 Received: from unknown (HELO php-smtp3.php.net) (208.43.231.12) by pb1.pair.com with SMTP; 14 Oct 2019 11:38:51 -0000 Received: from php-smtp3.php.net (localhost [127.0.0.1]) by php-smtp3.php.net (Postfix) with ESMTP id 7A0502CE62A for ; Mon, 14 Oct 2019 02:22:43 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp3.php.net X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: X-Spam-Virus: No Received: from mail-lf1-x129.google.com (mail-lf1-x129.google.com [IPv6:2a00:1450:4864:20::129]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by php-smtp3.php.net (Postfix) with ESMTPS for ; Mon, 14 Oct 2019 02:22:42 -0700 (PDT) Received: by mail-lf1-x129.google.com with SMTP id x80so11292380lff.3 for ; Mon, 14 Oct 2019 02:22:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=4Zsq7T6oZI0dQ8jhNX1HEmXuadVQEScwbEmbKRPjjBU=; b=NIaPootGb6y49zxezUGiYvaGAGzRT0jQgsnhRVKqTVryeL1KKrz/sHZc36WggJGZPh Ge4Z3MVdL/nO3XBKKkA9R1Zj1dG0JYASnVX93DBStcuFR/4T9g2aasA3yXvoxI4v+YwY KsukVhNV9rZNSPoiOtYmabSyiGUg7mbPjSwRJ9I3SZvt3l7aGu3DUlJUz4d2C0hYTgv8 OMklI6RjFsnZTgG63wF0+Nj+5B/oHUpDU9A7IJAmqNhlwFWNJXnGl0CkkwX2HzwPFK7g jtDRLE8oG5AAKjvnDsJhUtc2aXVjrFEDKoAga7hq+QVQtXP0p46XAp8yXEOsZ2qMy4eQ OxPw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=4Zsq7T6oZI0dQ8jhNX1HEmXuadVQEScwbEmbKRPjjBU=; b=QCZg0j7xdyM+fWFcL/qxjySJuEfiLVL6e19n3g6N8DntfpO3u68ikJ1kJp/gRbhFib JZvA09VkZeP78btOeToMBWydZyDg15I0EeEJUGN35QjTRTcnCtDJio+/u+3J+NZGjGaQ bVQwVzuVY23AG7lXIbaU8UqelKiu9Narqab7uvbmrrp07YJNJuEbJC7f9I2gGCSx2YNt 1DW80qQrLFo0yVKBYC/WR0TqiEIbWQeFkklAfMlvvqyvdbND41fisUkb+2rGP6wSr4Md PSuYSG0n+6Wz/Jj/nrP7w75uQbFbmmfh7OjcLBGbNRqUR/+bFTlXo0m5bErh8y2HjcqP Zxgw== X-Gm-Message-State: APjAAAWoyL50r4Q8HR56adhIjw6n/2nwt1MYt209+/x5HJVuhriLQ98r 7cxG9o8RsFFVul23Tj8oLLtQtCmzywoFLJJEUZ8= X-Google-Smtp-Source: APXvYqyJfJ10ooWXx4FkyEN1Q71go9KtkzdlqiTO+2MUSBSsh7lDRGVRV4CGE4KS3eHvCC+UDEmoSD7M+JBtIscrA8k= X-Received: by 2002:a19:f813:: with SMTP id a19mr16894989lff.154.1571044961177; Mon, 14 Oct 2019 02:22:41 -0700 (PDT) MIME-Version: 1.0 References: <2e358c47-f07d-2bd0-dcbf-8ee1282f1ea1@evermeet.cx> <79bdc208-876f-ea0c-b529-010fe3d129bb@kippdata.de> <6de046b4-905c-e338-d640-14973a448910@evermeet.cx> <6d37qe5jhtm390dqs45hmgpkdvlm3lgj3i@4ax.com> In-Reply-To: Date: Mon, 14 Oct 2019 11:22:24 +0200 Message-ID: To: "Helmut K. C. Tessarek" Cc: Jan Ehrhardt , PHP internals Content-Type: multipart/alternative; boundary="000000000000d655470594db685e" X-Envelope-From: Subject: Re: [PHP-DEV] configure bug with static openssl 1.1.1? - bugid 77288 From: nikita.ppv@gmail.com (Nikita Popov) --000000000000d655470594db685e Content-Type: text/plain; charset="UTF-8" On Sun, Oct 13, 2019 at 11:04 PM Helmut K. C. Tessarek wrote: > On 2019-10-13 17:00, Nikita Popov wrote: > > Don't know about previous versions, but at least on 7.4 setting > > OPENSSL_CFLAGS and OPENSSL_LIBS appropriately (e.g. using pkg-config > > --static --cflags/--libs return values) should work. These environment > > variables allow you to bypass normal pkg-config checks, which are > generally > > going to be non-static. > > I've tried pretty much anything, so if you have flags and env vars that > work, > please post them here. > Here's what pkg-config --static tells me on my system: -lssl -lcrypto -ldl -pthread So I use this for OPENSSL_LIBS, while explicitly requesting the static .a libs (on the assumption that only openssl should be linked statically, not all libs): ./configure --disable-all --with-openssl OPENSSL_LIBS="-l:libssl.a -l:libcrypto.a -ldl -pthread" configure passes, but then during linking I get: /usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/8/../../../x86_64-linux-gnu/libcrypto.a(threads_pthread.o): undefined reference to symbol 'pthread_rwlock_wrlock@@GLIBC_2.2.5' It looks like the "-pthread" flag gets stripped. Then I tried: ./configure --disable-all --with-openssl OPENSSL_LIBS="-l:libssl.a -l:libcrypto.a -ldl" CFLAGS="-pthread" This compiles successfully. > ldd sapi/cli/php linux-vdso.so.1 (0x00007ffd1531f000) libresolv.so.2 => /lib/x86_64-linux-gnu/libresolv.so.2 (0x00007f04b79a9000) librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f04b77a1000) libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f04b7403000) libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f04b71ff000) libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f04b6fe0000) libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f04b6bef000) /lib64/ld-linux-x86-64.so.2 (0x00007f04b8bee000) The fact that "-pthread" gets stripped from LIBS might be a bug. Hope this helps, Nikita --000000000000d655470594db685e--