Updating build to hopefully allow OSX builds.

dlsym opcode modified so that 0 for library is converted
to RTLD_DEFAULT as the two don't match on Darwin.

Made errno an opcode, as previous method depended on Linux internals.
[1] https://opensource.apple.com/source/xnu/xnu-201/osfmk/libsa/errno.h.auto.html
[2] https://pubs.opengroup.org/onlinepubs/9699919799/functions/errno.html
Placed errno in internals and then alias inside posix vocabulary,
as it seemed a waste to have another builtin stub for one symbol.
Arguably maybe dlsym should be that way too, but leaving for now.

Added OS make variable to conditionally set flags.
Set stripping / minimization options based on it.

Based off of
https://github.com/flagxor/ueforth/pull/3
Thanks Ulrich!
This commit is contained in:
Brad Nelson
2023-01-21 20:11:42 -08:00
parent 6ed9c2141e
commit adfd238ee2
3 changed files with 32 additions and 11 deletions

View File

@ -69,8 +69,9 @@ z" readdir" 1 sysfunc readdir
: .d_name ( a -- z ) 19 + ;
( Errno )
z" __errno_location" 0 sysfunc __errno_location
: errno ( -- n ) __errno_location sl@ ;
also internals
: errno ( -- n ) errno ;
previous
( Default Pipes )
0 constant stdin