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

[libxml2] (OSX) Dependent ports fail due to missing iconv linkage #11001

Closed
Neumann-A opened this issue Apr 24, 2020 · 8 comments · Fixed by #11072
Closed

[libxml2] (OSX) Dependent ports fail due to missing iconv linkage #11001

Neumann-A opened this issue Apr 24, 2020 · 8 comments · Fixed by #11072
Assignees
Labels
category:port-bug The issue is with a library, which is something the port should already support

Comments

@Neumann-A
Copy link
Contributor

Host Environment

  • OS: OSX
  • Compiler: revision

Failure logs

Undefined symbols for architecture x86_64:
  "___darwin_check_fd_set_overflow", referenced from:
      _xmlNanoFTPCheckResponse in libxml2.a(nanoftp.c.o)
      _xmlNanoFTPCloseConnection in libxml2.a(nanoftp.c.o)
      _xmlNanoFTPList in libxml2.a(nanoftp.c.o)
      _xmlNanoFTPGet in libxml2.a(nanoftp.c.o)
  "_iconv", referenced from:
      _xmlIconvWrapper in libxml2.a(encoding.c.o)
  "_iconv_close", referenced from:
      _xmlFindCharEncodingHandler in libxml2.a(encoding.c.o)
      _xmlCharEncCloseFunc in libxml2.a(encoding.c.o)
  "_iconv_open", referenced from:
      _xmlFindCharEncodingHandler in libxml2.a(encoding.c.o)
ld: symbol(s) not found for architecture x86_64

Additional context
the vcpkg-cmake-wrapper.cmake in libxml2 must be changed to also add the required dependencies on OSX. Observed in build failure of on OSX CI in #10770

Missing symbol ___darwin_check_fd_set_overflow might be an infrastructure/XCode bug or requires a rebuild of libxml?

@Neumann-A Neumann-A added the category:port-bug The issue is with a library, which is something the port should already support label Apr 24, 2020
@Neumann-A Neumann-A changed the title [libxml2] (OSx) Dependent ports fail due to missing incov linkage [libxml2] (OSx) Dependent ports fail due to missing iconv linkage Apr 24, 2020
@Neumann-A Neumann-A changed the title [libxml2] (OSx) Dependent ports fail due to missing iconv linkage [libxml2] (OSX) Dependent ports fail due to missing iconv linkage Apr 24, 2020
@NancyLi1013
Copy link
Contributor

Hi @Neumann-A
Thanks for posting this issue.
Could you please help confirm on which version of your compiler you encountered this?
It seems a bug introduced by Xcode 11.4.

@Neumann-A
Copy link
Contributor Author

Could you please help confirm on which version of your compiler you encountered this?

This was on vcpkg CI so you should know which compiler you use/used there to build libxml2. Maybe just need to rebuild libxml2 once for CI (assuming you updated Xcode on CI to a version without the bug).

@NancyLi1013
Copy link
Contributor

Thanks for your info.
But I didn't see this failure for libxml2 in the PR #10770.

libxml2:x64-osx: pass: 829f2a0dc6353fb46c06b4c3028eaf4bb6b9fb84

It seems to be passed.
Where did you see this?
If this is really on vcpkg CI, we will try to solve this.

@Neumann-A
Copy link
Contributor Author

Neumann-A commented Apr 27, 2020

@NancyLi1013: It is in the log of the cmake port build failure.
install-x64-osx-dbg-out.log @ Line 404 & 422

@NancyLi1013
Copy link
Contributor

Thanks. I have noticed this and will look into it.

@NancyLi1013
Copy link
Contributor

It seems that there is no the following error in current log.

     ___darwin_check_fd_set_overflow", referenced from:
    _xmlNanoFTPCheckResponse in libxml2.a(nanoftp.c.o)
    _xmlNanoFTPCloseConnection in libxml2.a(nanoftp.c.o)
    _xmlNanoFTPList in libxml2.a(nanoftp.c.o)
    _xmlNanoFTPGet in libxml2.a(nanoftp.c.o)

But the issue caused by iconv still exists.

Undefined symbols for architecture x86_64:
  "_iconv", referenced from:
      _xmlIconvWrapper in libxml2.a(encoding.c.o)
  "_iconv_close", referenced from:
      _xmlFindCharEncodingHandler in libxml2.a(encoding.c.o)
      _xmlCharEncCloseFunc in libxml2.a(encoding.c.o)
  "_iconv_open", referenced from:
      _xmlFindCharEncodingHandler in libxml2.a(encoding.c.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

I checked the CMakeLists.txt and iconv has been linked.

I plan to submitted a PR to test this and confirm if there is something wrong with libxml2 on osx pipeline.

@NancyLi1013
Copy link
Contributor

@strega-nil
Could you please help take a look about this issue?

It should not a usage bug for libxml2. I try to create a project to build on osx without any error.
In addition, I also noticed that iconv is only added on Windows platform in vcpkg-cmake-wrapper.cmake. But this issue only occured on osx instead of osx and linux.

So I'm not sure what happened on osx.

@Neumann-A
Copy link
Contributor Author

Neumann-A commented Apr 28, 2020

turns out:

libiconv portfile:

if(NOT VCPKG_TARGET_IS_WINDOWS)
    set(VCPKG_POLICY_EMPTY_PACKAGE enabled)
    file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/share/unofficial-iconv)
    file(COPY ${CMAKE_CURRENT_LIST_DIR}/unofficial-iconv-config.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/unofficial-iconv)
    return()
endif()

So libxml2 is probably not linking iconv from within vcpkg but a system version. The linux machine does not link iconv into libxml2 seems to have a shared library of iconv installed while while on osx it gets linked? The reasons for that are the unofficial::iconv targets.
libiconv should probably be fixed to build iconv and charset on all platforms.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:port-bug The issue is with a library, which is something the port should already support
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants