Bug 15685 - Buildroot fails to build due to host-ncurses' tic crashing on _nc_disable_period
Summary: Buildroot fails to build due to host-ncurses' tic crashing on _nc_disable_pe...
Status: RESOLVED MOVED
Alias: None
Product: buildroot
Classification: Unclassified
Component: Other (show other bugs)
Version: unspecified
Hardware: All Linux
: P5 normal
Target Milestone: ---
Assignee: unassigned
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-07-08 23:12 UTC by rpe2101
Modified: 2024-06-15 15:11 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description rpe2101 2023-07-08 23:12:25 UTC
Problem appears to be that the host-ncurses tic only is built with linker RUNPATH vs. the old RPATH.  Buildroot's tic is trying to use the system so file.  GCC version in Ubuntu 23.04 takes the RPATH flag and makes it a RUNPATH with the builtroot's current default ldflags.  Either this or the scripts using buildroot built host programs need to update LD_LIBRARY_PATH to use buildroot's version of dynamic libraries, in this case ncurses.so.  Have potential diff at end.

System:
$ neofetch --stdout

robert@OptiPlex-9020
OS: Ubuntu 23.04 x86_64
Host: OptiPlex 9020 00
Kernel: 6.2.0-24-generic
Uptime: 19 hours, 22 mins
Packages: 3215 (dpkg), 21 (snap)
Shell: zsh 5.9
Resolution: 3840x2160
DE: GNOME 44.0
WM: Mutter
WM Theme: Adwaita
Theme: Yaru [GTK2/3]
Icons: Yaru [GTK2/3]
Terminal: tmux
CPU: Intel i7-4770 (8) @ 3.900GHz
GPU: Intel HD Graphics
Memory: 3576MiB / 15882MiB

$ gcc -version
gcc (Ubuntu 12.2.0-17ubuntu1) 12.2.0
Copyright (C) 2022 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

The Distilled moment:
DESTDIR=/home/robert/output/host/riscv64-buildroot-linux-gnu/sysroot \
prefix=/usr \
exec_prefix=/usr \
bindir=/usr/bin \
top_srcdir=.. \
srcdir=. \
datadir=/usr/share \
ticdir=/usr/share/terminfo \
source=terminfo.tmp \
cross_compiling=yes \
/bin/bash ./run_tic.sh
** Building terminfo database, please wait...
Running tic to install /home/robert/output/host/riscv64-buildroot-linux-gnu/sysroot/usr/share/terminfo ...

        You may see messages regarding extended capabilities, e.g., AX.
        These are extended terminal capabilities which are compiled
        using
                tic -x
        If you have ncurses 4.2 applications, you should read the INSTALL
        document, and install the terminfo without the -x option.

tic: symbol lookup error: tic: undefined symbol: _nc_disable_period
tic: symbol lookup error: tic: undefined symbol: _nc_disable_period
? tic could not build /home/robert/output/host/riscv64-buildroot-linux-gnu/sysroot/usr/share/terminfo
make[3]: *** [Makefile:109: install.data] Error 1
make[2]: *** [Makefile:139: install] Error 2
make[1]: *** [package/pkg-generic.mk:332: /home/robert/output/build/ncurses-6.4-20230429/.stamp_staging_installed] Error 2

.config attached.

I was able to fix this by forcing all host programs to be build with a flag to use the RPATH's.  I believe the below diff is the correct location to put the change.

diff --git a/package/Makefile.in b/package/Makefile.in
index 24089a4a..0dbfcdd8 100644
--- a/package/Makefile.in
+++ b/package/Makefile.in
@@ -242,7 +242,7 @@ HOST_CPPFLAGS  = -I$(HOST_DIR)/include
 HOST_CFLAGS   ?= -O2
 HOST_CFLAGS   += $(HOST_CPPFLAGS)
 HOST_CXXFLAGS += $(HOST_CFLAGS)
-HOST_LDFLAGS  += -L$(HOST_DIR)/lib -Wl,-rpath,$(HOST_DIR)/lib
+HOST_LDFLAGS  += -L$(HOST_DIR)/lib -Wl,-rpath,$(HOST_DIR)/lib -Wl,--disable-new-dtags

 # host-intltool should be executed with the system perl, so we save
 # the path to the system perl, before a host-perl built by Buildroot
Comment 1 rpe2101 2023-07-08 23:14:08 UTC
.config file is >75kB, so can't attach.
Comment 2 Yann E. MORIN 2023-07-10 20:44:30 UTC
(In reply to rpe2101 from comment #1)
> .config file is >75kB, so can't attach.

You can create a smaller file, called a defconfig:

$ make savedefconfig BR2_DEFCONFIG=$(pwd)/my_defconfig

And then you can provide the my_defconfig file

Regards,
Yann E. MORIN.
Comment 3 Yann E. MORIN 2024-06-15 15:11:23 UTC
Thank you for your report.

The issue tracker for the Buildroot project has been moved to
the Gitlab.com issue tracker:
    https://gitlab.com/buildroot.org/buildroot/-/issues

We are taking this opportunity to close old issues in this old
tracker. If you believe your issue is still relevant, please
open one in the new issue tracker.

Thank you!