guijan / libobsd Goto Github PK
View Code? Open in Web Editor NEWTransparent OpenBSD compatibility library and libbsd alternative
License: Other
Transparent OpenBSD compatibility library and libbsd alternative
License: Other
I made the libobsd copy of OpenBSD's getopt()
include an optreset
variable, but not the OpenBSD getopt()
implementation if it detects the system has a getopt()
. This might make some programs work just fine, but it's best to include the whole implementation in this case to make all programs work as they should.
I should switch to https://github.com/termux/termux-docker/ which is maintained
scoop
Minimal (?) reproduction:
subprojects/libobsd.wrap:
[wrap-git]
url = https://github.com/guijan/libobsd.git
revision = 9942023632f9c5a5b32db61cee6d37e996e0b1dd
depth = 1
[provide]
libbsd-overlay = libobsd_dep
libobsd = libobsd_dep
meson.build:
project('libobsd-test', ['cpp'])
libbsd_dep = dependency('libbsd-overlay')
test_src = files('main.cpp')
e = executable(
'my-test',
[test_src],
dependencies : [libbsd_dep],
install: false,
)
test('my-test', e)
main.cpp:
#include <string.h>
main(void)
{
char buf[16];
strlcat(buf, "another test string", sizeof(buf));
}
Output
PS C:\Users\i1B583116\src\libobsd-test> meson test -C .\builddir\ --suite 'libobsd-test'
ninja: Entering directory `C:\Users\i1B583116\src\libobsd-test\builddir'
[2/2] Linking target my-test.exe
FAILED: my-test.exe
"g++" -o my-test.exe my-test.exe.p/main.cpp.obj "-Wl,--allow-shlib-undefined" "-Wl,--start-group" "subprojects\libobsd\libobsd.a" "-lbcrypt" "-lbcrypt" "-Wl,--subsystem,console" "-lkernel32" "-luser32" "-lgdi32" "-lwinspool" "-lshell32" "-lole32" "-loleaut32" "-luuid" "-lcomdlg32" "-ladvapi32" "-Wl,--end-group"
c:/users/_/scoop/apps/gcc/11.2.0/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: my-test.exe.p/main.cpp.obj:C:\Users\_\src\libobsd-test\builddir/../main.cpp:6: undefined reference to `__imp_strlcat'
collect2.exe: error: ld returned 1 exit status
The libobsd test builds also fail if --suite
is not specified.
I believe this has something to do with the -DOBSD_IMPORTING
flag and the resulting dllimport
lines. When I prevent it from being added the build succeeds.
I falsely believed it was possible to hide symbols on Unix when statically linking, so the library was developed with this incorrect belief. Private symbols should be qualified with something to reduce the likelihood of clashes with whatever users have, and so I can blame the other party in case they use those symbols and complain their behaviors change.
I need to investigate a better setproctitle() implementation for Linux.
According to the prctl() man page: https://man7.org/linux/man-pages/man2/prctl.2.html
Linux 3.5's prctl()
has PR_SET_MM_ARG_START
and PR_SET_MM_ARG_END
which "Set the address above/below which the program command line is placed." This should allow me to change the program title much more easily.
Sometimes, the Windows CI fails. This seems to only affect MSYS2 environments and a retry usually works. I need to investigate what is the source of these failures.
I can't reproduce the issue on real hardware, and there is no diagnostic output in the CI. This bug is very hard to fix.
I incorrectly believed it defaulted to the project version.
compiling libtirpc with musl (which has no sys/queue.h) errors with:
../src/clnt_bcast.c:43:10: fatal error: sys/queue.h: No such file or directory
43 | #include <sys/queue.h>
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.