Cannot cross compile to Haiku with CMake #10296
I did this
I'm porting a personal CMake project which uses curl to Haiku OS, however libcurl build is failing with the following output:
Here is the complete output log of
Looking at these logs I see curl was not able to find any socket-related function:
But they are all properly defined in the
After a bit of research I found out Haiku requires all socket programs to link against
So I changed the C compiler command invocation from:
And the build went just fine.
Here is the cross compiler I used, just in case someone want to reproduce this issue.
I expected the following
Libcurl builds successful.
The text was updated successfully, but these errors were encountered:
When cross-compiling for Haiku, the networking library needs to be brought in. Without this, an unknown type of "Error" is reported in lib/curl_setup_once.h. This is also needed when using CMake natively on Haiku to build libcurl. Fixes curl#10296
I decided to take a look at this and fix the bug real quick. 😃
You'll need to make sure that you add -DCMAKE_SYSTEM_NAME=Haiku to your CMake line, but after this commit it should build properly.
I decided to install Haiku in a VM as well and installed CMake from HaikuDepot. I discovered that running CMake on the cURL sources on Haiku will result in the same problem, so I applied my change there and it builds using your command as well (though with -DCMAKE_C_COMPILER=gcc-x86 because the default gcc is 2.95.3, which pretty much causes the build to fail immediately).
Just for fun, I decided to build curl using configure on Haiku as well, and the only thing special that I had to do was set CC=gcc-x86.
On Haiku, gcc-x86 is GCC 11.2.0, while 'gcc' is 2.95.3.