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

unbound-control.c:882:6: error: 'execlp' is unavailable: not available on tvOS #188

Closed
noloader opened this issue Mar 10, 2020 · 2 comments

Comments

@noloader
Copy link
Contributor

noloader commented Mar 10, 2020

Hi Everyone, @wcawijngaards,

I'm testing Unbound Master on iOS. The testing below is on AppleTVOS. WatchOS and the simulators will produce a similar result.

libtool: compile:  clang -I. -I/Users/travis/AppleTVOS-arm64/include -I/Users/travis/AppleTVOS-arm64/include -DSRCDIR=.
-arch arm64 -mappletvos-version-min=6 --sysroot=/Applications/Xcode-10.0.app/Contents/Developer/Platforms/
AppleTVOS.platform/Developer/SDKs/AppleTVOS12.0.sdk -c smallapp/unbound-control.c -o unbound-control.o

smallapp/unbound-control.c:882:6: error: 'execlp' is unavailable: not available on tvOS
                if(execlp("unbound", "unbound", "-c", cfgfile, 
                   ^

/Applications/Xcode-10.0.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS12.0.sdk/
usr/include/unistd.h:442:6: note: 'execlp' has been explicitly marked unavailable here
int      execlp(const char * __file, const char * __arg0, ...) __WATCHOS_PROHIBITED __TVOS_PROHIBITED;
         ^
1 error generated.

We may need to add ac_cv_func_execlp=no to configure. Otherwise, I believe Autotools [incorrectly] guesses execlp is available. (Commit 84864caeefb0 tries the ac_cv_func_execlp=no fix).

This result depends upon PR #187. The 187 PR updates Android and iOS and adds iOS simulator testing to Travis.

Also see Travis test 660761901.

@noloader
Copy link
Contributor Author

noloader commented Mar 10, 2020

Adding ac_cv_func_execlp=no to configure was not successful. Maybe you can add an Autootools test for the <TargetConditionals.h> header. Then you can add this to unbound-control.c:

#ifdef HAVE_TARGETCONDITIONALS_H
#include <TargetConditionals.h>
#endif

And then disable execlp if TARGET_OS_TV or TARGET_OS_WATCH is defined. Maybe something like:

	if(argc >= 1 && strcmp(argv[0], "start")==0) {
#if defined(TARGET_OS_TV) || defined(TARGET_OS_WATCH)
		fatal_exit("could not exec unbound: %s",
			strerror(ENOSYS));
#else
		if(execlp("unbound", "unbound", "-c", cfgfile, 
			(char*)NULL) < 0) {
			fatal_exit("could not exec unbound: %s",
				strerror(errno));
		}
#endif
	}

This has the benefit of being self sufficient. It does not require users to add ac_cv_func_execlp=no to configure to avoid a wrong guess by Autotools during cross-compiles.

@wcawijngaards
Copy link
Member

wcawijngaards commented Mar 11, 2020

The commit with the targetconditionals header was imported. The other one with AC_FUNC configure tests is not imported (it looks unused). I removed a whitespace in configure.ac, and remade the configure script. This should import the fixes you had into the master branch on github.

If it does not really work, i.e. after you import it and travis runs, reopen or make a new issue. Thanks for the test and code suggestions!

jedisct1 added a commit to jedisct1/unbound that referenced this issue Mar 20, 2020
* nlnet/master: (149 commits)
  - Fix .travis.yml error, missing 'env' option.
  - Merge PR#194: Add libevent testing to Travis, by Jeffrey Walton.
  Add changelog entries for PR#134.
  - Log warning when using outgoing-port-permit and outgoing-port-avoid   while explicit port randomisation is disabled.
  - Fix NLnetLabs#158: open tls-session-ticket-keys as binary, for Windows. By Daisuke   HIGASHI.
  - Merge PR#191: Update iOS testing on Travis, by Jeffrey Walton.
  Add libevent testing to Travis
  Sync with upstream
  - Fix NLnetLabs#192: In the unbound-checkconf tool, the module config of   dns64 subnetcache respip validator iterator is whitelisted, it was   reported it seems to work.
  - Fix compile of test tools without protobuf.
  - Add check to make sure RPZ records are subdomain of configured zone origin.
  - Changelog entry for (Fix NLnetLabs#189, Merge PR NLnetLabs#190).
  Changelog for NLnetLabs#188 and configure script created.  Removed unneeded whitespace.
  Fix NLnetLabs#188: unbound-control.c:882:6: error: 'execlp' is unavailable: not available on tvOS
  Fix NetBSD compile (GH NLnetLabs#189)
  - Changelog note for PR NLnetLabs#186: Fix unrecognized 'echo -n' option on OS X,   by noloader.
  Fix unrecognized 'echo -n' option on OS X Also see NLnetLabs#183. This PR also updates a few typos in README-Travis.md, and expands the discussion of PKG_CONFIG_PATH for those who are not familiar with it.
  Fix changelog note, it is NLnetLabs#182, not NLnetLabs#184.
  Changelog note for NLnetLabs#184. - Fix PR NLnetLabs#184 from noloader: Add iOS testing to Travis.
  Add iOS testing to Travis
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants