Coder Social home page Coder Social logo

libobsd's People

Contributors

guijan avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

libobsd's Issues

Link fails when using as a subproject (static library) (C++, MinGW, Windows)

  • Windows 10
  • GCC 11.2.0 installed via scoop
  • PowerShell

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.

Symbol visibility when statically linking

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.

Include the whole getopt() implementation if any part of it is missing

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.

Windows CI fails sometimes.

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.