Skip to content

build for AppleTVOS failed because of fork/execl is unavailable #9847

@Cering

Description

@Cering

I did this

  • build curl for AppleTVOS like this:
#!/bin/bash

arch=arm64
host=arm-apple-darwin
sdkName=appletvos
sdkPath=$(xcrun -sdk ${sdkName} --show-sdk-path)

export DEPLOYMENT_TARGET=9.0
export CFLAGS="-arch ${arch} -isysroot ${sdkPath} -m${sdkName}-version-min=${DEPLOYMENT_TARGET} -pipe -Os -gdwarf-2 -fembed-bitcode"
export LDFLAGS="-arch ${arch} -isysroot ${sdkPath}"

set -e

./configure --host=${host}\
            --with-random=/dev/urandom \
            --with-secure-transport

make clean

make -j8 V=1
  • the configure is correct, but the make is failed, error: 'fork' is unavailable: not available on tvOS
Making all in lib
/Applications/Xcode.app/Contents/Developer/usr/bin/make  all-am
/bin/sh ../libtool  --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H   -I../include -I../lib -I../lib -DBUILDING_LIBCURL  -DCURL_HIDDEN_SYMBOLS   -fvisibility=hidden -arch arm64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS14.0.sdk -mappletvos-version-min=9.0 -pipe -Os -gdwarf-2 -fembed-bitcode -Qunused-arguments -Wno-pointer-bool-conversion -Werror=partial-availability  -MT libcurl_la-curl_ntlm_wb.lo -MD -MP -MF .deps/libcurl_la-curl_ntlm_wb.Tpo -c -o libcurl_la-curl_ntlm_wb.lo `test -f 'curl_ntlm_wb.c' || echo './'`curl_ntlm_wb.c
libtool: compile:  gcc -DHAVE_CONFIG_H -I../include -I../lib -I../lib -DBUILDING_LIBCURL -DCURL_HIDDEN_SYMBOLS -fvisibility=hidden -arch arm64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS14.0.sdk -mappletvos-version-min=9.0 -pipe -Os -gdwarf-2 -fembed-bitcode -Qunused-arguments -Wno-pointer-bool-conversion -Werror=partial-availability -MT libcurl_la-curl_ntlm_wb.lo -MD -MP -MF .deps/libcurl_la-curl_ntlm_wb.Tpo -c curl_ntlm_wb.c  -fno-common -DPIC -o.libs/libcurl_la-curl_ntlm_wb.o
curl_ntlm_wb.c:200:15: error: 'fork' is unavailable: not available on tvOS
  child_pid = fork();
              ^
/Applications/Xcode.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS14.0.sdk/usr/include/unistd.h:447:8: note: 'fork' has been explicitly marked
      unavailable here
pid_t    fork(void) __WATCHOS_PROHIBITED __TVOS_PROHIBITED;
         ^
curl_ntlm_wb.c:228:7: error: 'execl' is unavailable: not available on tvOS
      execl(ntlm_auth, ntlm_auth,
      ^
/Applications/Xcode.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS14.0.sdk/usr/include/unistd.h:441:6: note: 'execl' has been explicitly
      marked unavailable here
int      execl(const char * __path, const char * __arg0, ...) __WATCHOS_PROHIBITED __TVOS_PROHIBITED;
         ^
curl_ntlm_wb.c:235:7: error: 'execl' is unavailable: not available on tvOS
      execl(ntlm_auth, ntlm_auth,
      ^
/Applications/Xcode.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS14.0.sdk/usr/include/unistd.h:441:6: note: 'execl' has been explicitly
      marked unavailable here
int      execl(const char * __path, const char * __arg0, ...) __WATCHOS_PROHIBITED __TVOS_PROHIBITED;
         ^
3 errors generated.
make[2]: *** [libcurl_la-curl_ntlm_wb.lo] Error 1
make[1]: *** [all] Error 2
make: *** [all-recursive] Error 1

I expected the following

curl/libcurl version

curl-7.85.0.tar.gz Release

operating system

$ uname -a
Darwin my-macmini.local 19.6.0 Darwin Kernel Version 19.6.0: Mon Apr 18 21:50:40 PDT 2022; root:xnu-6153.141.62~1/RELEASE_X86_64 x86_64

$ xcodebuild -version
Xcode 12.0
Build version 12A7209

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions