Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] Crosstool-ng external toolchain with BR2_ROOTFS_MERGED_USR
@ 2025-03-10  5:52 Charlie Jenkins
  2025-03-10  6:00 ` Charlie Jenkins
  0 siblings, 1 reply; 3+ messages in thread
From: Charlie Jenkins @ 2025-03-10  5:52 UTC (permalink / raw)
  To: buildroot

I am trying to use a crosstool-ng build toolchain in Buildroot with the
BR2_ROOTFS_MERGED_USR option enabled. However, crosstool-ng installs
the sysroot libs at /lib instead /usr/lib as BR2_ROOTFS_MERGED_USR
expects. I am not sure what the best solution for this is. Should
BR2_ROOTFS_MERGED_USR be ignored for toolchain packages when an external
toolchain is being used?

My crosstool-ng config is:
CT_CONFIG_VERSION="4"
CT_ARCH_RISCV=y
# CT_DEMULTILIB is not set
CT_ARCH_USE_MMU=y
CT_ARCH_64=y
CT_ARCH_ARCH="rv64gc"
CT_KERNEL_LINUX=y
CT_CC_LANG_CXX=y
CT_DEBUG_GDB=y
# CT_GDB_CROSS_PYTHON is not set
# CT_GDB_GDBSERVER is not set

My buildroot config is:
BR2_riscv=y
BR2_TOOLCHAIN_EXTERNAL=y
BR2_TOOLCHAIN_EXTERNAL_CUSTOM=y
BR2_TOOLCHAIN_EXTERNAL_DOWNLOAD=y
BR2_TOOLCHAIN_EXTERNAL_URL="<path to built crosstool-ng toolchain>"
BR2_TOOLCHAIN_EXTERNAL_CUSTOM_PREFIX="$(ARCH)-unknown-linux-gnu"
BR2_TOOLCHAIN_EXTERNAL_HEADERS_6_11=y
BR2_TOOLCHAIN_EXTERNAL_CUSTOM_GLIBC=y
# BR2_TOOLCHAIN_EXTERNAL_INET_RPC is not set
# BR2_STRIP_strip is not set
BR2_ROOTFS_MERGED_USR=y

- Charlie

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Buildroot] Crosstool-ng external toolchain with BR2_ROOTFS_MERGED_USR
  2025-03-10  5:52 [Buildroot] Crosstool-ng external toolchain with BR2_ROOTFS_MERGED_USR Charlie Jenkins
@ 2025-03-10  6:00 ` Charlie Jenkins
  2025-03-11  2:50   ` Charlie Jenkins
  0 siblings, 1 reply; 3+ messages in thread
From: Charlie Jenkins @ 2025-03-10  6:00 UTC (permalink / raw)
  To: buildroot

On Sun, Mar 09, 2025 at 10:52:53PM -0700, Charlie Jenkins wrote:
> I am trying to use a crosstool-ng build toolchain in Buildroot with the
> BR2_ROOTFS_MERGED_USR option enabled. However, crosstool-ng installs
> the sysroot libs at /lib instead /usr/lib as BR2_ROOTFS_MERGED_USR
> expects. I am not sure what the best solution for this is. Should
> BR2_ROOTFS_MERGED_USR be ignored for toolchain packages when an external
> toolchain is being used?

I meant to add more information about the failure...

Because crosstool-ng installs the libs at /lib instead of /usr/lib, the
libraries end up getting symlinked into nothingness. For example:

$ ls -l ./output/host/riscv64-buildroot-linux-gnu/sysroot/usr/lib/libm.so
lrwxrwxrwx 1 charlie rvs 6 Mar  9 22:58 ./output/host/riscv64-buildroot-linux-gnu/sysroot/usr/lib/libm.so -> ../../

> 
> My crosstool-ng config is:
> CT_CONFIG_VERSION="4"
> CT_ARCH_RISCV=y
> # CT_DEMULTILIB is not set
> CT_ARCH_USE_MMU=y
> CT_ARCH_64=y
> CT_ARCH_ARCH="rv64gc"
> CT_KERNEL_LINUX=y
> CT_CC_LANG_CXX=y
> CT_DEBUG_GDB=y
> # CT_GDB_CROSS_PYTHON is not set
> # CT_GDB_GDBSERVER is not set
> 
> My buildroot config is:
> BR2_riscv=y
> BR2_TOOLCHAIN_EXTERNAL=y
> BR2_TOOLCHAIN_EXTERNAL_CUSTOM=y
> BR2_TOOLCHAIN_EXTERNAL_DOWNLOAD=y
> BR2_TOOLCHAIN_EXTERNAL_URL="<path to built crosstool-ng toolchain>"
> BR2_TOOLCHAIN_EXTERNAL_CUSTOM_PREFIX="$(ARCH)-unknown-linux-gnu"
> BR2_TOOLCHAIN_EXTERNAL_HEADERS_6_11=y
> BR2_TOOLCHAIN_EXTERNAL_CUSTOM_GLIBC=y
> # BR2_TOOLCHAIN_EXTERNAL_INET_RPC is not set
> # BR2_STRIP_strip is not set
> BR2_ROOTFS_MERGED_USR=y
> 
> - Charlie
> 
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Buildroot] Crosstool-ng external toolchain with BR2_ROOTFS_MERGED_USR
  2025-03-10  6:00 ` Charlie Jenkins
@ 2025-03-11  2:50   ` Charlie Jenkins
  0 siblings, 0 replies; 3+ messages in thread
From: Charlie Jenkins @ 2025-03-11  2:50 UTC (permalink / raw)
  To: buildroot

On Sun, Mar 09, 2025 at 11:00:57PM -0700, Charlie Jenkins wrote:
> On Sun, Mar 09, 2025 at 10:52:53PM -0700, Charlie Jenkins wrote:
> > I am trying to use a crosstool-ng build toolchain in Buildroot with the
> > BR2_ROOTFS_MERGED_USR option enabled. However, crosstool-ng installs
> > the sysroot libs at /lib instead /usr/lib as BR2_ROOTFS_MERGED_USR
> > expects. I am not sure what the best solution for this is. Should
> > BR2_ROOTFS_MERGED_USR be ignored for toolchain packages when an external
> > toolchain is being used?
> 
> I meant to add more information about the failure...
> 
> Because crosstool-ng installs the libs at /lib instead of /usr/lib, the
> libraries end up getting symlinked into nothingness. For example:
> 
> $ ls -l ./output/host/riscv64-buildroot-linux-gnu/sysroot/usr/lib/libm.so
> lrwxrwxrwx 1 charlie rvs 6 Mar  9 22:58 ./output/host/riscv64-buildroot-linux-gnu/sysroot/usr/lib/libm.so -> ../../

I believed I fixed the problem here:

https://lore.kernel.org/buildroot/20250310-fix_external_toolchains-v1-1-446f48af7cf7@rivosinc.com/T/#u

- Charlie

> 
> > 
> > My crosstool-ng config is:
> > CT_CONFIG_VERSION="4"
> > CT_ARCH_RISCV=y
> > # CT_DEMULTILIB is not set
> > CT_ARCH_USE_MMU=y
> > CT_ARCH_64=y
> > CT_ARCH_ARCH="rv64gc"
> > CT_KERNEL_LINUX=y
> > CT_CC_LANG_CXX=y
> > CT_DEBUG_GDB=y
> > # CT_GDB_CROSS_PYTHON is not set
> > # CT_GDB_GDBSERVER is not set
> > 
> > My buildroot config is:
> > BR2_riscv=y
> > BR2_TOOLCHAIN_EXTERNAL=y
> > BR2_TOOLCHAIN_EXTERNAL_CUSTOM=y
> > BR2_TOOLCHAIN_EXTERNAL_DOWNLOAD=y
> > BR2_TOOLCHAIN_EXTERNAL_URL="<path to built crosstool-ng toolchain>"
> > BR2_TOOLCHAIN_EXTERNAL_CUSTOM_PREFIX="$(ARCH)-unknown-linux-gnu"
> > BR2_TOOLCHAIN_EXTERNAL_HEADERS_6_11=y
> > BR2_TOOLCHAIN_EXTERNAL_CUSTOM_GLIBC=y
> > # BR2_TOOLCHAIN_EXTERNAL_INET_RPC is not set
> > # BR2_STRIP_strip is not set
> > BR2_ROOTFS_MERGED_USR=y
> > 
> > - Charlie
> > 
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-03-11  2:50 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-10  5:52 [Buildroot] Crosstool-ng external toolchain with BR2_ROOTFS_MERGED_USR Charlie Jenkins
2025-03-10  6:00 ` Charlie Jenkins
2025-03-11  2:50   ` Charlie Jenkins

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox