[pcre-dev] [Bug 2561] cmake: properly check for mkostemp (ne…

Kezdőlap
Üzenet törlése
Szerző: admin
Dátum:  
Címzett: pcre-dev
Tárgy: [pcre-dev] [Bug 2561] cmake: properly check for mkostemp (needed by sljit ProtExecutableAllocator)
https://bugs.exim.org/show_bug.cgi?id=2561

--- Comment #1 from Carlo Marcelo Arenas Belón <carenas@???> ---
a few caveats from the proposed patch that would be worth noting:

* mkostemp is only used in NetBSD 7.2 as the newer versions use a different
codepath, so technically this test is not needed there but doesn't hurt and
would work anyway because mkostemp was added in NetBSD 7.0 and so all currently
supported versions have it.
* NetBSD doesn't need -D_GNU_SOURCE to use mkostemp so that part of the patch
would just add that flag unnecessarily but doesn't harm and it is needed for
Linux, so this simplifies the test.
* the check uses stdlib.h which is not checked independently but both Linux and
NetBSD have it and use it to define mkostemp; eitherway if the header will be
missing the test will fail so the result is the same.
* some other systems (ex: macOS) define mkostemp in a different header and
could still fail the test but that is considered a feature, since that codebase
is only used in NetBSD and Linux and its use somewhere else is not encouraged
* even without this patch the code would compile (in NetBSD and Linux) and work
because sljit has a duplicate declaration for mkostemp in its codebase so this
patch is not needed for 10.35 (unless sljit gets updated, as that duplicate is
gone from the current master), without this patch and an updated sljit the code
will compile and work but will throw a warning because no declarations was
found for that function.
* most other systems trying to compile this code will fail because they are
missing secure_getenv (as shown in bug 2155), but that is a feature. a similar
check for secure_getenv is therefore not needed as NetBSD already has a
fallback and the rest are not supported. this could be made simpler by
removing the option (both in configure and cmake) for this feature unless
running in a supported system, but that would be a different proposed change
(again, not aimed to 10.35) and is otherwise orthogonal to this specific
change.

--
You are receiving this mail because:
You are on the CC list for the bug.