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

[libarchive] fix build with VS2017 #586

Merged
merged 3 commits into from
Jan 26, 2017
Merged

[libarchive] fix build with VS2017 #586

merged 3 commits into from
Jan 26, 2017

Conversation

codicodi
Copy link
Contributor

Libarchive uses check_function_exists module for feature checks. This macro is completly broken when it comes to compiler built-ins and inline functions (see here and here). As in VS2017 wcslen is also a built-in, libarchive fails to detect it and defines its own version - which ends with "built-in function redefinition" error.
This PR provides a patch that skips all problematic checks.

@alexkaratarakis
Copy link
Contributor

Does it build for you? I am getting these errors:

     4>archive_string.obj : error LNK2019: unresolved external symbol __imp__libiconv_open referenced in function _create_sconv_object [E:\workspace\vcpkgspace\buildtrees\libarchive\x86-windows-rel\libarchive\archive.vcxproj]
     4>archive_string.obj : error LNK2019: unresolved external symbol __imp__libiconv referenced in function _iconv_strncat_in_locale [E:\workspace\vcpkgspace\buildtrees\libarchive\x86-windows-rel\libarchive\archive.vcxproj]
     4>archive_string.obj : error LNK2019: unresolved external symbol __imp__libiconv_close referenced in function _archive_string_conversion_free 

Note that I build the whole chain with VS2017 so there might be something with libiconv that we need to check.

@codicodi
Copy link
Contributor Author

Yes, I successfully built whole chain for x86-windows and x64-windows with VS2017.

@ras0219-msft ras0219-msft merged commit cf5770d into microsoft:master Jan 26, 2017
ras0219-msft added a commit that referenced this pull request Jan 26, 2017
[libarchive] fix build with VS2017
@ras0219-msft
Copy link
Contributor

I was able to repro the same issues that @alexkaratarakis hit above, so this may have been introduced in newer versions of the 2017 preview. We should look into investigating further.

However, after looking at the code that actually uses libiconv, it appears to provide extremely limited functionality on Windows due to the existence of the Win32 APIs (which libarchive does use in preference to libiconv). Disabling libiconv did fix the issues, so I've added that during the merge.

Thanks for digging in and figuring out that wcslen issue!

@codicodi codicodi deleted the fix-libarchive branch January 26, 2017 06:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants