Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [Bug 15181] New: Building libcurl fails due to faulty package definition
@ 2022-12-17  7:56 bugzilla
  2023-01-28 21:07 ` [Buildroot] [Bug 15181] " bugzilla
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: bugzilla @ 2022-12-17  7:56 UTC (permalink / raw)
  To: buildroot

https://bugs.busybox.net/show_bug.cgi?id=15181

            Bug ID: 15181
           Summary: Building libcurl fails due to faulty package
                    definition
           Product: buildroot
           Version: 2022.02.8
          Hardware: All
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P5
         Component: Other
          Assignee: unassigned@buildroot.uclibc.org
          Reporter: dmrauh@posteo.de
                CC: buildroot@uclibc.org
  Target Milestone: ---

Hi all,

I'm trying to compile "libcurl" using Buildroot 2022.02.8 with the following
relevant options in my .config:

BR2_PACKAGE_LIBCURL=y
BR2_PACKAGE_LIBCURL_OPENSSL=y
BR2_PACKAGE_OPENSSL=y


Unfortunately the build is reproducibly failing during "libcurl-configure" with
the following symptoms:

...
configure: PKG_CONFIG_LIBDIR will be set to
"/home/rauhdomi/build/out/host/x86_64-buildroot-linux-gnu/sysroot/usr/lib/pkgconfig"
checking for openssl options with pkg-config... found
configure: pkg-config: SSL_LIBS: "-lssl -lcrypto "
configure: pkg-config: SSL_LDFLAGS: "-L/usr/lib64 "
configure: pkg-config: SSL_CPPFLAGS: "-I/usr/include "
checking for HMAC_Update in -lcrypto... no
checking for HMAC_Init_ex in -lcrypto... no
checking OpenSSL linking with -ldl... no
checking OpenSSL linking with -ldl and -lpthread... no
configure: OPT_OPENSSL:
/home/rauhdomi/build/out/host/x86_64-buildroot-linux-gnu/sysroot/usr
configure: OPENSSL_ENABLED: 
configure: error: --with-openssl was given but OpenSSL could not be detected
make[1]: *** [package/pkg-generic.mk:283:
/home/rauhdomi/build/out/build/libcurl-7.84.0/.stamp_configured] Error 1
make: *** [Makefile:40: _all] Error 2

After poking around for a bit I narrowed it down to the following part of
libcurl's package definition in Buildroot "libcurl.mk":

# configure adds the cross openssl dir to LD_LIBRARY_PATH which screws up
# native stuff during the rest of configure when target == host.
# Fix it by setting LD_LIBRARY_PATH to something sensible so those libs
# are found first.
LIBCURL_CONF_ENV += LD_LIBRARY_PATH=$(if
$(LD_LIBRARY_PATH),$(LD_LIBRARY_PATH):)/lib:/usr/lib

Since on my build system "pkgconf" is also installed through my distro's
package manager (in version 1.8.0), its "libpkgconf.so.3" is used instead of
the one part of "$(HOST_DIR)/lib", when building "libcurl". Apparently this has
never been a problem before because the versions were semantically compatible,
which isn't the case any longer.

I guess this bug has the potential to affect any user having "pkgconf" already
installed on their system.

My proposal on how to fix the bug would be as follows:

diff --git a/package/libcurl/libcurl.mk b/package/libcurl/libcurl.mk
index e241bd1c88..f6f5501f83 100644
--- a/package/libcurl/libcurl.mk
+++ b/package/libcurl/libcurl.mk
@@ -46,7 +46,7 @@ LIBCURL_DEPENDENCIES += openssl
 # native stuff during the rest of configure when target == host.
 # Fix it by setting LD_LIBRARY_PATH to something sensible so those libs
 # are found first.
-LIBCURL_CONF_ENV += LD_LIBRARY_PATH=$(if
$(LD_LIBRARY_PATH),$(LD_LIBRARY_PATH):)/lib:/usr/lib
+LIBCURL_CONF_ENV += LD_LIBRARY_PATH=$(if
$(LD_LIBRARY_PATH),$(LD_LIBRARY_PATH):)$(HOST_DIR)/lib:/lib:/usr/lib
 LIBCURL_CONF_OPTS += --with-ssl=$(STAGING_DIR)/usr \
        --with-ca-path=/etc/ssl/certs
 else

This way we always make sure that libs part of the SDK generated by Buildroot
take precedence over the ones coming from the build system.

Best regards,
Dominik

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-06-15 15:04 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-12-17  7:56 [Buildroot] [Bug 15181] New: Building libcurl fails due to faulty package definition bugzilla
2023-01-28 21:07 ` [Buildroot] [Bug 15181] " bugzilla
2023-02-24 22:00 ` bugzilla
2024-06-15 15:04 ` bugzilla

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox