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

Cannot cross compile to Haiku with CMake #10296

Closed
Kartatz opened this issue Jan 14, 2023 · 3 comments
Closed

Cannot cross compile to Haiku with CMake #10296

Kartatz opened this issue Jan 14, 2023 · 3 comments

Comments

@Kartatz
Copy link

Kartatz commented Jan 14, 2023

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:

$ cmake --build ./
[8%] Building C object lib/CMakeFiles/libcurl.dir/altsvc.c.o
In file included from /home/kartatz/curl/lib/curl_setup.h:707,
                 from /home/kartatz/curl/lib/altsvc.c:28:
/home/kartatz/curl/lib/curl_setup_once.h:158:3: error: unknown type name 'Error'
  158 |   Error Missing_definition_of_macro_sread
      |   ^~~~~
/home/kartatz/curl/lib/curl_setup_once.h:178:3: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'Error'
  178 |   Error Missing_definition_of_macro_swrite
      |   ^~~~~
/home/kartatz/curl/lib/curl_setup_once.h:178:3: error: unknown type name 'Error'
make[2]: *** [lib/CMakeFiles/libcurl.dir/build.make:76: lib/CMakeFiles/libcurl.dir/altsvc.c.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:441: lib/CMakeFiles/libcurl.dir/all] Error 2
make: *** [Makefile:136: all] Error 2

Here is the complete output log of cmake ./:

$ cmake \
    -DCMAKE_C_COMPILER=${HOME}/unknown-unknown-haiku/bin/x86_64-unknown-haiku-gcc \
    -DBUILD_CURL_EXE=OFF \
    -DHTTP_ONLY=ON \
    -DENABLE_THREADED_RESOLVER=OFF \
    -DCURL_USE_OPENSSL=ON \
    -DCURL_DISABLE_ALTSVC=ON \
    -DCURL_DISABLE_CRYPTO_AUTH=ON \
    -DCURL_DISABLE_COOKIES=ON \
    -DCURL_DISABLE_HSTS=ON \
    -DCURL_DISABLE_HTTP_AUTH=ON \
    -DCURL_DISABLE_NETRC=ON \
    -DUSE_LIBIDN2=OFF \
    -DENABLE_UNIX_SOCKETS=OFF \
    -DCURL_USE_LIBSSH2=OFF \
    ./
-- The C compiler identification is GNU 11.2.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /home/kartatz/unknown-unknown-haiku/bin/x86_64-unknown-haiku-gcc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- curl version=[7.87.1-DEV]
-- Performing Test OPT_pedantic
-- Performing Test OPT_pedantic - Success
-- Performing Test OPT_Wall
-- Performing Test OPT_Wall - Success
-- Performing Test OPT_W
-- Performing Test OPT_W - Success
-- Performing Test OPT_Wpointer_arith
-- Performing Test OPT_Wpointer_arith - Success
-- Performing Test OPT_Wwrite_strings
-- Performing Test OPT_Wwrite_strings - Success
-- Performing Test OPT_Wunused
-- Performing Test OPT_Wunused - Success
-- Performing Test OPT_Wshadow
-- Performing Test OPT_Wshadow - Success
-- Performing Test OPT_Winline
-- Performing Test OPT_Winline - Success
-- Performing Test OPT_Wnested_externs
-- Performing Test OPT_Wnested_externs - Success
-- Performing Test OPT_Wmissing_declarations
-- Performing Test OPT_Wmissing_declarations - Success
-- Performing Test OPT_Wmissing_prototypes
-- Performing Test OPT_Wmissing_prototypes - Success
-- Performing Test OPT_Wfloat_equal
-- Performing Test OPT_Wfloat_equal - Success
-- Performing Test OPT_Wsign_compare
-- Performing Test OPT_Wsign_compare - Success
-- Performing Test OPT_Wundef
-- Performing Test OPT_Wundef - Success
-- Performing Test OPT_Wendif_labels
-- Performing Test OPT_Wendif_labels - Success
-- Performing Test OPT_Wstrict_prototypes
-- Performing Test OPT_Wstrict_prototypes - Success
-- Performing Test OPT_Wdeclaration_after_statement
-- Performing Test OPT_Wdeclaration_after_statement - Success
-- Performing Test OPT_Wstrict_aliasing_3
-- Performing Test OPT_Wstrict_aliasing_3 - Success
-- Performing Test OPT_Wcast_align
-- Performing Test OPT_Wcast_align - Success
-- Performing Test OPT_Wtype_limits
-- Performing Test OPT_Wtype_limits - Success
-- Performing Test OPT_Wold_style_declaration
-- Performing Test OPT_Wold_style_declaration - Success
-- Performing Test OPT_Wmissing_parameter_type
-- Performing Test OPT_Wmissing_parameter_type - Success
-- Performing Test OPT_Wempty_body
-- Performing Test OPT_Wempty_body - Success
-- Performing Test OPT_Wclobbered
-- Performing Test OPT_Wclobbered - Success
-- Performing Test OPT_Wignored_qualifiers
-- Performing Test OPT_Wignored_qualifiers - Success
-- Performing Test OPT_Wconversion
-- Performing Test OPT_Wconversion - Success
-- Performing Test OPT_Wvla
-- Performing Test OPT_Wvla - Success
-- Performing Test OPT_Wdouble_promotion
-- Performing Test OPT_Wdouble_promotion - Success
-- Performing Test OPT_Wenum_conversion
-- Performing Test OPT_Wenum_conversion - Success
-- Performing Test OPT_Warith_conversion
-- Performing Test OPT_Warith_conversion - Success
-- Performing Test OPTlong_long
-- Performing Test OPTlong_long - Success
-- Performing Test OPTmultichar
-- Performing Test OPTmultichar - Success
-- Performing Test OPTformat_nonliteral
-- Performing Test OPTformat_nonliteral - Success
-- Performing Test OPTsign_conversion
-- Performing Test OPTsign_conversion - Success
-- Performing Test OPTsystem_headers
-- Performing Test OPTsystem_headers - Success
-- Performing Test OPTpedantic_ms_format
-- Performing Test OPTpedantic_ms_format - Failed
-- Performing Test HAVE_SOCKADDR_IN6_SIN6_ADDR
-- Performing Test HAVE_SOCKADDR_IN6_SIN6_ADDR - Success
-- Performing Test HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID
-- Performing Test HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID - Success
-- Found Perl: /usr/bin/perl (found version "5.36.0") 
-- Looking for connect in socket;
-- Looking for connect in socket; - not found
-- Looking for gethostname
-- Looking for gethostname - found
-- Found OpenSSL: /usr/lib/libcrypto.so (found version "3.0.7")  
-- Looking for RAND_egd
-- Looking for RAND_egd - not found
-- Looking for OPENSSL_IS_BORINGSSL
-- Looking for OPENSSL_IS_BORINGSSL - not found
-- Found ZLIB: /usr/lib/libz.so (found version "1.2.13") 
-- Found LibPSL: /usr/lib/libpsl.so (found version "0.21.2") 
-- Looking for include file inttypes.h
-- Looking for include file inttypes.h - found
-- Looking for include files inttypes.h, sys/filio.h
-- Looking for include files inttypes.h, sys/filio.h - not found
-- Looking for include files inttypes.h, sys/ioctl.h
-- Looking for include files inttypes.h, sys/ioctl.h - found
-- Looking for 3 include files inttypes.h, ..., sys/param.h
-- Looking for 3 include files inttypes.h, ..., sys/param.h - found
-- Looking for 4 include files inttypes.h, ..., sys/poll.h
-- Looking for 4 include files inttypes.h, ..., sys/poll.h - found
-- Looking for 5 include files inttypes.h, ..., sys/resource.h
-- Looking for 5 include files inttypes.h, ..., sys/resource.h - found
-- Looking for 6 include files inttypes.h, ..., sys/select.h
-- Looking for 6 include files inttypes.h, ..., sys/select.h - found
-- Looking for 7 include files inttypes.h, ..., sys/socket.h
-- Looking for 7 include files inttypes.h, ..., sys/socket.h - found
-- Looking for 8 include files inttypes.h, ..., sys/sockio.h
-- Looking for 8 include files inttypes.h, ..., sys/sockio.h - found
-- Looking for 9 include files inttypes.h, ..., sys/stat.h
-- Looking for 9 include files inttypes.h, ..., sys/stat.h - found
-- Looking for 10 include files inttypes.h, ..., sys/time.h
-- Looking for 10 include files inttypes.h, ..., sys/time.h - found
-- Looking for 11 include files inttypes.h, ..., sys/types.h
-- Looking for 11 include files inttypes.h, ..., sys/types.h - found
-- Looking for 12 include files inttypes.h, ..., sys/un.h
-- Looking for 12 include files inttypes.h, ..., sys/un.h - found
-- Looking for 13 include files inttypes.h, ..., sys/utime.h
-- Looking for 13 include files inttypes.h, ..., sys/utime.h - not found
-- Looking for 13 include files inttypes.h, ..., sys/xattr.h
-- Looking for 13 include files inttypes.h, ..., sys/xattr.h - found
-- Looking for 14 include files inttypes.h, ..., arpa/inet.h
-- Looking for 14 include files inttypes.h, ..., arpa/inet.h - found
-- Looking for 15 include files inttypes.h, ..., arpa/tftp.h
-- Looking for 15 include files inttypes.h, ..., arpa/tftp.h - found
-- Looking for 16 include files inttypes.h, ..., fcntl.h
-- Looking for 16 include files inttypes.h, ..., fcntl.h - found
-- Looking for 17 include files inttypes.h, ..., idn2.h
-- Looking for 17 include files inttypes.h, ..., idn2.h - found
-- Looking for 18 include files inttypes.h, ..., ifaddrs.h
-- Looking for 18 include files inttypes.h, ..., ifaddrs.h - found
-- Looking for 19 include files inttypes.h, ..., io.h
-- Looking for 19 include files inttypes.h, ..., io.h - not found
-- Looking for 19 include files inttypes.h, ..., libgen.h
-- Looking for 19 include files inttypes.h, ..., libgen.h - found
-- Looking for 20 include files inttypes.h, ..., locale.h
-- Looking for 20 include files inttypes.h, ..., locale.h - found
-- Looking for 21 include files inttypes.h, ..., net/if.h
-- Looking for 21 include files inttypes.h, ..., net/if.h - found
-- Looking for 22 include files inttypes.h, ..., netdb.h
-- Looking for 22 include files inttypes.h, ..., netdb.h - found
-- Looking for 23 include files inttypes.h, ..., netinet/in.h
-- Looking for 23 include files inttypes.h, ..., netinet/in.h - found
-- Looking for 24 include files inttypes.h, ..., netinet/tcp.h
-- Looking for 24 include files inttypes.h, ..., netinet/tcp.h - found
-- Looking for linux/tcp.h
-- Looking for linux/tcp.h - found
-- Looking for 25 include files inttypes.h, ..., poll.h
-- Looking for 25 include files inttypes.h, ..., poll.h - found
-- Looking for 26 include files inttypes.h, ..., pwd.h
-- Looking for 26 include files inttypes.h, ..., pwd.h - found
-- Looking for 27 include files inttypes.h, ..., setjmp.h
-- Looking for 27 include files inttypes.h, ..., setjmp.h - found
-- Looking for 28 include files inttypes.h, ..., signal.h
-- Looking for 28 include files inttypes.h, ..., signal.h - found
-- Looking for 29 include files inttypes.h, ..., ssl.h
-- Looking for 29 include files inttypes.h, ..., ssl.h - not found
-- Looking for 29 include files inttypes.h, ..., stdatomic.h
-- Looking for 29 include files inttypes.h, ..., stdatomic.h - found
-- Looking for 30 include files inttypes.h, ..., stdbool.h
-- Looking for 30 include files inttypes.h, ..., stdbool.h - found
-- Looking for 31 include files inttypes.h, ..., stdint.h
-- Looking for 31 include files inttypes.h, ..., stdint.h - found
-- Looking for 32 include files inttypes.h, ..., stdlib.h
-- Looking for 32 include files inttypes.h, ..., stdlib.h - found
-- Looking for 33 include files inttypes.h, ..., string.h
-- Looking for 33 include files inttypes.h, ..., string.h - found
-- Looking for 34 include files inttypes.h, ..., strings.h
-- Looking for 34 include files inttypes.h, ..., strings.h - found
-- Looking for 35 include files inttypes.h, ..., stropts.h
-- Looking for 35 include files inttypes.h, ..., stropts.h - not found
-- Looking for 35 include files inttypes.h, ..., termio.h
-- Looking for 35 include files inttypes.h, ..., termio.h - found
-- Looking for 36 include files inttypes.h, ..., termios.h
-- Looking for 36 include files inttypes.h, ..., termios.h - found
-- Looking for 37 include files inttypes.h, ..., time.h
-- Looking for 37 include files inttypes.h, ..., time.h - found
-- Looking for 38 include files inttypes.h, ..., unistd.h
-- Looking for 38 include files inttypes.h, ..., unistd.h - found
-- Looking for 39 include files inttypes.h, ..., utime.h
-- Looking for 39 include files inttypes.h, ..., utime.h - found
-- Looking for 40 include files inttypes.h, ..., stddef.h
-- Looking for 40 include files inttypes.h, ..., stddef.h - found
-- Looking for 42 include files inttypes.h, ..., sys/utsname.h
-- Looking for 42 include files inttypes.h, ..., sys/utsname.h - found
-- Check size of size_t
-- Check size of size_t - done
-- Check size of ssize_t
-- Check size of ssize_t - done
-- Check size of long long
-- Check size of long long - done
-- Check size of long
-- Check size of long - done
-- Check size of int
-- Check size of int - done
-- Check size of __int64
-- Check size of __int64 - failed
-- Check size of time_t
-- Check size of time_t - done
-- Looking for fchmod
-- Looking for fchmod - found
-- Looking for basename
-- Looking for basename - found
-- Looking for socket
-- Looking for socket - not found
-- Looking for socketpair
-- Looking for socketpair - not found
-- Looking for recv
-- Looking for recv - not found
-- Looking for send
-- Looking for send - not found
-- Looking for sendmsg
-- Looking for sendmsg - not found
-- Looking for select
-- Looking for select - found
-- Looking for strdup
-- Looking for strdup - found
-- Looking for strtok_r
-- Looking for strtok_r - found
-- Looking for strcasecmp
-- Looking for strcasecmp - found
-- Looking for stricmp
-- Looking for stricmp - not found
-- Looking for strcmpi
-- Looking for strcmpi - not found
-- Looking for alarm
-- Looking for alarm - found
-- Looking for getppid
-- Looking for getppid - found
-- Looking for utimes
-- Looking for utimes - found
-- Looking for gettimeofday
-- Looking for gettimeofday - found
-- Looking for closesocket
-- Looking for closesocket - not found
-- Looking for sigsetjmp
-- Looking for sigsetjmp - found
-- Looking for getpass_r
-- Looking for getpass_r - not found
-- Looking for getpwuid
-- Looking for getpwuid - found
-- Looking for getpwuid_r
-- Looking for getpwuid_r - found
-- Looking for geteuid
-- Looking for geteuid - found
-- Looking for utime
-- Looking for utime - found
-- Looking for gmtime_r
-- Looking for gmtime_r - found
-- Looking for gethostbyname_r
-- Looking for gethostbyname_r - not found
-- Looking for signal
-- Looking for signal - found
-- Looking for strtoll
-- Looking for strtoll - found
-- Looking for _strtoi64
-- Looking for _strtoi64 - not found
-- Looking for strerror_r
-- Looking for strerror_r - not found
-- Looking for siginterrupt
-- Looking for siginterrupt - found
-- Looking for getaddrinfo
-- Looking for getaddrinfo - not found
-- Looking for freeaddrinfo
-- Looking for freeaddrinfo - not found
-- Looking for pipe
-- Looking for pipe - found
-- Looking for ftruncate
-- Looking for ftruncate - found
-- Looking for getpeername
-- Looking for getpeername - not found
-- Looking for getsockname
-- Looking for getsockname - not found
-- Looking for if_nametoindex
-- Looking for if_nametoindex - not found
-- Looking for getrlimit
-- Looking for getrlimit - found
-- Looking for setlocale
-- Looking for setlocale - found
-- Looking for setmode
-- Looking for setmode - not found
-- Looking for setrlimit
-- Looking for setrlimit - found
-- Looking for snprintf
-- Looking for snprintf - found
-- Looking for mach_absolute_time
-- Looking for mach_absolute_time - not found
-- Looking for inet_ntop
-- Looking for inet_ntop - not found
-- Looking for inet_pton
-- Looking for inet_pton - not found
-- Looking for fsetxattr
-- Looking for fsetxattr - not found
-- Check size of sa_family_t
-- Check size of sa_family_t - done
-- Check size of ADDRESS_FAMILY
-- Check size of ADDRESS_FAMILY - failed
-- Looking for sigaction
-- Looking for sigaction - found
-- Performing Curl Test HAVE_FCNTL_O_NONBLOCK
-- Performing Curl Test HAVE_FCNTL_O_NONBLOCK - Success
-- Performing Curl Test HAVE_IOCTLSOCKET
-- Performing Curl Test HAVE_IOCTLSOCKET - Failed
-- Performing Curl Test HAVE_IOCTLSOCKET_CAMEL
-- Performing Curl Test HAVE_IOCTLSOCKET_CAMEL - Failed
-- Performing Curl Test HAVE_IOCTLSOCKET_CAMEL_FIONBIO
-- Performing Curl Test HAVE_IOCTLSOCKET_CAMEL_FIONBIO - Failed
-- Performing Curl Test HAVE_IOCTLSOCKET_FIONBIO
-- Performing Curl Test HAVE_IOCTLSOCKET_FIONBIO - Failed
-- Performing Curl Test HAVE_IOCTL_FIONBIO
-- Performing Curl Test HAVE_IOCTL_FIONBIO - Success
-- Performing Curl Test HAVE_IOCTL_SIOCGIFADDR
-- Performing Curl Test HAVE_IOCTL_SIOCGIFADDR - Failed
-- Performing Curl Test HAVE_SETSOCKOPT_SO_NONBLOCK
-- Performing Curl Test HAVE_SETSOCKOPT_SO_NONBLOCK - Failed
-- Performing Curl Test TIME_WITH_SYS_TIME
-- Performing Curl Test TIME_WITH_SYS_TIME - Success
-- Performing Curl Test HAVE_O_NONBLOCK
-- Performing Curl Test HAVE_O_NONBLOCK - Failed
-- Performing Curl Test HAVE_GETHOSTBYNAME_R_3
-- Performing Curl Test HAVE_GETHOSTBYNAME_R_3 - Failed
-- Performing Curl Test HAVE_GETHOSTBYNAME_R_5
-- Performing Curl Test HAVE_GETHOSTBYNAME_R_5 - Failed
-- Performing Curl Test HAVE_GETHOSTBYNAME_R_6
-- Performing Curl Test HAVE_GETHOSTBYNAME_R_6 - Failed
-- Performing Curl Test HAVE_GETHOSTBYNAME_R_3_REENTRANT
-- Performing Curl Test HAVE_GETHOSTBYNAME_R_3_REENTRANT - Failed
-- Performing Curl Test HAVE_GETHOSTBYNAME_R_5_REENTRANT
-- Performing Curl Test HAVE_GETHOSTBYNAME_R_5_REENTRANT - Failed
-- Performing Curl Test HAVE_GETHOSTBYNAME_R_6_REENTRANT
-- Performing Curl Test HAVE_GETHOSTBYNAME_R_6_REENTRANT - Failed
-- Performing Curl Test HAVE_IN_ADDR_T
-- Performing Curl Test HAVE_IN_ADDR_T - Success
-- Performing Curl Test HAVE_BOOL_T
-- Performing Curl Test HAVE_BOOL_T - Success
-- Performing Curl Test STDC_HEADERS
-- Performing Curl Test STDC_HEADERS - Success
-- Performing Curl Test HAVE_FILE_OFFSET_BITS
-- Performing Curl Test HAVE_FILE_OFFSET_BITS - Success
-- Performing Curl Test HAVE_VARIADIC_MACROS_C99
-- Performing Curl Test HAVE_VARIADIC_MACROS_C99 - Success
-- Performing Curl Test HAVE_VARIADIC_MACROS_GCC
-- Performing Curl Test HAVE_VARIADIC_MACROS_GCC - Success
-- Performing Curl Test HAVE_ATOMIC
-- Performing Curl Test HAVE_ATOMIC - Success
-- Check size of off_t
-- Check size of off_t - done
-- Check size of curl_off_t
-- Check size of curl_off_t - done
-- Performing Curl Test HAVE_GLIBC_STRERROR_R
-- Performing Curl Test HAVE_GLIBC_STRERROR_R - Failed
-- Performing Curl Test HAVE_POSIX_STRERROR_R
-- Performing Curl Test HAVE_POSIX_STRERROR_R - Success
-- Performing Curl Test HAVE_CLOCK_GETTIME_MONOTONIC
-- Performing Curl Test HAVE_CLOCK_GETTIME_MONOTONIC - Success
-- Performing Curl Test HAVE_BUILTIN_AVAILABLE
-- Performing Curl Test HAVE_BUILTIN_AVAILABLE - Failed
-- Performing Test HAVE_MSG_NOSIGNAL
-- Performing Test HAVE_MSG_NOSIGNAL - Success
-- Performing Test HAVE_STRUCT_TIMEVAL
-- Performing Test HAVE_STRUCT_TIMEVAL - Success
-- Check size of struct sockaddr_storage
-- Check size of struct sockaddr_storage - done
-- Performing Test HAVE_POLL_FINE
-- Performing Test HAVE_POLL_FINE - Failed
-- Enabled features: SSL IPv6 libz Largefile HTTPS-proxy threadsafe PSL
-- Enabled protocols: HTTP HTTPS
-- Enabled SSL backends: OpenSSL
-- Configuring done
-- Generating done
-- Build files have been written to: /home/kartatz/curl

Looking at these logs I see curl was not able to find any socket-related function:

-- Looking for socket
-- Looking for socket - not found
-- Looking for socketpair
-- Looking for socketpair - not found
-- Looking for recv
-- Looking for recv - not found
-- Looking for send
-- Looking for send - not found
-- Looking for sendmsg
-- Looking for sendmsg - not found

But they are all properly defined in the sys/socket.h header:

$ grep --extended-regexp '(sendmsg|socketpair|socket|send|recv)\(' "${HOME}/unknown-unknown-haiku/x86_64-unknown-haiku/develop/headers/posix/sys/socket.h"
ssize_t recv(int socket, void *buffer, size_t length, int flags);
ssize_t send(int socket, const void *buffer, size_t length, int flags);
ssize_t	sendmsg(int socket, const struct msghdr *message, int flags);
int		socket(int domain, int type, int protocol);
int		socketpair(int domain, int type, int protocol, int socketVector[2]);

After a bit of research I found out Haiku requires all socket programs to link against -lnetwork (source).

So I changed the C compiler command invocation from:

-DCMAKE_C_COMPILER=${HOME}/unknown-unknown-haiku/bin/x86_64-unknown-haiku-gcc

to

-DCMAKE_C_COMPILER="${HOME}/unknown-unknown-haiku/bin/x86_64-unknown-haiku-gcc -lnetwork"

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.

curl/libcurl version

Latest master.

operating system

$ uname -a
Linux archlinux 6.1.5-arch2-1 #1 SMP PREEMPT_DYNAMIC Thu, 12 Jan 2023 22:42:33 +0000 x86_64 GNU/Linux
@bagder
Copy link
Member

bagder commented Jan 14, 2023

-- Looking for recv - not found

I would probably suggest you try using configure instead, which is a more mature build for curl.

@bagder bagder added the cmake label Jan 14, 2023
renodr pushed a commit to renodr/curl that referenced this issue Mar 19, 2023
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
@renodr
Copy link
Contributor

renodr commented Mar 19, 2023

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.

@renodr
Copy link
Contributor

renodr commented Mar 19, 2023

For users building cURL on Haiku using CMake, I suggest:

cmake -DCMAKE_C_COMPILER=gcc-x86 .

This results in a successful compilation of libcurl and the 'curl' command line utility for me

@bagder bagder closed this as completed in 0c94396 Mar 22, 2023
Kartatz added a commit to AmanoTeam/Ara that referenced this issue Mar 23, 2023
bch pushed a commit to bch/curl that referenced this issue Jul 19, 2023
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
Closes curl#10792
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging a pull request may close this issue.

3 participants