Skip to content

Conversation

@quic-vkatoch
Copy link
Contributor

@quic-vkatoch quic-vkatoch commented Jan 19, 2026

Check for libbsd on non-Android targets and export BSD_CFLAGS and BSD_LIBS. Include BSD flags in CFLAGS and link BSD libs alongside YAML libs.

Add libbsd-dev:arm64 to ARM64 workflows and ensure libbsd-dev is in build_linux_gnu.yml.

Technical Details

@BSD_CFLAGS@ adds the BSD include path (e.g., -isystem /usr/include/bsd). With libbsd-overlay, when <string.h> is included, the BSD header chain is pulled in indirectly through the overlay mechanism.

As a result, the compiler sees the strlcpy/strlcat prototypes and no longer warns about implicit declarations, without requiring an explicit #include <bsd/string.h>.

Changes

  • configure.ac: Added PKG_CHECK_MODULES for libbsd-overlay on non-Android builds
  • src/Makefile.am: Added @BSD_CFLAGS@ to LIBDSPRPC_CFLAGS and @BSD_LIBS@ to library link flags
  • Workflows: Updated CI workflows to install libbsd-dev package for Linux builds

Fixes: #265

@quic-vkatoch quic-vkatoch marked this pull request as draft January 19, 2026 08:12
@quic-vkatoch quic-vkatoch changed the title Add libbsd support for non-Android builds Add libbsd support for non-Android builds and update CI workflows Jan 19, 2026
Copy link
Contributor

@lumag lumag left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Commit message doesn't answer on the 'why?' question.

@quic-vkatoch quic-vkatoch marked this pull request as ready for review January 20, 2026 08:42
Standard glibc does not provide BSD-specific string functions like
strlcpy and strlcat, which are needed for safe string operations.
Android includes these functions natively, but Linux GNU builds
require an external library to provide them.

Add dependency on libbsd-overlay for non-Android targets to provide
the missing BSD functions. Configure the build system to detect and
link against libbsd when building for Linux GNU platforms.

Signed-off-by: Vinayak Katoch <vkatoch@qti.qualcomm.com>
Add libbsd-dev:arm64 to ARM64 workflows (build_linux_arm64.yml,
codeql.yml, abi-compat.yml) and ensure libbsd-dev is in
build_linux_gnu.yml to resolve configure errors during compilation.

Signed-off-by: Vinayak Katoch <vkatoch@qti.qualcomm.com>
@ekanshibu ekanshibu merged commit 2d08520 into qualcomm:development Jan 21, 2026
21 of 22 checks passed
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.

Compilation problems and not working binary under linux: implicit declaration of function 'strlcpy'

4 participants