curl / Mailing Lists / curl-library / Single Mail
Buy commercial curl support from WolfSSL. We help you work out your issues, debug your libcurl applications, use the API, port to new platforms, add new features and more. With a team lead by the curl founder himself.

NetBSD, curl and error: cannot run C compiled programs

From: Jeffrey Walton via curl-library <curl-library_at_cool.haxx.se>
Date: Mon, 23 Mar 2020 16:36:30 -0400

Hi Everyone,

I'm trying to build curl-7.69.1.tar.gz on NetBSD 8.1. I'm using
--prefix=$HOME/tmp, and PKG_CONFIG_PATH=$HOME/tmp/lib/pkgconfig.

The configure test fails at:

configure:4470: checking whether we are cross compiling
configure:4478: gcc -o conftest -g2 -O2 -fPIC -pthread
-I/home/jwalton/tmp/include -DNDEBUG -L/home/jwalton/tmp/lib
-Wl,-R,'$$ORIGIN/../lib' -Wl,-R,/home/jwalton/tmp/lib
-Wl,--enable-new-dtags conftest.c -lidn2 -lssl -lcrypto -lz -lpthread
>&5
configure:4482: $? = 0
configure:4489: ./conftest
Shared object "libidn2.so.3" not found
configure:4493: $? = 1
configure:4500: error: in `/home/jwalton/curl-7.69.1':
configure:4504: error: cannot run C compiled programs.

libidn2.so.3 is present in /home/jwalton/tmp/lib:

   $ ls /home/jwalton/tmp/lib | grep idn2
   libidn2.a
   libidn2.la
   libidn2.so
   libidn2.so.3
   libidn2.so.3.6

And:

   $ cat ~/tmp/lib/pkgconfig/libidn2.pc
   prefix=/home/jwalton/tmp
   exec_prefix=${prefix}
   includedir=${prefix}/include
   libdir=${prefix}/lib

   Name: libidn2
   Description: Library implementing IDNA2008 and TR46
   Version: 2.2.0
   Cflags: -I${includedir}
   Libs: -L${libdir} -lidn2

The '-Wl,-R,/home/jwalton/tmp/lib' should allow the conftest to find
libidn2.so at runtime, so I am a bit confused at the error.

I know the fix is to add LD_LIBRARY_PATH=home/jwalton/tmp/lib ..., but
I should not need it due to the runpath.

What is wrong with the flags for the conftest?
-------------------------------------------------------------------
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-library
Etiquette: https://curl.haxx.se/mail/etiquette.html
Received on 2020-03-23