Opened 6 years ago

Closed 6 years ago

#5231 closed defect (fixed)

Build broken on macOS High Sierra 10.13.5

Reported by: Victor ADASCALITEI Owned by: elexis
Priority: Must Have Milestone: Alpha 23
Component: Build & Packages Keywords:
Cc: Patch: Phab:D1610

Description

When building the project on a macOS High Sierra 10.13.5, I get the following:

==== Building pyrogenesis (release) ====
Linking pyrogenesis
Undefined symbols for architecture x86_64:
  "_idn2_check_version", referenced from:
      _curl_version in libcurl.a(libcurl_la-version.o)
      _curl_version_info in libcurl.a(libcurl_la-version.o)
      _fix_hostname in libcurl.a(libcurl_la-url.o)
  "_idn2_free", referenced from:
      _Curl_disconnect in libcurl.a(libcurl_la-url.o)
      _create_conn in libcurl.a(libcurl_la-url.o)
  "_idn2_lookup_ul", referenced from:
      _fix_hostname in libcurl.a(libcurl_la-url.o)
  "_idn2_strerror", referenced from:
      _fix_hostname in libcurl.a(libcurl_la-url.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[1]: *** [../../../binaries/system/pyrogenesis] Error 1
make: *** [pyrogenesis] Error 2

My clang -vis

Apple LLVM version 9.1.0 (clang-902.0.39.2)
Target: x86_64-apple-darwin17.6.0

I have checked and the libcurl.a linked against is the one generated by ./build-osx-libs.sh. There is no other libcurl.a on my library-link path.

Workaround

Following this discussion, I have modified build-osx-libs.sh (in the curl build region) to include --without-libidn2 during config like so:

(./configure CFLAGS="$CFLAGS" LDFLAGS="$LDFLAGS" --prefix="$INSTALL_DIR" --enable-ipv6 --with-darwinssl --without-gssapi --without-libmetalink --without-librtmp --without-libssh2 --without-nss --without-polarssl --without-spnego --disable-ares --disable-ldap --disable-ldaps --without-libidn --without-libidn2 --with-zlib="${ZLIB_DIR}" --enable-shared=no && make ${JOBS} && make install) || die "libcurl build failed"

After rebuilding the lib with this change, I could build the project just fine.

Change History (5)

comment:1 by elexis, 6 years ago

Milestone: BacklogAlpha 23
Priority: Release BlockerMust Have

Tobbi used --without-libidn2 as well when packaging the OSX alpha 23 release on http://irclogs.wildfiregames.com/2018-05/2018-05-12-QuakeNet-%230ad.log

comment:2 by Andy Alt, 6 years ago

Not being an osx user myself, on my 0 A.D. GitHub fork I added 2 branches with a .travis.yml file.

The environment for the xcode 9.3 image:

OS name: "mac os x", version: "10.13.3", arch: "x86_64", family: "mac"

No successful build there yet, but hopefully this will make testing easier. I can make some changes to the osx bundle script or .travis.yml if anyone has suggestions.

Last edited 6 years ago by Andy Alt (previous) (diff)

comment:3 by Andy Alt, 6 years ago

Patch: Phab:D1610

comment:4 by elexis, 6 years ago

Reading the curl code, I think they deleted the --without-libidn flag and replaced it with the --without-libidn2 flag and they forgot to update README.md.

https://github.com/curl/curl/commit/9c91ec778104ae3b744b39444d544e82d5ee9ece https://code.wildfiregames.com/rP21683#31429

So the old flag --without-libidn seems to be dead, as the curl version is fixed as well.

Last edited 6 years ago by elexis (previous) (diff)

comment:5 by elexis, 6 years ago

Owner: set to elexis
Resolution: fixed
Status: newclosed

In 21913:

Update macOS libcurl --without-libidn flag to --without-libidn2 following https://github.com/curl/curl/commit/9c91ec778104ae3b744b39444d544e82d5ee9ece

Fixes #5231.
Refs: rP19848, rP21683.
Differential Revision: https://code.wildfiregames.com/D1610
Patch By: Tobbi and viky / Victor Adascalitei
Comments By: Itms, andy5995

Note: See TracTickets for help on using tickets.