Hi guys, I've been trying to revive my K2 to build a simple TODO app. Since it has a keyboard, it could be useful tablet for noting my tasks
So basically, I (on a mac with apple silicon) was trying to setup a build environment using Docker (ubuntu:22.04), with the help from sysroot that I extracted from my K2 (GLIBC 2.5), and koxtoolchain 2025.05.
1) Building a simple Helloworld C works
2) Building another simple Helloworld CPP works (static linking)
Code:
#define _GNU_SOURCE
#include <cstdio>
#include <vector>
#include <unistd.h>
#include <fcntl.h>
#include <cerrno>
int main() {
printf("1. Start: C stdio works.\n");
// --- TEST A: C++ STL (Triggers libstdc++) ---
std::vector<int> v;
v.push_back(42);
printf("2. C++ Vector size: %d\n", (int)v.size());
// --- TEST B: GLIBC 2.9 Feature (pipe2) ---
// pipe2() was added in glibc 2.9.
// It allows setting O_CLOEXEC atomically.
int pipefd[2];
// Attempt to use pipe2
int result = pipe2(pipefd, O_CLOEXEC);
if (result == 0) {
printf("3. GLIBC 2.9 [pipe2]: Success! (Kernel supports syscall)\n");
close(pipefd[0]);
close(pipefd[1]);
} else {
if (errno == ENOSYS) {
printf("3. GLIBC 2.9 [pipe2]: Linked OK, but Kernel too old (ENOSYS).\n");
printf(" (This is normal for Kindle 2/3/4 with Kernel < 2.6.27)\n");
} else {
printf("3. GLIBC 2.9 [pipe2]: Failed with error code %d\n", errno);
}
}
printf("4. Final: Binary execution finished.\n");
return 0;
}
3) Building Python-2.7.18 works
4) Now, for qt-everywhere-opensource-src-4.8.2:
- Dynamic link built OK, when I tried to run libQtCore.so complains about GLIBC (toolchain's version is 2.9 iirc, but Kindle's version is 2.5)
- Dynamic link, pointing to the toolchain's lib built OK, but it returned Segmentation fault when I tried to run
- Static link seems OK, I tried to build a simple QT app
Code:
#include <QApplication>
#include <QLabel>
#include <QTimer>
#include <cstdio>
int main(int argc, char *argv[]) {
QApplication app(argc, argv);
printf("1. Qt Initialized successfully.\n");
QLabel label("Hello K2!");
label.show();
printf("2. GUI Element created. Starting Event Loop...\n");
int ret = app.exec();
return ret;
}
Code:
TEMPLATE = app
TARGET = qt_hello
SOURCES += main.cpp
But when I ran, it returns
Code:
./qt_hello_static -qws
QWSSocket::connectToLocalFile could not connect:: No such file or directory
QWSSocket::connectToLocalFile could not connect:: No such file or directory
QWSSocket::connectToLocalFile could not connect:: No such file or directory
QWSSocket::connectToLocalFile could not connect:: No such file or directory
QWSSocket::connectToLocalFile could not connect:: No such file or directory
QWSSocket::connectToLocalFile could not connect:: No such file or directory
No Qt for Embedded Linux server appears to be running.
If you want to run this program as a server,
add the "-qws" command-line option.
With force server mode
Code:
#include <QApplication>
#include <QLabel>
#include <QTimer>
#include <cstdio>
int main(int argc, char *argv[]) {
printf("1. Force-Starting in Server Mode...\n");
QApplication app(argc, argv, QApplication::GuiServer);
printf("2. Qt Initialized. Screen Width: %d\n", app.desktop()->width());
QLabel label("Hello Static Kindle!\n(Server Mode Forced)");
label.setAlignment(Qt::AlignCenter);
label.showFullScreen();
QTimer::singleShot(3000, &app, SLOT(quit()));
return app.exec();
}
It returned error
Code:
./qt_hello_static -qws
QLinuxFbScreen::initDevice: Invalid argument
Error writing palette to framebuffer
Cannot open input device '/dev/tty0': No such file or directory
Could you guys please help me to see what was the problem?
Thanks!!