Skip to contentSkip to conversation

multilib_header class: issue with custom multilib setup

scarthgap Joao Marcos Costa 3 participants 8 messages Apr 3, 2025

lore
Share & tools
lore
#0 lore raw

Hello,

I'm facing the conflict below (among other conflicts of the same kind) during the rootfs creation of my image, and I would like to ask for some help on this:

file /usr/include/gnu/lib-names-lp64d.h conflicts between attempted installs of libcfi-libc6-dev-2.37-r0.riscv64cfi and libc6-dev-2.37-r0.riscv64

AFAIK, multilib_header.bbclass is meant to handle this kind of situation, so I tried the approach below:

do_install:append() {
oe_multilib_header gnu/lib-names-lp64d.h
}

this one too, just in case:

do_install:append:virtclass-multilib-libcfi() {
oe_multilib_header gnu/lib-names-lp64d.h
}

Am I missing something here?

With both approaches, I get the error below:

file /usr/include/gnu/lib-names-lp64d-64.h conflicts between attempted installs of libcfi-libc6-dev-2.37-r0.riscv64cfi and libc6-dev-2.37-r0.riscv64

and if I try running 'bitbake -c rootfs myimage' once again:

file /usr/include/gnu/lib-names-lp64d-64-64.h conflicts between attempted installs of libcfi-libc6-dev-2.37-r0.riscv64cfi and libc6-dev-2.37-r0.riscv64

I added some debug prints to understand what exactly was being renamed by oe_multilib_handler, and:

"renaming gnu/lib-names-lp64d.h to gnu/lib-names-lp64d-64.h"

That looks correct, but I don't quite understand why the original header remains there:

$ find image/usr/include/gnu/ -name lib-names-lp64d*h
image/usr/include/gnu/lib-names-lp64d-64.h
image/usr/include/gnu/lib-names-lp64d.h

For info, my multilib suffix is 'cfi' rather than '32' or '64'. Am I right to presume I would need to adapt oe_multilib_header to it?

Thanks in advance, any help provided is appreciated.

Signature · 2 lines
Best regards,
João Marcos Costa
#1 lore raw
Quoted 45 lines · Joao Marcos Costa

Hello,

I'm facing the conflict below (among other conflicts of the same kind) during the rootfs creation of my image, and I would like to ask for some help on this:

file /usr/include/gnu/lib-names-lp64d.h conflicts between attempted installs of libcfi-libc6-dev-2.37-r0.riscv64cfi and libc6-dev-2.37-r0.riscv64

AFAIK, multilib_header.bbclass is meant to handle this kind of situation, so I tried the approach below:

do_install:append() {
     oe_multilib_header gnu/lib-names-lp64d.h
}

this one too, just in case:

do_install:append:virtclass-multilib-libcfi() {
     oe_multilib_header gnu/lib-names-lp64d.h
}

Am I missing something here?

With both approaches, I get the error below:

file /usr/include/gnu/lib-names-lp64d-64.h conflicts between attempted installs of libcfi-libc6-dev-2.37-r0.riscv64cfi and libc6-dev-2.37-r0.riscv64

and if I try running 'bitbake -c rootfs myimage' once again:

file /usr/include/gnu/lib-names-lp64d-64-64.h conflicts between attempted installs of libcfi-libc6-dev-2.37-r0.riscv64cfi and libc6-dev-2.37-r0.riscv64

I added some debug prints to understand what exactly was being renamed by oe_multilib_handler, and:

"renaming gnu/lib-names-lp64d.h to gnu/lib-names-lp64d-64.h"

That looks correct, but I don't quite understand why the original header remains there:

Quoted 8 lines
$ find image/usr/include/gnu/ -name lib-names-lp64d*h
image/usr/include/gnu/lib-names-lp64d-64.h
image/usr/include/gnu/lib-names-lp64d.h

For info, my multilib suffix is 'cfi' rather than '32' or '64'. Am I right to presume I would need to adapt oe_multilib_header to it?

Thanks in advance, any help provided is appreciated.

The code works by injecting a generated header file which does redirection depending upon which compiler is being used. "lib-names- lp64d.h" will therefore likely be a template generated file which directs to lib-names-lp64d-64.h or lib-names-lp64d-32.h depending on which multilib is in use.

You will almost certainly have to adapt that code for cfi.

Cheers,

Richard

#2 lore raw

Hello, Richard

Quoted 61 lines · Richard Purdie via lists.openembedded.org
Quoted 45 lines · Joao Marcos Costa

Hello,

I'm facing the conflict below (among other conflicts of the same kind) during the rootfs creation of my image, and I would like to ask for some help on this:

file /usr/include/gnu/lib-names-lp64d.h conflicts between attempted installs of libcfi-libc6-dev-2.37-r0.riscv64cfi and libc6-dev-2.37-r0.riscv64

AFAIK, multilib_header.bbclass is meant to handle this kind of situation, so I tried the approach below:

do_install:append() {
     oe_multilib_header gnu/lib-names-lp64d.h
}

this one too, just in case:

do_install:append:virtclass-multilib-libcfi() {
     oe_multilib_header gnu/lib-names-lp64d.h
}

Am I missing something here?

With both approaches, I get the error below:

file /usr/include/gnu/lib-names-lp64d-64.h conflicts between attempted installs of libcfi-libc6-dev-2.37-r0.riscv64cfi and libc6-dev-2.37-r0.riscv64

and if I try running 'bitbake -c rootfs myimage' once again:

file /usr/include/gnu/lib-names-lp64d-64-64.h conflicts between attempted installs of libcfi-libc6-dev-2.37-r0.riscv64cfi and libc6-dev-2.37-r0.riscv64

I added some debug prints to understand what exactly was being renamed by oe_multilib_handler, and:

"renaming gnu/lib-names-lp64d.h to gnu/lib-names-lp64d-64.h"

That looks correct, but I don't quite understand why the original header remains there:

Quoted 8 lines
$ find image/usr/include/gnu/ -name lib-names-lp64d*h
image/usr/include/gnu/lib-names-lp64d-64.h
image/usr/include/gnu/lib-names-lp64d.h

For info, my multilib suffix is 'cfi' rather than '32' or '64'. Am I right to presume I would need to adapt oe_multilib_header to it?

Thanks in advance, any help provided is appreciated.

The code works by injecting a generated header file which does redirection depending upon which compiler is being used. "lib-names- lp64d.h" will therefore likely be a template generated file which directs to lib-names-lp64d-64.h or lib-names-lp64d-32.h depending on which multilib is in use.

Quoted 5 lines

You will almost certainly have to adapt that code for cfi.

Cheers,

Richard

Thanks for your reply.

Even with the cfi suffix set correctly, the actual file raising the conflict is the generated template, no the header with the suffix:

file /usr/include/gnu/lib-names-lp64d.h conflicts between attempted installs of libcfi-libc6-dev-2.37-r0.riscv64cfi and libc6-dev-2.37-r0.riscv64

In my previous mail, I should have pasted this one instead. My bad.

Signature · 2 lines
Best regards,
João Marcos Costa
#3 lore raw
Quoted 11 lines · Joao Marcos Costa

Thanks for your reply.

Even with the cfi suffix set correctly, the actual file raising the conflict is the generated template, no the header with the suffix:

file /usr/include/gnu/lib-names-lp64d.h conflicts between attempted installs of libcfi-libc6-dev-2.37-r0.riscv64cfi and libc6-dev-2.37-r0.riscv64

In my previous mail, I should have pasted this one instead. My bad.

I tried to explain how it should work but I can't do much beyond that. The two generated template files should be identical.

Can you share the contents of the two header files so we can see what the conflict is?

Cheers,

Richard

#4 lore raw
Quoted 16 lines · Richard Purdie via lists.openembedded.org
Quoted 11 lines · Joao Marcos Costa

Thanks for your reply.

Even with the cfi suffix set correctly, the actual file raising the conflict is the generated template, no the header with the suffix:

file /usr/include/gnu/lib-names-lp64d.h conflicts between attempted installs of libcfi-libc6-dev-2.37-r0.riscv64cfi and libc6-dev-2.37-r0.riscv64

In my previous mail, I should have pasted this one instead. My bad.

I tried to explain how it should work but I can't do much beyond that. The two generated template files should be identical.

Quoted 6 lines

Can you share the contents of the two header files so we can see what the conflict is?

Cheers,

Richard

Most certainly. Here's the standard (i.e., non-cfi) version of it:

/* This file is automatically generated. */
#ifndef __GNU_LIB_NAMES_H

# error "Never use <gnu/lib-names-lp64d.h> directly; include <gnu/lib-names.h> instead."
#endif
#define LD_LINUX_RISCV64_LP64D_SO       "ld-linux-riscv64-lp64d.so.1"
#define LD_SO                           "ld-linux-riscv64-lp64d.so.1"
#define LIBANL_SO                       "libanl.so.1"
#define LIBBROKENLOCALE_SO              "libBrokenLocale.so.1"
#define LIBCRYPT_SO                     "libcrypt.so.1"
#define LIBC_MALLOC_DEBUG_SO            "libc_malloc_debug.so.0"
#define LIBC_SO                         "libc.so.6"
#define LIBDL_SO                        "libdl.so.2"
#define LIBGCC_S_SO                     "libgcc_s.so.1"
#define LIBMVEC_SO                      "libmvec.so.1"
#define LIBM_SO                         "libm.so.6"
#define LIBNSL_SO                       "libnsl.so.1"
#define LIBNSS_COMPAT_SO                "libnss_compat.so.2"
#define LIBNSS_DB_SO                    "libnss_db.so.2"
#define LIBNSS_DNS_SO                   "libnss_dns.so.2"
#define LIBNSS_FILES_SO                 "libnss_files.so.2"
#define LIBNSS_HESIOD_SO                "libnss_hesiod.so.2"
#define LIBNSS_LDAP_SO                  "libnss_ldap.so.2"
#define LIBPTHREAD_SO                   "libpthread.so.0"
#define LIBRESOLV_SO                    "libresolv.so.2"
#define LIBRT_SO                        "librt.so.1"
#define LIBTHREAD_DB_SO                 "libthread_db.so.1"
#define LIBUTIL_SO                      "libutil.so.1"

And the diff between this header and the CFI one is:

$ diff (...)image/usr/include/gnu/lib-names-lp64d.h (...)libcfi-glibc/2.37/image/usr/include/gnu/lib-names-lp64d.h
6,7c6,7
< #define LD_LINUX_RISCV64_LP64D_SO       "ld-linux-riscv64-lp64d.so.1"
< #define LD_SO                           "ld-linux-riscv64-lp64d.so.1"
---
Quoted 2 lines

#define LD_LINUX_RISCV64_LP64D_CFI_SO "ld-linux-riscv64-lp64d-cfi.so.1"
#define LD_SO "ld-linux-riscv64-lp64d-cfi.so.1"

Signature · 2 lines
Best regards,
João Marcos Costa
#5 lore raw
Quoted 66 lines · Joao Marcos Costa
Quoted 21 lines · Richard Purdie via lists.openembedded.org
Quoted 8 lines · Joao Marcos Costa

Thanks for your reply.

Even with the cfi suffix set correctly, the actual file raising the
conflict is the generated template, no the header with the suffix:

Quoted 7 lines

file /usr/include/gnu/lib-names-lp64d.h conflicts between attempted
installs of libcfi-libc6-dev-2.37-r0.riscv64cfi and libc6-dev-2.37-r0.riscv64

In my previous mail, I should have pasted this one instead. My bad.

I tried to explain how it should work but I can't do much beyond that.
The two generated template files should be identical.

Quoted 7 lines

Can you share the contents of the two header files so we can see what
the conflict is?

Cheers,

Richard

Most certainly. Here's the standard (i.e., non-cfi) version of it:

/* This file is automatically generated.  */
#ifndef __GNU_LIB_NAMES_H

# error "Never use <gnu/lib-names-lp64d.h> directly; include 
<gnu/lib-names.h> instead."
#endif

#define LD_LINUX_RISCV64_LP64D_SO       "ld-linux-riscv64-lp64d.so.1" #define LD_SO                           "ld-linux-riscv64-lp64d.so.1" #define LIBANL_SO                       "libanl.so.1" #define LIBBROKENLOCALE_SO              "libBrokenLocale.so.1" #define LIBCRYPT_SO                     "libcrypt.so.1" #define LIBC_MALLOC_DEBUG_SO            "libc_malloc_debug.so.0" #define LIBC_SO                         "libc.so.6" #define LIBDL_SO                        "libdl.so.2" #define LIBGCC_S_SO                     "libgcc_s.so.1" #define LIBMVEC_SO                      "libmvec.so.1" #define LIBM_SO                         "libm.so.6" #define LIBNSL_SO                       "libnsl.so.1" #define LIBNSS_COMPAT_SO                "libnss_compat.so.2" #define LIBNSS_DB_SO                    "libnss_db.so.2" #define LIBNSS_DNS_SO                   "libnss_dns.so.2" #define LIBNSS_FILES_SO                 "libnss_files.so.2" #define LIBNSS_HESIOD_SO                "libnss_hesiod.so.2" #define LIBNSS_LDAP_SO                  "libnss_ldap.so.2" #define LIBPTHREAD_SO                   "libpthread.so.0" #define LIBRESOLV_SO                    "libresolv.so.2" #define LIBRT_SO                        "librt.so.1" #define LIBTHREAD_DB_SO                 "libthread_db.so.1" #define LIBUTIL_SO                      "libutil.so.1"

And the diff between this header and the CFI one is:

Quoted 12 lines
$ diff (...)image/usr/include/gnu/lib-names-lp64d.h 
(...)libcfi-glibc/2.37/image/usr/include/gnu/lib-names-lp64d.h
6,7c6,7
< #define LD_LINUX_RISCV64_LP64D_SO       "ld-linux-riscv64-
lp64d.so.1"
< #define LD_SO                           "ld-linux-riscv64-
lp64d.so.1"
---
 > #define LD_LINUX_RISCV64_LP64D_CFI_SO   "ld-linux-riscv64-lp64d-
cfi.so.1"
 > #define LD_SO                           "ld-linux-riscv64-lp64d-
cfi.so.1"

Neither of those look like the generated template file. I'd guess there are appends going on in the recipe and the multilib header manipulation happens too early for some of the content. I'm just guessing though...

I'd look at the order of what is happening in do_install.

Cheers,

Richard

#6 lore raw
In reply to Joao Marcos Costa

The original error was:

file /usr/include/gnu/lib-names-lp64d.h conflicts between attempted installs of libcfi-libc6-dev-2.37-r0.riscv64cfi and libc6-dev-2.37-r0.riscv64

This looks like the offending headers come from different recipes. Multilib_header is not meant for handling these errors, it's intended for an entirely different scenario (when the same recipe is producing two different sets of multilib packages).

Rather you should drop all multilib hacks, go back to the original build, and see how the headers from the two different recipes differ, why are they installed into the same locaiton, do you need to install both packages, or only need one of them, and generally figure out how libcfi is supposed to coexist with libc.

Alex

Quoted 83 lines · Joao Marcos Costa via lists.openembedded.org
Quoted 16 lines · Richard Purdie via lists.openembedded.org
Quoted 11 lines · Joao Marcos Costa

Thanks for your reply.

Even with the cfi suffix set correctly, the actual file raising the conflict is the generated template, no the header with the suffix:

file /usr/include/gnu/lib-names-lp64d.h conflicts between attempted installs of libcfi-libc6-dev-2.37-r0.riscv64cfi and libc6-dev-2.37-r0.riscv64

In my previous mail, I should have pasted this one instead. My bad.

I tried to explain how it should work but I can't do much beyond that. The two generated template files should be identical.

Quoted 6 lines

Can you share the contents of the two header files so we can see what the conflict is?

Cheers,

Richard

Most certainly. Here's the standard (i.e., non-cfi) version of it:

/* This file is automatically generated. */
#ifndef __GNU_LIB_NAMES_H

# error "Never use <gnu/lib-names-lp64d.h> directly; include
<gnu/lib-names.h> instead."
#endif
#define LD_LINUX_RISCV64_LP64D_SO       "ld-linux-riscv64-lp64d.so.1"
#define LD_SO                           "ld-linux-riscv64-lp64d.so.1"
#define LIBANL_SO                       "libanl.so.1"
#define LIBBROKENLOCALE_SO              "libBrokenLocale.so.1"
#define LIBCRYPT_SO                     "libcrypt.so.1"
#define LIBC_MALLOC_DEBUG_SO            "libc_malloc_debug.so.0"
#define LIBC_SO                         "libc.so.6"
#define LIBDL_SO                        "libdl.so.2"
#define LIBGCC_S_SO                     "libgcc_s.so.1"
#define LIBMVEC_SO                      "libmvec.so.1"
#define LIBM_SO                         "libm.so.6"
#define LIBNSL_SO                       "libnsl.so.1"
#define LIBNSS_COMPAT_SO                "libnss_compat.so.2"
#define LIBNSS_DB_SO                    "libnss_db.so.2"
#define LIBNSS_DNS_SO                   "libnss_dns.so.2"
#define LIBNSS_FILES_SO                 "libnss_files.so.2"
#define LIBNSS_HESIOD_SO                "libnss_hesiod.so.2"
#define LIBNSS_LDAP_SO                  "libnss_ldap.so.2"
#define LIBPTHREAD_SO                   "libpthread.so.0"
#define LIBRESOLV_SO                    "libresolv.so.2"
#define LIBRT_SO                        "librt.so.1"
#define LIBTHREAD_DB_SO                 "libthread_db.so.1"
#define LIBUTIL_SO                      "libutil.so.1"

And the diff between this header and the CFI one is:

$ diff (...)image/usr/include/gnu/lib-names-lp64d.h
(...)libcfi-glibc/2.37/image/usr/include/gnu/lib-names-lp64d.h
6,7c6,7
< #define LD_LINUX_RISCV64_LP64D_SO       "ld-linux-riscv64-lp64d.so.1"
< #define LD_SO                           "ld-linux-riscv64-lp64d.so.1"
---
Quoted 2 lines

#define LD_LINUX_RISCV64_LP64D_CFI_SO "ld-linux-riscv64-lp64d-cfi.so.1"
#define LD_SO "ld-linux-riscv64-lp64d-cfi.so.1"

--
Best regards,
João Marcos Costa

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#214320): https://lists.openembedded.org/g/openembedded-core/message/214320
Mute This Topic: https://lists.openembedded.org/mt/112062849/1686489
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

#7 lore raw

Ah have to withdraw this :) Didn't read the original email close enough.

Alex

Quoted 106 lines · Alexander Kanavin

The original error was:

file /usr/include/gnu/lib-names-lp64d.h conflicts between attempted installs of libcfi-libc6-dev-2.37-r0.riscv64cfi and libc6-dev-2.37-r0.riscv64

This looks like the offending headers come from different recipes. Multilib_header is not meant for handling these errors, it's intended for an entirely different scenario (when the same recipe is producing two different sets of multilib packages).

Rather you should drop all multilib hacks, go back to the original build, and see how the headers from the two different recipes differ, why are they installed into the same locaiton, do you need to install both packages, or only need one of them, and generally figure out how libcfi is supposed to coexist with libc.

Alex

Quoted 83 lines · Joao Marcos Costa via lists.openembedded.org
Quoted 16 lines · Richard Purdie via lists.openembedded.org
Quoted 11 lines · Joao Marcos Costa

Thanks for your reply.

Even with the cfi suffix set correctly, the actual file raising the conflict is the generated template, no the header with the suffix:

file /usr/include/gnu/lib-names-lp64d.h conflicts between attempted installs of libcfi-libc6-dev-2.37-r0.riscv64cfi and libc6-dev-2.37-r0.riscv64

In my previous mail, I should have pasted this one instead. My bad.

I tried to explain how it should work but I can't do much beyond that. The two generated template files should be identical.

Quoted 6 lines

Can you share the contents of the two header files so we can see what the conflict is?

Cheers,

Richard

Most certainly. Here's the standard (i.e., non-cfi) version of it:

/* This file is automatically generated. */
#ifndef __GNU_LIB_NAMES_H

# error "Never use <gnu/lib-names-lp64d.h> directly; include
<gnu/lib-names.h> instead."
#endif
#define LD_LINUX_RISCV64_LP64D_SO       "ld-linux-riscv64-lp64d.so.1"
#define LD_SO                           "ld-linux-riscv64-lp64d.so.1"
#define LIBANL_SO                       "libanl.so.1"
#define LIBBROKENLOCALE_SO              "libBrokenLocale.so.1"
#define LIBCRYPT_SO                     "libcrypt.so.1"
#define LIBC_MALLOC_DEBUG_SO            "libc_malloc_debug.so.0"
#define LIBC_SO                         "libc.so.6"
#define LIBDL_SO                        "libdl.so.2"
#define LIBGCC_S_SO                     "libgcc_s.so.1"
#define LIBMVEC_SO                      "libmvec.so.1"
#define LIBM_SO                         "libm.so.6"
#define LIBNSL_SO                       "libnsl.so.1"
#define LIBNSS_COMPAT_SO                "libnss_compat.so.2"
#define LIBNSS_DB_SO                    "libnss_db.so.2"
#define LIBNSS_DNS_SO                   "libnss_dns.so.2"
#define LIBNSS_FILES_SO                 "libnss_files.so.2"
#define LIBNSS_HESIOD_SO                "libnss_hesiod.so.2"
#define LIBNSS_LDAP_SO                  "libnss_ldap.so.2"
#define LIBPTHREAD_SO                   "libpthread.so.0"
#define LIBRESOLV_SO                    "libresolv.so.2"
#define LIBRT_SO                        "librt.so.1"
#define LIBTHREAD_DB_SO                 "libthread_db.so.1"
#define LIBUTIL_SO                      "libutil.so.1"

And the diff between this header and the CFI one is:

$ diff (...)image/usr/include/gnu/lib-names-lp64d.h
(...)libcfi-glibc/2.37/image/usr/include/gnu/lib-names-lp64d.h
6,7c6,7
< #define LD_LINUX_RISCV64_LP64D_SO       "ld-linux-riscv64-lp64d.so.1"
< #define LD_SO                           "ld-linux-riscv64-lp64d.so.1"
---
Quoted 2 lines

#define LD_LINUX_RISCV64_LP64D_CFI_SO "ld-linux-riscv64-lp64d-cfi.so.1"
#define LD_SO "ld-linux-riscv64-lp64d-cfi.so.1"

--
Best regards,
João Marcos Costa

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#214320): https://lists.openembedded.org/g/openembedded-core/message/214320
Mute This Topic: https://lists.openembedded.org/mt/112062849/1686489
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-