Ok, so, it turns out this was a me problem, and I apologize for any wasted time on this. It turns out the libc.so I was using for the cross compiler environment got overwritten from a linker script to the actual libc.so (a link to it), and it took some pretty ugly debugging to figure that out.

If you or anyone on the list is interested in what that looked like, here is a link:
https://stackoverflow.com/questions/79632951/linker-not-linking-to-basic-libraries-in-cross-compile




On 2025/05/21 00:51, Thomas Dickey wrote:
On Tue, May 20, 2025 at 11:08:23PM -0700, Greg Chandler wrote:

Actually I found the issue...
I walked away for a bit after sending the first email and was thinking about
why the cross compiler didn't work.
Then it hit me...

tic is made with the cross compiler, and then make is trying to use it, and
that is never going to work.

From your log, it appeared that there was a problem linking tic.

tic could be used in a subsequent attempt to install the database,
but I didn't see that in the log.

(the host's infocmp would be used if you chose to generate fallback
entries - but that's a separate issue)

So I tried this:
fresh untar,
configure with native build
make prog/tic with the native/build compiler

2nd fresh untar
configure with cross compiler
edit all the makefiles to remove the build of tic, and put the path to the
build system tic in the Makefile
make all

and that worked..

Basically the build system, whether it is configure via warnings and params, or Make, needs to detect when build != host or target and either suggest
doing this, or auto-configure so that tic is never built with a cross
compiler if make all is is called.

actually not - see above

From the fragment of build-log, I couldn't see how you set up the configure step. You should only have to set the build-cc (done if you've gotten to
tic), and the target, e.g.,

                --with-build-cc=$BUILD_CC \
                --host=$TARGET \
                --target=$TARGET \

If we are doing a make all with a cross or a canadian cross it should build
either tic only or all but tic.




On 2025/05/20 17:40, Thomas Dickey wrote:
> On Tue, May 20, 2025 at 04:29:43PM -0700, Greg Chandler wrote:
> >
> > I've run into this:
> > alpha-linux-gnu-gcc -DHAVE_CONFIG_H -DACTUAL_TIC="\"`echo tic|
> > sed
> > 's/$//'|sed 's,$,,;s,^,,'|sed 's/$//'`\"" -I../progs -I../ncurses
> > -I../ncurses -I. -I../include -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=600
> > -DNDEBUG
> > -O2 --param max-inline-insns-single=1200  -fPIC -c
> > ../progs/dump_entry.c -o
> > ../obj_s/dump_entry.o
> > cc1: warning: '-fstack-protector' not supported for this target
> > alpha-linux-gnu-gcc ../obj_s/clear.o ../obj_s/clear_cmd.o
> > ../obj_s/tty_settings.o -L../lib  -DHAVE_CONFIG_H
> > -DACTUAL_TIC="\"`echo tic|
> > sed 's/$//'|sed 's,$,,;s,^,,'|sed 's/$//'`\"" -I../progs -I../ncurses
> > -I../ncurses -I. -I../include -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=600
> > -DNDEBUG
> > -O2 --param max-inline-insns-single=1200  -fPIC  -ltinfo    -o clear
> > alpha-linux-gnu-gcc ../obj_s/tabs.o ../obj_s/tty_settings.o -L../lib
> > -DHAVE_CONFIG_H -DACTUAL_TIC="\"`echo tic|       sed 's/$//'|sed
> > 's,$,,;s,^,,'|sed 's/$//'`\"" -I../progs -I../ncurses -I../ncurses -I.
> > -I../include -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=600 -DNDEBUG -O2
> > --param
> > max-inline-insns-single=1200  -fPIC  -ltinfo    -o tabs
> > alpha-linux-gnu-gcc ../obj_s/tset.o ../obj_s/reset_cmd.o
> > ../obj_s/transform.o ../obj_s/tty_settings.o -L../lib  -DHAVE_CONFIG_H
> > -DACTUAL_TIC="\"`echo tic|       sed 's/$//'|sed 's,$,,;s,^,,'|sed
> > 's/$//'`\"" -I../progs -I../ncurses -I../ncurses -I. -I../include
> > -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=600 -DNDEBUG -O2 --param
> > max-inline-insns-single=1200  -fPIC  -ltinfo    -o tset
> > alpha-linux-gnu-gcc ../obj_s/toe.o -L../lib  -DHAVE_CONFIG_H
> > -DACTUAL_TIC="\"`echo tic|       sed 's/$//'|sed 's,$,,;s,^,,'|sed
> > 's/$//'`\"" -I../progs -I../ncurses -I../ncurses -I. -I../include
> > -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=600 -DNDEBUG -O2 --param
> > max-inline-insns-single=1200  -fPIC  -L../lib  -ltic -ltinfo    -o toe
> > alpha-linux-gnu-gcc ../obj_s/tput.o ../obj_s/clear_cmd.o
> > ../obj_s/reset_cmd.o ../obj_s/tparm_type.o ../obj_s/transform.o
> > ../obj_s/tty_settings.o -L../lib  -DHAVE_CONFIG_H
> > -DACTUAL_TIC="\"`echo tic|
> > sed 's/$//'|sed 's,$,,;s,^,,'|sed 's/$//'`\"" -I../progs -I../ncurses
> > -I../ncurses -I. -I../include -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=600
> > -DNDEBUG
> > -O2 --param max-inline-insns-single=1200  -fPIC  -ltinfo    -o tput
> > alpha-linux-gnu-gcc ../obj_s/infocmp.o ../obj_s/dump_entry.o -L../lib
> > -DHAVE_CONFIG_H -DACTUAL_TIC="\"`echo tic|       sed 's/$//'|sed
> > 's,$,,;s,^,,'|sed 's/$//'`\"" -I../progs -I../ncurses -I../ncurses -I.
> > -I../include -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=600 -DNDEBUG -O2
> > --param
> > max-inline-insns-single=1200  -fPIC  -L../lib  -ltic -ltinfo    -o
> > infocmp
> > alpha-linux-gnu-gcc ../obj_s/tic.o ../obj_s/dump_entry.o
> > ../obj_s/tparm_type.o ../obj_s/transform.o -L../lib  -DHAVE_CONFIG_H
> > -DACTUAL_TIC="\"`echo tic|       sed 's/$//'|sed 's,$,,;s,^,,'|sed
> > 's/$//'`\"" -I../progs -I../ncurses -I../ncurses -I. -I../include
> > -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=600 -DNDEBUG -O2 --param
> > max-inline-insns-single=1200  -fPIC  -L../lib  -ltic -ltinfo    -o tic
> > 
/opt/tools/bin/../lib/gcc/alpha-linux-gnu/14.2.0/../../../../alpha-linux-gnu/bin/ld:
> > ../obj_s/tic.o: in function `main':
> > (.text.startup+0x7c): undefined reference to `atexit'
> > 
/opt/tools/bin/../lib/gcc/alpha-linux-gnu/14.2.0/../../../../alpha-linux-gnu/bin/ld:
> > (.text.startup+0x84): undefined reference to `atexit'
> > collect2: error: ld returned 1 exit status
> > make[1]: *** [Makefile:278: tic] Error 1
> > make[1]: Leaving directory '/tmp/ncurses-6.5-20250503/progs'
> > make: *** [Makefile:136: all] Error 2
>
> man atexit
>
> NAME
>        atexit - register a function to be called at normal process
> termination
>
> LIBRARY
>        Standard C library (libc, -lc)
>
> SYNOPSIS
>        #include <stdlib.h>
>
>        int atexit(void (*function)(void));
> ...
> STANDARDS
>        POSIX.1-2001, POSIX.1-2008, C99, SVr4, 4.3BSD.
>
>
> > I have all the logs for the build, but don't know if there is
> > anything in
> > particular that will help...
> > This does build without errors on the build compiler, just not the
> > cross:
> > Any ideas?
>
> Perhaps the target's runtime doesn't have atexit
>
> If it's convenient (and not too large), a compressed tar of its
> include-files
> would help determine what configure-checks might help in cross-compiling
> to
> that.  If that's "large", sending it to me directly (or showing where I
> can
> download the tar) is best practice.
>
> For the existing configure script, config.log and config.status can tell
> me a lot, but if it's lacking atexit there are probably other gaps.
>
> > Cross compiler:
> > root@constellation:/opt/build/ncurses# alpha-linux-gnu-gcc -v
> > Using built-in specs.
> > COLLECT_GCC=alpha-linux-gnu-gcc
> > 
COLLECT_LTO_WRAPPER=/opt/tools/bin/../libexec/gcc/alpha-linux-gnu/14.2.0/lto-wrapper
> > Target: alpha-linux-gnu
> > Configured with: ../gcc-14.2.0/configure --target=alpha-linux-gnu
> > --prefix=/opt//tools --with-glibc-version=2.41 --with-sysroot=/opt/
> > --with-newlib --without-headers --enable-default-pie
> > --enable-default-ssp
> > --disable-nls --disable-shared --disable-multilib --disable-threads
> > --disable-libatomic --disable-libgomp --disable-libquadmath
> > --disable-libssp
> > --disable-libvtv --disable-libstdcxx --enable-languages=c,c++
> > Thread model: single
> > Supported LTO compression algorithms: zlib zstd
> > gcc version 14.2.0 (GCC)
> >
> >
> > root@constellation:/opt/build/ncurses# alpha-linux-gnu-ld -V
> > GNU ld (GNU Binutils) 2.44
> >   Supported emulations:
> >    elf64alpha
> >    alpha
> > root@constellation:/opt/build/ncurses# alpha-linux-gnu-ld -v
> > GNU ld (GNU Binutils) 2.44
> >
> >
> >
> >
> >
> >
> >
> > Build compiler:
> > root@constellation:/opt/build/ncurses# gcc -v
> > Reading specs from /usr/lib64/gcc/x86_64-slackware-linux/14.2.0/specs
> > COLLECT_GCC=gcc
> > 
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-slackware-linux/14.2.0/lto-wrapper
> > Target: x86_64-slackware-linux
> > Configured with: ../configure --prefix=/usr --libdir=/usr/lib64
> > --mandir=/usr/man --infodir=/usr/info --enable-shared
> > --enable-bootstrap
> > --enable-languages=ada,c,c++,d,fortran,go,lto,m2,objc,obj-c++,rust
> > --enable-threads=posix --enable-checking=release --with-system-zlib
> > --enable-libstdcxx-dual-abi --with-default-libstdcxx-abi=new
> > --disable-libstdcxx-pch --disable-libunwind-exceptions
> > --enable-__cxa_atexit
> > --disable-libssp --enable-gnu-indirect-function
> > --enable-gnu-unique-object
> > --enable-plugin --enable-lto --disable-install-libiberty
> > --disable-werror
> > --with-gnu-ld --with-isl --verbose --with-arch-directory=amd64
> > --disable-gtktest --enable-clocale=gnu --with-arch=x86-64
> > --enable-multilib
> > --target=x86_64-slackware-linux --build=x86_64-slackware-linux
> > --host=x86_64-slackware-linux
> > Thread model: posix
> > Supported LTO compression algorithms: zlib zstd
> > gcc version 14.2.0 (GCC)
> >
> >
> > root@constellation:/opt/build/ncurses# ld -V
> > GNU ld version 2.44-slack151
> >   Supported emulations:
> >    elf_x86_64
> >    elf32_x86_64
> >    elf_i386
> >    elf_iamcu
> >    i386pe
> >    elf64bpf
> >
> > root@constellation:/opt/build/ncurses# ld -v
> > GNU ld version 2.44-slack151
> >
> >


Reply via email to