Tiny Core Linux
Tiny Core Base => CorePlus => Topic started by: t18 on May 26, 2025, 07:25:27 AM
-
Hello,
my question is coz I'm unable to run even a simple xterm on my P166.
I get:
Illegal instruction
or
CPU ISA level is lower than requested
And I can't even load the linux headers:
no space left on device
Here is some output:
tc@box:~$ free
total used free shared buff/cache available
Mem: 86172 52036 8568 3716 25568 25344
Swap: 252048 21456 230592
tc@box:~$ free -m
total used free shared buff/cache available
Mem: 84 51 8 4 25 25
Swap: 246 21 225
tc@box:~$ df -h
Filesystem Size Used Available Use% Mounted on
rootfs 75.7M 23.1M 52.6M 31% /
tmpfs 42.1M 0 42.1M 0% /dev/shm
/dev/sda2 3.0G 991.6M 2.0G 33% /mnt/sda2
/dev/loop0 8.0K 8.0K 0 100% /tmp/tcloop/libxcvt
/dev/loop1 280.0K 280.0K 0 100% /tmp/tcloop/pixman
/dev/loop2 1.4M 1.4M 0 100% /tmp/tcloop/gcc_libs
/dev/loop3 2.7M 2.7M 0 100% /tmp/tcloop/openssl
So I'd try an older version of gcc, if that's feasible.
Many thanks
-
Which x server are you trying to run, Xvesa, Xfbdev or Xorg-7.7?
Which version and architecture of tinycore?
How much ram does your machine have?
It's possible you've hit on a kernel bug for early i486 and perhaps others - you could try using http://tinycorelinux.net/16.x/x86/release/distribution_files/i486/bzImage to see if it helps.
-
Which x server are you trying to run, Xvesa, Xfbdev or Xorg-7.7?
Xvesa.
I'm not referring to the default rxvt but to the latest Xterm code that I've downloaded and compiled for 32 bit on my i5 10600.
Which version and architecture of tinycore?
15
How much ram does your machine have?
96 Mb
It's possible you've hit on a kernel bug for early i486 and perhaps others - you could try using http://tinycorelinux.net/16.x/x86/release/distribution_files/i486/bzImage to see if it helps.
That's shown as "Potential security risk" on Firefox since its http and not https.
-
I'm not referring to the default rxvt but to the latest Xterm code that I've downloaded and compiled for 32 bit on my i5 10600.
Did you use “-march=i486 -mtune=i686”? If not you will have compiled code that works on your i5, but not necessarily on your pentium.
-
Hi t18
A couple of thoughts, since code compiled for an i5 is probably
not 486 compatible.
Did you include the 486 compiler directive for CFLAGS:
-march=i486
If you did, was it ignored?
Some projects have make files that ignore compiler directives
that the user specifies in the environment.
-
Did you use “-march=i486 -mtune=i686”? If not you will have compiled code that works on your i5, but not necessarily on your pentium.
Yes, i did.
If you did, was it ignored?
Some projects have make files that ignore compiler directives
that the user specifies in the environment.
I don't know, I didn't be aware of it.
This is the "file" output:
bash-5.1$ file xterm
xterm: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux.so.2, with debug_info, not stripped
bash-5.1$
And this is its Makefile:
# -----------------------------------------------------------------------------
SHELL = /bin/sh
#### Start of system configuration section. ####
srcdir = .
x =
o = .o
CC = gcc -march=i486 -mtune=i686 -Os -pipe -fomit-frame-pointer
CPP = gcc -march=i486 -mtune=i686 -Os -pipe -fomit-frame-pointer -E
AWK = gawk
LINK = $(CC) $(CFLAGS)
CTAGS = ctags
ETAGS = etags
LN_S = ln -s
RM = rm -f
LINT =
INSTALL = /usr/bin/ginstall -c
INSTALL_PROGRAM = ${INSTALL}
INSTALL_SCRIPT = ${INSTALL}
INSTALL_DATA = ${INSTALL} -m 644
transform = s,x,x,
EXTRA_CFLAGS =
EXTRA_CPPFLAGS = -DPROJECTROOT='"/usr"' -D__vendorversion__='"Version 7.7.0 X.Org"'
EXTRA_LOADFLAGS =
CPPFLAGS = -I. -I$(srcdir) -DHAVE_CONFIG_H -D_GNU_SOURCE -I. -I/usr/include/freetype2 -I/usr/include/freetype2/config -Dlinux -D__amd64__ -D_POSIX_C_SOURCE=199309L -D_POSIX_SOURCE -D_XOPEN_SOURCE -D_BSD_SOURCE -D_SVID_SOURCE -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DFUNCPROTO=15 -DNARROWPROTO -DXFREE86_FT2 -DUTMP -DOSMAJORVERSION=5 -DOSMINORVERSION=15 -I/usr/include -I/usr/include/libxml2 -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/harfbuzz -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/libxml2 -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/harfbuzz -I/usr/include/glib-2.0 $(EXTRA_CPPFLAGS)
CFLAGS = -g -O2 $(EXTRA_CFLAGS)
LDFLAGS =
LIBS = -lfontconfig -lfreetype -lXft -lXmu -lXt -lX11 -lXaw7 -lXt -lX11 -lXpm -lSM -lICE -lXt -lX11 -ltermcap
prefix = /opt/_prog32/_instal32/x-term
exec_prefix = ${prefix}
datarootdir = ${prefix}/share
datadir = ${datarootdir}
manext = 1
bindir = ${exec_prefix}/bin
libdir = ${exec_prefix}/lib
mandir = ${datarootdir}/man/man$(manext)
appsdir = ${exec_prefix}/lib/X11/app-defaults
icondir = no
pixmapdir = ${datadir}/pixmaps
#### End of system configuration section. ####
-
Hi t18
I would add:
-march=i486 -mtune=i686 -Os -pipe -fomit-frame-pointer
to EXTRA_CFLAGS and EXTRA_CPPFLAGS
-
..and if that doesn't work, you can try (in addition to the flags):
LD_PRELOAD=uname_hack.so ./configure --blah-blah
LD_PRELOAD=uname_hack.so make
LD_PRELOAD=uname_hack.so sudo make install
Using http://tinycorelinux.net/16.x/x86/release/src/toolchain/uname_hack.so
-
Hi t18
I would add:
-march=i486 -mtune=i686 -Os -pipe -fomit-frame-pointer
to EXTRA_CFLAGS and EXTRA_CPPFLAGS
They seems to get ignored: no change in the Makefile.
I did make distclean.
-
There lots of include in there, maybe there some libs that doesn't was compiled with all flags to support old asm instructions code.
And do you compile static the linker maybe takes some libs.a (pre build static lib) into your compiled code.
-
Hi t18
... They seems to get ignored: no change in the Makefile. ...
What you posted ended with:
#### End of system configuration section. ####
which suggests there was more to the Makefile. Without seeing
the actual commands, we don't know which variables are being
used or how they are being used.
-
It looks like you're not compiling Xterm in Tiny Core since the paths to libs in that Makefile aren't in /usr/local.
Even though you're using dynamic linking GCC will still use object files like crtbeginS.o which are compiled with GCC using the build settings of your distro (probably for later CPUs than P166). If you boot your i5 PC to x86 Tiny Core and compile there, it should work. Or if you're really adventurous you could try copying the Tiny Core GCC extension's begin/end object files (crtbegin.o, crtbeginS.o, crtend.o, crtendS.o) over to your other distro and make the compiler link to them there, but that's likely to anger the gods.
To confirm, change to the GCC lib directory in the distro where you're building Xterm (eg. /usr/lib/gcc or /usr/lib/gcc-lib) and run this command to show the build settings for the crtbeginS.o file for installed GCC versions:
find -name crtbeginS.o -exec file '{}' \;
I'm guessing it will be for a later architecture than i586 (Pentium 1).
-
Hi t18
... They seems to get ignored: no change in the Makefile. ...
What you posted ended with:
#### End of system configuration section. ####
which suggests there was more to the Makefile. Without seeing
the actual commands, we don't know which variables are being
used or how they are being used.
Yes it's quite long. Please find it attached.
-
It looks like you're not compiling Xterm in Tiny Core since the paths to libs in that Makefile aren't in /usr/local.
Yes, indeed I've compiled it on Slackware 15 (it hosts Virtualbox with TC on it).
Sometimes compiling succeeds on Slackware (gcc 11.2.0) and not on TC 15, or viceversa.
Libptytty-2.0 is an example. Although I've found the Juanito's direction: https://forum.tinycorelinux.net/index.php/topic,26669.msg172032.html#msg172032 it hasn't worked for me on TC.
Elsewhere, on Slackware I had problems with the -march option some time ago, while it worked great on TC.
Even though you're using dynamic linking GCC will still use object files like crtbeginS.o which are compiled with GCC using the build settings of your distro (probably for later CPUs than P166). If you boot your i5 PC to x86 Tiny Core and compile there, it should work. Or if you're really adventurous you could try copying the Tiny Core GCC extension's begin/end object files (crtbegin.o, crtbeginS.o, crtend.o, crtendS.o) over to your other distro and make the compiler link to them there, but that's likely to anger the gods.
That's way beyond my capabilities (and my available time).
To confirm, change to the GCC lib directory in the distro where you're building Xterm (eg. /usr/lib/gcc or /usr/lib/gcc-lib) and run this command to show the build settings for the crtbeginS.o file for installed GCC versions:
find -name crtbeginS.o -exec file '{}' \;
I'm guessing it will be for a later architecture than i586 (Pentium 1).
Here you are:
bash-5.1$ find -name crtbeginS.o -exec file '{}' \;
./crtbeginS.o: ELF 64-bit LSB relocatable, x86-64, version 1 (SYSV), not stripped
./32/crtbeginS.o: ELF 32-bit LSB relocatable, Intel 80386, version 1 (SYSV), not stripped
-
If you boot your i5 PC to x86 Tiny Core and compile there, it should work.
Anyway:
Xterm compiled on Slackware (just for my convenience) for 32 bit and put on Virtualbox-TC works great. I just had to link libtinfo to libncursesw.
The same binary put on P166 shows the above errors.
-
That looks right and the build script for GCC in Slackware 15 (http://ftp://ftp.osuosl.org/pub/slackware/slackware-15.0/source/d/gcc/gcc.SlackBuild) shows that it is built for i586 (as are other programs/libraries), so that shouldn't be a problem after all. Still I'd try compiling Xterm in x86 Tiny Core Linux in Virtualbox, since it could be that something went wrong with the architecture setting in Slackware when GCC was compiled, and anyway it avoids potential problems with different library versions between Slackware and Tiny Core (although that shouldn't cause "illegal instruction" errors).
-
So, Xterm looks for ncurses and I've got it installed on a separate dir.
It looks for curses.h in /usr/include (not /usr/local/include) so I've linked it from the ncurses dir.
Tried to set LIBS but unsuccessfully (not sure what I did): either the default dir /usr/local/include and the ncurses/include dir seems not to work.
I get the following error:
/usr/local/bin/ld: xtermcap.o: in function `loadTermcapStrings':
/mnt/sda1/_aappz/__SRC/xterm-master/./xtermcap.c:238:(.text+0x92): undefined reference to `tgetstr'
/usr/local/bin/ld: xtermcap.o: in function `get_termcap':
/mnt/sda1/_aappz/__SRC/xterm-master/./xtermcap.c:493:(.text+0x4f6): undefined reference to `tgetent'
/usr/local/bin/ld: xtermcap.o: in function `get_tcap_erase':
/mnt/sda1/_aappz/__SRC/xterm-master/./xtermcap.c:540:(.text+0x583): undefined reference to `tgetstr'
/usr/local/bin/ld: xtermcap.o: in function `set_termcap':
/mnt/sda1/_aappz/__SRC/xterm-master/./xtermcap.c:598:(.text+0x6f5): undefined reference to `tgetent'
collect2: error: ld returned 1 exit status
make: *** [Makefile:174: xterm] Error 1
Please help, many thanks.
-
Hi t18
Did the source package you downloaded include a file called configure?
If it did, run:
./configure --help
That should provide information on how to set the default include path.
I also see this in your Makefile:
CPPFLAGS = -I. -I$(srcdir) -DHAVE_CONFIG_H ........
Your source package seems to have a configuration header file.
It might be the xtermcfg.h file:
$(OBJS1) : xterm.h ptyx.h xtermcfg.h
I also see no reference to curses in the Makefile you posted.
-
Hi Rich,
if I don't symlink curses.h I get the following error:
In file included from ./input.c:90:
./termcap.h:63:10: fatal error: curses.h: No such file or directory
63 | #include <curses.h>
|
compilation terminated.
make: *** [Makefile:127: input.o] Error 1
In termcap.h there is the following code block:
#ifdef HAVE_NCURSES_CURSES_H
#include <ncurses/curses.h>
#else
#include <curses.h>
#endif
In xtermcfg.h there is the following:
#define HAVE_NCURSES_CURSES_H 1 /* AC_CHECK_HEADERS(ncurses/curses.h) */
configure -h mentions CPPFLAGS that I've already (maybe not properly) set.
-
So, Xterm looks for ncurses and I've got it installed on a separate dir.
It looks for curses.h in /usr/include (not /usr/local/include) so I've linked it from the ncurses dir.
There are no ncurses extensions for TC15 (if I assume that's where you're compiling Xterm now), so I assume you mean you linked to "/usr/local/include/ncursesw" from ncursesw-dev.tcz. That's only half the solution, you also need to link against ncursesw instead of ncurses by changing "-lncurses" to "-lncursesw" on the compiler command line in the Makefile.
Or if you actually copied ncurses header files from somewhere else, you're on the wrong track altogether, you need it to use the ncursesw headers.
Here's what I had to do to compile Cscope, which had the same problem of expecting ncurses not ncursesw:
./configure --prefix=/usr/local --with-ncurses=/usr/local/include/ncursesw
sed -i -e 's%-I/usr/local/include/ncursesw/include%-I/usr/local/include/ncursesw%g' -e 's%-lncurses%-lncursesw%g' Makefile src/Makefile
The configure script allowed supplying a custom path to ncurses, but it added a false "/include" directory on the end, and kept linking against ncurses instead of ncursesw. So I used Sed to adjust those parts of the two Makefiles which the configure script had generated. You might have to use symlinks to the ncursesw headers since the path looks to be hardcoded in the Xterm source files themselves (or edit those source files), but you still need to edit the Makefile/s to use "-lncursesw".
-
So, Xterm looks for ncurses and I've got it installed on a separate dir.
It looks for curses.h in /usr/include (not /usr/local/include) so I've linked it from the ncurses dir.
There are no ncurses extensions for TC15 (if I assume that's where you're compiling Xterm now), so I assume you mean you linked to "/usr/local/include/ncursesw" from ncursesw-dev.tcz.
Not really, I just downloaded and compiled the latest ncurses-6.5 source and installed the binary in a separate dir.
That's because there are a lot of programs that requires it.
It has a include/ncursesw subdir though, containing curses.h.
I linked it to /usr/include to avoid the above error, but the compilation process seems to ignore the CPPFLAGS=-I/<path-to-ncurses_6.5/include/ncursesw>.
I had also changed the termcap.h code to <ncursesw/curses.h> but no way.
-
I’ll have a look, which source code tarball are you using?
-
I’ll have a look, which source code tarball are you using?
https://ftp.gnu.org/gnu/ncurses/ncurses-6.5.tar.gz
Thank you so much :)
-
Not ncurses, xterm
-
Sorry, my insomnia hit me again :)
https://github.com/joejulian/xterm.git
Many thanks :)
-
This works:
tce-load -i compiletc ncursesw-dev ncursesw-utils libXaw-dev libXinerama-dev libXft-dev
wget https://invisible-mirror.net/archives/xterm/xterm-399.tgz
tar xf xterm-399.tgz
cd xterm-399
sed -i '/v0/{n;s/new:/new:kb=^?:/}' termcap
printf '\tkbs=\\177,\n' >> terminfo
CPPFLAGS="-I /usr/local/include/ncursesw" TERMINFO="/usr/local/share/terminfo" CC="gcc -flto -march=i486 -mtune=i686 -Os -pipe" CXX="g++ -flto -march=i486 -mtune=i686 -Os -pipe -fno-exceptions -fno-rtti" ./configure --prefix=/usr/local --localstatedir=/var --sysconfdir=/etc --with-app-defaults=/etc/X11/app-defaults --with-tty-group=staff
find . -name Makefile -type f -exec sed -i 's/-g -O2//g' {} \;
make [ 0m 50.14s]
sudo make install
-
¡Muchas gracias, señor! :)
It seem that what I found is not the "latest xterm" as they stated (it was definitely so at that time).
Well, indeed your work is superb and your settings work.
But I'd like to put it on my P166 and can't do "make install" on it since it's not possible, it seems, to install gcc on it.
Then, my best attempt was to install on a separate dir of my Virtualbox-TC, zip it and unpack it on my P166.
I successfully did that way for other programs yet, but changing the xterm --prefix it seems to me I split the installation somehow.
Not sure on how to set the remaining options:
--localstatedir=/var --sysconfdir=/etc --with-app-defaults=/etc/X11/app-defaults
Putting $PREFIX on them causes the old error.
Sorry, my IT knowledge is limited.
Many thanks
-
xterm posted to x86 16.x repo
-
xterm posted to x86 16.x repo
I'm so grateful.
I had used these option to enable unicode:
--enable-16bit-chars --enable-256-color
Are there any alternative methods to enable unicode?
Many thanks
-
You could try uxterm included with xterm or right-click on the xterm window and see if that brings up options?
-
You could try uxterm included with xterm or right-click on the xterm window and see if that brings up options?
Uxterm doesn't run at all (please see the attached image) as well as right-clicking the xterm window.