Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Linking error when compiling with "--enable-debug" on OpenBSD 6.7 #5862

Closed
cvengler opened this issue Aug 26, 2020 · 6 comments
Closed

Linking error when compiling with "--enable-debug" on OpenBSD 6.7 #5862

cvengler opened this issue Aug 26, 2020 · 6 comments

Comments

@cvengler
Copy link
Contributor

I did this

export AUTOCONF_VERSION=2.69
export AUTOMAKE_VERSION=1.16
./buildconf
./configure --enable-debug
make

...
ld: error: undefined symbol: curl_dbg_malloc
>>> referenced by slist_wc.c:45
>>>               curl-slist_wc.o:(slist_wc_append)

ld: error: undefined symbol: curl_dbg_free
>>> referenced by slist_wc.c:69
>>>               curl-slist_wc.o:(slist_wc_free_all)

ld: error: undefined symbol: curl_dbg_fopen
>>> referenced by tool_cb_dbg.c:84
>>>               curl-tool_cb_dbg.o:(tool_debug_cb)

ld: error: undefined symbol: curl_dbg_free
>>> referenced by tool_cb_hdr.c:164
>>>               curl-tool_cb_hdr.o:(tool_header_cb)

ld: error: undefined symbol: curl_dbg_malloc
>>> referenced by tool_cb_hdr.c:217
>>>               curl-tool_cb_hdr.o:(parse_filename)

ld: error: undefined symbol: curl_dbg_free
>>> referenced by tool_cb_hdr.c:242
>>>               curl-tool_cb_hdr.o:(parse_filename)

ld: error: undefined symbol: curl_dbg_free
>>> referenced by tool_cb_hdr.c:254
>>>               curl-tool_cb_hdr.o:(parse_filename)

ld: error: undefined symbol: curl_dbg_free
>>> referenced by tool_cb_hdr.c:292
>>>               curl-tool_cb_hdr.o:(parse_filename)

ld: error: undefined symbol: curl_dbg_strdup
>>> referenced by tool_cb_hdr.c:293
>>>               curl-tool_cb_hdr.o:(parse_filename)

ld: error: undefined symbol: curl_dbg_fdopen
>>> referenced by tool_cb_wrt.c:80
>>>               curl-tool_cb_wrt.o:(tool_create_output_file)

ld: error: undefined symbol: curl_dbg_free
>>> referenced by tool_cb_wrt.c:84
>>>               curl-tool_cb_wrt.o:(tool_create_output_file)

ld: error: undefined symbol: curl_dbg_fopen
>>> referenced by tool_cb_wrt.c:88
>>>               curl-tool_cb_wrt.o:(tool_create_output_file)

ld: error: undefined symbol: curl_dbg_free
>>> referenced by tool_cfgable.c:53
>>>               curl-tool_cfgable.o:(free_config_fields)

ld: error: undefined symbol: curl_dbg_free
>>> referenced by tool_cfgable.c:54
>>>               curl-tool_cfgable.o:(free_config_fields)

ld: error: undefined symbol: curl_dbg_free
>>> referenced by tool_cfgable.c:55
>>>               curl-tool_cfgable.o:(free_config_fields)

ld: error: undefined symbol: curl_dbg_free
>>> referenced by tool_cfgable.c:56
>>>               curl-tool_cfgable.o:(free_config_fields)

ld: error: undefined symbol: curl_dbg_free
>>> referenced by tool_cfgable.c:57
>>>               curl-tool_cfgable.o:(free_config_fields)

ld: error: undefined symbol: curl_dbg_free
>>> referenced by tool_cfgable.c:58
>>>               curl-tool_cfgable.o:(free_config_fields)

ld: error: undefined symbol: curl_dbg_free
>>> referenced by tool_cfgable.c:59
>>>               curl-tool_cfgable.o:(free_config_fields)

ld: error: undefined symbol: curl_dbg_free
>>> referenced by tool_cfgable.c:61
>>>               curl-tool_cfgable.o:(free_config_fields)

ld: error: too many errors emitted, stopping now (use -error-limit=0 to see all errors)
collect2: ld returned 1 exit status
*** Error 1 in target 'curl'
*** Error 1 in src (Makefile:984 'curl': @echo "  CCLD    " curl;/bin/sh ../libtool --silent --tag=CC    --mode=link gcc  -Werror-implicit-f...)
*** Error 1 in src (Makefile:2145 'all-recursive')
*** Error 1 in /home/eengler/curl (Makefile:1015 'all-recursive')

I expected the following

No linking errors

curl/libcurl version

259a815

operating system

OpenBSD openbsd.fritz.box 6.7 GENERIC#5 amd64

@bagder bagder added the build label Aug 26, 2020
@bagder
Copy link
Member

bagder commented Aug 26, 2020

It looks like it didn't build/link with memdebug.o ?

@cvengler
Copy link
Contributor Author

openbsd$ ls lib | grep memdebug
libcurl_la-memdebug.lo
libcurl_la-memdebug.o
libcurlu_la-memdebug.lo
libcurlu_la-memdebug.o
memdebug.c
memdebug.h

@cvengler
Copy link
Contributor Author

cvengler commented Aug 26, 2020

FYI: All tests compile fine on OpenBSD and memdebug is also used there

@ajacoutot
Copy link

Hi folks.

This is most probably due to using the bundled libtool(1); you should use the OS provided one.
i.e.

$ make LIBTOOL=/usr/bin/libtool
<...>
$ ./src/curl --version
curl 7.73.0-DEV (x86_64-unknown-openbsd6.7) libcurl/7.73.0-DEV LibreSSL/3.2.1 zlib/1.2.3 libidn2/2.3.0 nghttp2/1.41.0
Release-Date: [unreleased]
Protocols: dict file ftp ftps gopher http https imap imaps pop3 pop3s rtsp smb smbs smtp smtps telnet tftp 
Features: AsynchDNS Debug HTTP2 HTTPS-proxy IDN IPv6 Largefile libz NTLM NTLM_WB SSL TrackMemory UnixSockets

GNU libtool is totally unmaintained as far as OpenBSD support is concerned.

@cvengler
Copy link
Contributor Author

@ajacoutot Thanks, works now :-)

I'm curious if we should add a note to the documentation, especially here

@bagder
Copy link
Member

bagder commented Aug 27, 2020

Yeah, I'm just afraid nobody who'd run into this issue would look there for the answer.

Maybe we could have the --enable-debug magic in configure detect OpenBSD itself and take care of it automatically.

I'm curious though why libtool would cause a problem with the memdebug stuff like that. With a little more research into that we could possibly think of a way we could make it work without the system libtool trick.

cvengler added a commit to cvengler/curl that referenced this issue Sep 30, 2020
bagder pushed a commit that referenced this issue Sep 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

3 participants