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

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

Closed
Cering opened this issue Nov 3, 2022 · 2 comments
Closed

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

Cering opened this issue Nov 3, 2022 · 2 comments
Labels

Comments

@Cering
Copy link
Contributor

Cering commented Nov 3, 2022

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
@Cering
Copy link
Contributor Author

Cering commented Nov 3, 2022

  • I tried to rebuild without ntlm support by ./configure --disable-ntlm, and that success
  • the old curl version have a macro HAVE_FORK to control use fork(), but now it disappear
  • or maybe ... always disable-ntlm on AppleTVOS?

@bagder bagder added the build label Nov 3, 2022
@bagder
Copy link
Member

bagder commented Nov 3, 2022

The ntml_wb code never used the HAVE_FORK define though, so we probably had some other way to stop it from being built for this OS. But it would certainly make sense to have it depend on fork.

bagder added a commit that referenced this issue Nov 5, 2022
Reported-by: ウさん

Fixes #9847
@bagder bagder closed this as completed in 592107f Nov 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging a pull request may close this issue.

2 participants