Opened 6 weeks ago

Last modified 5 weeks ago

#71089 new defect

Undefined curl symbols

Reported by: tehcog (tehcog) Owned by:
Priority: Normal Milestone:
Component: base Version: 2.10.2
Keywords: mavericks Cc:
Port:

Description

OS X 10.9.5 (13F1911) intel i7 x86_64 arch Darwin Kernel Version 13.4.0 Xcode 6.2, Build version 6C131e

When trying to create a bootstrap version of macports base for use with curl (to install curl into) as shown below:

> git clone -b release-2.10 https://github.com/macports/macports-base.git
> cd macports-base
> ./configure --prefix=/opt/bootstrap_2102 --with-applications-dir=/opt/bootstrap_2102/Applications --without-startupitems
> make 2>&1 | tee ports_build.log && sudo make install

I am getting the following make error:

Undefined symbols for architecture x86_64:
  "_curl_url", referenced from:
      _CurlFetchCmd in curl.o
  "_curl_url_cleanup", referenced from:
      _CurlFetchCmd in curl.o
  "_curl_url_get", referenced from:
      _CurlFetchCmd in curl.o
  "_curl_url_set", referenced from:
      _CurlFetchCmd in curl.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [Pextlib.dylib] Error 1
make[1]: *** [all] Error 1
make: *** [all] Error 1

I have not had this issue with version 2.10.1

Attachments (1)

ports_build.log.xz (12.6 KB) - added by tehcog (tehcog) 6 weeks ago.
make log file

Download all attachments as: .zip

Change History (5)

Changed 6 weeks ago by tehcog (tehcog)

Attachment: ports_build.log.xz added

make log file

comment:1 Changed 6 weeks ago by ryandesign (Ryan Carsten Schmidt)

Component: portsbase
Keywords: mavericks added
Port: MacPorts base removed
Summary: MacPorts @2.10.2 make error on MavericksUndefined curl symbols

I see -I/opt/local/include in the log, which means it probably found headers from MacPorts curl, but I do not see -L/opt/local/lib in the log, meaning it then tried to link with the older macOS curl; this mismatch between newer header and older library probably accounts for the undefined symbols error in the log.

I recommend you use ./standard_configure.sh instead of ./configure; this will hide what's in your /opt/local MacPorts installation from this MacPorts build and should allow the build to succeed.

Version 0, edited 6 weeks ago by ryandesign (Ryan Carsten Schmidt) (next)

comment:2 in reply to:  1 Changed 5 weeks ago by tehcog (tehcog)

Replying to ryandesign:

I recommend you use ./standard_configure.sh instead of ./configure; this will hide what's in your /opt/local MacPorts installation from this MacPorts build and should allow the build to succeed.

This seems to have worked. Thank you for your time.

comment:3 Changed 5 weeks ago by ryandesign (Ryan Carsten Schmidt)

I'm glad that worked! I'm not sure what would have changed between MacPorts 2.10.1 and the tip of the release-2.10 branch to have caused this though. I mean you can look at the full set of changes between 2.10.1 and the release-2.10 branch. It seems more likely that something changed in the ports that you had installed. For example, maybe you didn't have the curl and/or pkg-config ports installed before and now you do.

When you had used ./configure, had you specified any other flags, such as a flag to tell it which curl to use? Or had you had the CFLAGS, CPPFLAGS, and/or LDFLAGS environment variables set? (If so, to which values?) It seems like if the MacPorts build was going to automatically find your MacPorts curl installation, it should have picked up both the necessary CPPFLAGS (the -I flag) and the necessary LDFLAGS (the -L flag), not just one of them, since it finds it by using the output of curl-config --cflags (which should print the -I flag) and curl-config --libs (which should print the -L flag).

comment:4 in reply to:  3 Changed 5 weeks ago by tehcog (tehcog)

Replying to ryandesign:

When you had used ./configure, had you specified any other flags, such as a flag to tell it which curl to use? Or had you had the CFLAGS, CPPFLAGS, and/or LDFLAGS environment variables set? (If so, to which values?) It seems like if the MacPorts build was going to automatically find your MacPorts curl installation, it should have picked up both the necessary CPPFLAGS (the -I flag) and the necessary LDFLAGS (the -L flag), not just one of them, since it finds it by using the output of curl-config --cflags (which should print the -I flag) and curl-config --libs (which should print the -L flag).

Typically I only use ./configure for this 'curl ports install' build, then install curl into that. I am referencing said installation (--prefix=/opt/bootstrap_2102) for curl usage - by the main ports install in /opt/local... - by configuring using '--with-curlprefix=/opt/bootstrap_2102'.

Based on your information, it sounds like something 'circular' may be going on.

The only other thing I may have done differently was 'clean' the previous 'curl ports install' - removing leaves - including pkgconfig. However, pkgconfig port was still available in the main ports install. This time I have setrequested pkgconfig in the 'curl ports install'. If you see something based on this new info that may be causing the issue, please let me know, otherwise we will see what happens next time.

Thanks Again

Note: See TracTickets for help on using tickets.