On Tue, Nov 14, 2017 at 4:00 PM, Bob Friesenhahn <bfrie...@simple.dallas.tx.us> wrote: >>> Or maybe something else? >> >> It looks like the extra files provided by libtool are the problem. It >> looks like the libtool folks need to add _XOPEN_SOURCE=600 to their >> preprocessor definitions. I'm guessing they only test with a C >> compiler, and not a C++ compiler and Newlib combination. > > What does spawnv have to do with _XOPEN_SOURCE? Isn't spawnv a Microsoft > Windows-specific function and _XOPEN_SOURCE is a Unix thing?
I think spawn is Posix, and its for systems that don't have fork. posix_spawn and _spawn are deprecated on MS platforms. They use an ISO C++ version called spawnl. Also see https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/spawnl-wspawnl. Its been my experience that when something Posix goes missing when using Newlib the first thing to try is _XOPEN_SOURCE=500 or _XOPEN_SOURCE=600. _XOPEN_SOURCE sets _POSIX_SOURCE and a couple of others, like some X11 defines. Adding _XOPEN_SOURCE=600 to flags clears the issue for me, but I prefer not to use it. The flags are supposed to be consistent among libraries and programs, so I have to tell users to add it too. RTFM has not really worked in the last 50 years or so, and most people will naturally omit it, so I would like to drop the additional requirement. Jeff