Skip to content

Fix linking for libnetwork on Haiku, resolves undefined references to socket a…#256

Open
Begasus wants to merge 1 commit into
LudovicRousseau:masterfrom
Begasus:haiku_libnetwork
Open

Fix linking for libnetwork on Haiku, resolves undefined references to socket a…#256
Begasus wants to merge 1 commit into
LudovicRousseau:masterfrom
Begasus:haiku_libnetwork

Conversation

@Begasus
Copy link
Copy Markdown

@Begasus Begasus commented May 13, 2026

…nd friends

… socket and friends

Co-authored-by: Panagiotis Vasilopoulos <hello@alwayslivid.com>
@Begasus Begasus force-pushed the haiku_libnetwork branch from 9cbae0e to b226e0b Compare May 13, 2026 12:10
@Begasus Begasus changed the title Fix linking for libnetwork, resolves undefined references to socket a… Fix linking for libnetwork on Haiku, resolves undefined references to socket a… May 13, 2026
@Begasus
Copy link
Copy Markdown
Author

Begasus commented May 13, 2026

I could add the check for libbsd (issetugid) in here too, or do you prefer a seperate PR for that?

@LudovicRousseau
Copy link
Copy Markdown
Owner

Can you include, in the commit message, the error(s) you get without the fix?

The configure.ac file is no more maintained. The version still indicates 2.2.0 instead of 2.4.1.
I guess the problem is also present when built with meson command. Exact?

@LudovicRousseau LudovicRousseau self-requested a review May 13, 2026 14:57
@LudovicRousseau LudovicRousseau self-assigned this May 13, 2026
@Begasus
Copy link
Copy Markdown
Author

Begasus commented May 13, 2026

Can you include, in the commit message, the error(s) you get without the fix?

The configure.ac file is no more maintained. The version still indicates 2.2.0 instead of 2.4.1. I guess the problem is also present when built with meson command. Exact?

Haven't checked a build with meson, will report back.

@Begasus
Copy link
Copy Markdown
Author

Begasus commented May 13, 2026

With meson build:

/Opslag/haikuports/sys-apps/pcsc_lite/download/pcsc-lite-2.4.1> ninja -C build
ninja: Entering directory `build'
[42/46] Linking target libpcsclite_real.so.1
FAILED: [code=1] libpcsclite_real.so.1 
cc  -o libpcsclite_real.so.1 libpcsclite_real.so.1.p/src_debug.c.o libpcsclite_real.so.1.p/src_winscard_clnt.c.o libpcsclite_real.so.1.p/src_simclist.c.o libpcsclite_real.so.1.p/src_sys_unix.c.o libpcsclite_real.so.1.p/src_utils.c.o libpcsclite_real.so.1.p/src_winscard_msg.c.o -Wl,--as-needed -Wl,--no-undefined -Wl,-O1 -shared -fPIC -Wl,-soname,libpcsclite_real.so.1 -lbsd
/boot/system/develop/tools/bin/../lib/gcc/x86_64-unknown-haiku/13.3.0/../../../../x86_64-unknown-haiku/bin/ld: libpcsclite_real.so.1.p/src_winscard_msg.c.o: in function `ClientSetupSession':
winscard_msg.c:(.text+0xe0): undefined reference to `socket'
/boot/system/develop/tools/bin/../lib/gcc/x86_64-unknown-haiku/13.3.0/../../../../x86_64-unknown-haiku/bin/ld: winscard_msg.c:(.text+0x13b): undefined reference to `connect'
/boot/system/develop/tools/bin/../lib/gcc/x86_64-unknown-haiku/13.3.0/../../../../x86_64-unknown-haiku/bin/ld: libpcsclite_real.so.1.p/src_winscard_msg.c.o: in function `MessageSend':
winscard_msg.c:(.text+0x4b3): undefined reference to `send'
collect2: error: ld returned 1 exit status
[43/46] Linking target pcscd
FAILED: [code=1] pcscd 
cc  -o pcscd pcscd.p/meson-generated_configfile.c.o pcscd.p/meson-generated_tokenparser.c.o pcscd.p/src_atrhandler.c.o pcscd.p/src_auth.c.o pcscd.p/src_debuglog.c.o pcscd.p/src_dyn_unix.c.o pcscd.p/src_eventhandler.c.o pcscd.p/src_hotplug_generic.c.o pcscd.p/src_hotplug_libudev.c.o pcscd.p/src_hotplug_libusb.c.o pcscd.p/src_ifdwrapper.c.o pcscd.p/src_pcscdaemon.c.o pcscd.p/src_prothandler.c.o pcscd.p/src_readerfactory.c.o pcscd.p/src_simclist.c.o pcscd.p/src_sys_unix.c.o pcscd.p/src_utils.c.o pcscd.p/src_winscard.c.o pcscd.p/src_winscard_msg.c.o pcscd.p/src_winscard_msg_srv.c.o pcscd.p/src_winscard_svc.c.o -Wl,--as-needed -Wl,--no-undefined -Wl,-O1 -Wl,-export-dynamic -lbsd
/boot/system/develop/tools/bin/../lib/gcc/x86_64-unknown-haiku/13.3.0/../../../../x86_64-unknown-haiku/bin/ld: pcscd.p/src_winscard_msg.c.o: in function `MessageSend':
winscard_msg.c:(.text+0x63): undefined reference to `send'
/boot/system/develop/tools/bin/../lib/gcc/x86_64-unknown-haiku/13.3.0/../../../../x86_64-unknown-haiku/bin/ld: pcscd.p/src_winscard_msg_srv.c.o: in function `InitializeSocket':
winscard_msg_srv.c:(.text+0x18): undefined reference to `socket'
/boot/system/develop/tools/bin/../lib/gcc/x86_64-unknown-haiku/13.3.0/../../../../x86_64-unknown-haiku/bin/ld: winscard_msg_srv.c:(.text+0x9c): undefined reference to `bind'
/boot/system/develop/tools/bin/../lib/gcc/x86_64-unknown-haiku/13.3.0/../../../../x86_64-unknown-haiku/bin/ld: winscard_msg_srv.c:(.text+0xb4): undefined reference to `listen'
/boot/system/develop/tools/bin/../lib/gcc/x86_64-unknown-haiku/13.3.0/../../../../x86_64-unknown-haiku/bin/ld: pcscd.p/src_winscard_msg_srv.c.o: in function `ProcessEventsServer':
winscard_msg_srv.c:(.text+0x250): undefined reference to `accept'
collect2: error: ld returned 1 exit status
[44/46] Generating symbol file libpcsclite.so.1.p/libpcsclite.so.1.symbols
ninja: build stopped: subcommand failed.

@Begasus
Copy link
Copy Markdown
Author

Begasus commented May 13, 2026

Doing a export LDFLAGS="-lbsd -lnetwork" works also with meson, build without the -lbsd export fails on:

/Opslag/haikuports/sys-apps/pcsc_lite/download/pcsc-lite-2.4.1> ninja -C build
ninja: Entering directory `build'
[24/46] Linking target libpcsclite.so.1
FAILED: [code=1] libpcsclite.so.1 
cc  -o libpcsclite.so.1 libpcsclite.so.1.p/src_error.c.o libpcsclite.so.1.p/src_g_defines.c.o libpcsclite.so.1.p/src_libredirect.c.o libpcsclite.so.1.p/src_sys_unix.c.o -Wl,--as-needed -Wl,--no-undefined -Wl,-O1 -shared -fPIC -Wl,-soname,libpcsclite.so.1
/boot/system/develop/tools/bin/../lib/gcc/x86_64-unknown-haiku/13.3.0/../../../../x86_64-unknown-haiku/bin/ld: libpcsclite.so.1.p/src_sys_unix.c.o: in function `SYS_GetEnv':
sys_unix.c:(.text+0xed): undefined reference to `issetugid'
collect2: error: ld returned 1 exit status
[39/46] Compiling C object pcsc_demo.p/doc_example_pcsc_demo.c.o
ninja: build stopped: subcommand failed.

@Begasus
Copy link
Copy Markdown
Author

Begasus commented May 13, 2026

I guess this can be closed, doing export LDFLAGS="-lbsd -lnetwork" also does the trick for autotools.

@LudovicRousseau
Copy link
Copy Markdown
Owner

Using export LDFLAGS="-lbsd -lnetwork" would work.

It would be better to fix the issue with a smarter meson.build.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants