-
Notifications
You must be signed in to change notification settings - Fork 5k
Using include_directories(SYSTEM...
for openssl and curl breaks cross compilation for Yocto Linux
#20364
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
Comments
@Tragetaschen what is the issue tracking? A bug? Ask for enhancement? Or a question? (sorry, I didn't get it from your description) |
I would argue for "Bug", because it breaks "my" cross-compile build. The "SYSTEM" option is meant for "special" cases, not for just regular include directories: https://cmake.org/cmake/help/v3.0/command/include_directories.html |
@Tragetaschen is this still causing you issues? |
cc @wfurt |
do you have recipe one can try @Tragetaschen? Better Yocto support was discussed before but right now it is not supported platform so it is hard to keep everything in good shape. |
@wfurt There's a recipe for .NET Core 2.1 on linux-arm in my layer: https://github.com/Tragetaschen/meta-aspnet/tree/master/recipes-dotnet/dotnet-source-build I'm planning on updating to 2.2 "soon" when my current project has calmed down. |
I have updated the recipe to use the 2.2.3 source-build git tag. The relevant patch is this: https://github.com/Tragetaschen/meta-aspnet/blob/5438f4c3dbabb4d0f23f11066a8c5e5aac385721/recipes-dotnet/dotnet-source-build/files/0001-corefx-CMake-adaptions.patch#L63-L75 The error during build without that patch
|
Any suggestions how to continue with this? @Tragetaschen if you think something is broken in our scripts would you mind to submit a PR? Even though the OS isn't officially supported, if the fix is straightforward, we can take it. |
When I last looked, the git blame mentioned macOS as the reason to introduce these include directories where I cannot build. I will migrate the Yocto recipe to .NET Core 3 once it's released and then check what's necessary and create a pull request using its CI to see if macOS actually needs SYSTEM include or if a regular one is sufficient. Hopefully by that time the migration to one repository is already finished :) |
@Tragetaschen do you have time to verify if this is still broken? Thanks. |
Upon reviewing, 47d738a should have fixed this issue here as well |
While taming the build process to run in a Yocto Linux cross compile environment, one road block was the explicit inclusion of the curl and openssl include directories here and here.
The effect of these statements is (with clang 3.9.1) that the
${SYSROOT}/usr/include
folder (where curl and openssl headers reside in a Yocto build environment) becomes an-isystem
parameter to clang and this reorders that folder above the C++ include folders. When clang now tries to resolve C++ header files, it fails on an#include_next <stdlib.h>
, because that file isn't found in a folder that comes after the C++ header folders.Blaming the two CMakeLists points to build issues for OSX and BSD, but I cannot build for those targets. Otherwise I would check if the entire
include_directories
statement is actually necessary, or if removing theSYSTEM
argument still makes the build succeed (it should).See also dotnet/core-setup#1598
The text was updated successfully, but these errors were encountered: