How choose the libgpiod.so library version 2 instead of 3

Hello,

I am working with scarthgap 7.4 and i need to build an image with the library libgpiod.so.2, not libgpiod.so.3 , i understud that the library libgpiod.so.2 use the version 1.x instead libgpiod.so.3 use the version 2.x. Now i tried some configuration to take it and at the end i have removed the file meta-openembedded/meta-oe/recipes-support/libgpiod/libgpiod_2.1.2.bb and leave only meta-openembedded/meta-oe/recipes-support/libgpiod/libgpiod_1.6.4.bb ,but always the libgpiod.so.3 is created.

What can i do to solve this problem related with a legacy application ?.

Thank you for help.

Regards

Flavio Gobber

Hi, I’m the Toradex AI Assistant.

I might make mistakes or occasionally get you wrong. Our support team will step in if needed.


I’d be glad to help with your libgpiod version requirement! To provide the most accurate guidance for your Yocto build configuration, could you let me know which hardware platform and OS version you are using? You can run the tdx-info command on your device to get this information - more details are available at https://developer.toradex.com/software/development-resources/tdx-info/.

This will help me provide specific instructions for configuring your Yocto build to use libgpiod version 1.x (libgpiod.so.2) instead of version 2.x (libgpiod.so.3) for your legacy application requirements.

Best regards, Toradex AI Assistant.


Did you like my answer? :+1: :-1:

If I answered your question, please tick the “Solution” checkbox.

For follow-up questions to me, please use @ToradexAI in your post.

root@IEC-Linux-260223-002-08-40:~# tdx-info

Software summary

Bootloader: U-Boot

Kernel version: 6.6.101-5.7.1-devel-7.4.0-devel #1 SMP PREEMPT Thu Sep 25 07:49:28 UTC 2025
Kernel command line: root=PARTUUID=076c4a2a-02 ro rootwait net.ifnames=0 biosdevname=0
Distro name: NAME=“TDX Wayland with XWayland”
Distro version: VERSION_ID=7.4.0-devel-20251106113704-build.0
Distro variant: -
Hostname: IEC-Linux-260223-002-08-40

Hardware info

HW model: Toradex Colibri iMX8QXP on DRTS

Toradex version: 0050 V1.0D
Serial number: 14791379
Processor arch: aarch64

Thank you for providing the system information! I can see you’re using a Colibri iMX8QXP with BSP 7.4.0 and the TDX Wayland distribution (1).

For your libgpiod version requirement, you’ll need to modify your Yocto build configuration to force the use of libgpiod version 1.x instead of 2.x. Here’s how to address this in your Yocto build:

Solution Approaches

1. Recipe Preference Method

Create a custom layer or modify your local.conf to prefer the older libgpiod version by adding:

PREFERRED_VERSION_libgpiod = "1.6.4"

(2)

2. bbappend Override Method

Create a .bbappend file in your custom layer to override the libgpiod recipe selection and ensure the 1.x version is built with the correct library naming.

3. Layer Priority Adjustment

Since you’re working with the meta-openembedded layer, you may need to adjust layer priorities in your bblayers.conf to ensure your preferred version takes precedence (2).

Important Configuration Notes

When building for NXP-based SoMs like your Colibri iMX8QXP, ensure you have the following in your local.conf:

ACCEPT_FSL_EULA = "1"

(2)

The issue you’re experiencing where libgpiod.so.3 is still being created despite removing the 2.1.2 recipe suggests that the build system may have cached dependencies or that another recipe is pulling in the newer version.

Recommended Steps

  1. Clean your build environment completely: bitbake -c cleanall libgpiod
  2. Verify no other recipes depend on libgpiod 2.x
  3. Apply the PREFERRED_VERSION setting in your local.conf
  4. Rebuild your image

This approach should ensure your legacy application gets the libgpiod.so.2 library it requires while maintaining compatibility with the BSP 7.4.0 framework (3).

Best regards, Toradex AI Assistant.


Did you like my answer? :+1: :-1:

If I answered your question, please tick the “Solution” checkbox.

For follow-up questions to me, please use @ToradexAI in your post.

Hello @flavio,

The recommended approach would be to compile your program so that it is linked against the correct library in your system.

For that, I recommend that you compile your application either in a Yocto recipe or using the SDK which Yocto can generate: Linux SDKs | Toradex Developer Center

Best Regards,
Bruno