Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make: improved binaries check + fix kindle-legacy / pocketbook build #1905

Merged
merged 6 commits into from
Aug 13, 2024

Conversation

benoit-pierre
Copy link
Contributor

@benoit-pierre benoit-pierre commented Aug 12, 2024

  • bincheck: Add --glibc-version-max to gate the maximum supported GLIBC version: bincheck will fail on libraries that link with more recent symbols.
  • glib: avoid pulling-in __sched_cpucount@GLIBC_2.6.

This change is Reviewable

@benoit-pierre benoit-pierre changed the title make: improved binaries check make: improved binaries check + fix kindle-legacy / pocketbook glib build Aug 12, 2024
@benoit-pierre
Copy link
Contributor Author

And another regression caught:

/home/ko/project/build/sftp-server
  RPATH     : $ORIGIN:$ORIGIN/libs
  NEEDED    : librt.so.1
  NEEDED    : libc.so.6
  UNRESOLVED:
    utimensat@GLIBC_2.6

Looks like tar is not the only potential user.

@benoit-pierre
Copy link
Contributor Author

As well as:

/home/ko/project/build/libs/libkoreader-input.so
  SONAME    : libkoreader-input.so
  RPATH     : $ORIGIN:$ORIGIN/libs
  NEEDED    : libdl.so.2
  NEEDED    : libinkview.so
  NEEDED    : libpthread.so.0
  NEEDED    : libc.so.6
  UNRESOLVED:
    pipe2@GLIBC_2.9

and

libzmq.so.4
  FILE      : /home/ko/project/build/libs/libzmq.so.4
  SONAME    : libzmq.so.4
  RPATH     : $ORIGIN:$ORIGIN/libs
  NEEDED    : libpthread.so.0
  NEEDED    : librt.so.1
  NEEDED    : libstdc++.so.6
  NEEDED    : libgcc_s.so.1
  NEEDED    : libc.so.6
  UNRESOLVED:
    eventfd@GLIBC_2.7

@benoit-pierre
Copy link
Contributor Author

That's for pocketbook, no issue with koreader-input locally when building for kindle-legacy.

Which is missing from Circle CI's matrix, how about adding it?

@benoit-pierre
Copy link
Contributor Author

Tentative patch for the remaining pocketbook issue:

 input/input.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git i/input/input.c w/input/input.c
index 5414d301e..764afa3af 100644
--- i/input/input.c
+++ w/input/input.c
@@ -125,7 +125,7 @@ static int openInputDevice(lua_State* L)
     if (!strcmp("fake_events", inputdevice)) {
         // Special case: the power slider for Kindle and USB events for Kobo.
         int pipefd[2U];
-#if defined(KINDLE_LEGACY)
+#if defined(KINDLE_LEGACY) || defined(POCKETBOOK)
         // pipe2 requires Linux 2.6.27 & glibc 2.9...
         if (pipe(pipefd) == -1) {
             return luaL_error(L, "Cannot create fake event generator communication pipe (pipe(): %s)", strerror(errno));

@NiLuJe?

@NiLuJe
Copy link
Member

NiLuJe commented Aug 13, 2024

Tentative patch for the remaining pocketbook issue:

Yup, lgtm!

(Note that we no longer actually use the Lua/C input module on PB, but keeping it functional usually costs us nothing ;p).

@NiLuJe
Copy link
Member

NiLuJe commented Aug 13, 2024

For context, this sort of stuff should mostly only happen on kindle-legacy & pocketbook, because they run glibc 2.5, but the toolchain is built against 2.9 (because good luck building 2.5, especially with even a halfway recent GCC version).

For the rest of our targets, the ct-ng config will target the "proper" glibc version directly. Note that even that is a moving target, because vendors will sometime miraculously update it ;).

e.g., kindle5 & kindlepw2 target 2.12.2, but it was actually updated to 2.19 on FW 5.6.5. (And it was probably updated again for the hf switch, but I lost track ;p).

Similarly, kobo targets 2.15, but it was updated to 2.19 (surprise!) on FW 4.6. And will be (massively) updated to 2.3x (can't recall the exact one right now) on 5.0.

@Frenzie
Copy link
Member

Frenzie commented Aug 13, 2024

Which is missing from Circle CI's matrix, how about adding it?

Sure, makes sense. It's likely to overlap very strongly with PB but it's not identical.

@benoit-pierre benoit-pierre changed the title make: improved binaries check + fix kindle-legacy / pocketbook glib build make: improved binaries check + fix kindle-legacy / pocketbook build Aug 13, 2024
@benoit-pierre benoit-pierre marked this pull request as ready for review August 13, 2024 17:30
Add `--glibc-version-max` to gate the maximum supported GLIBC version:
bincheck will fail on libraries that link with more recent symbols.
Avoid pulling-in `__sched_cpucount@GLIBC_2.6`.
Avoid pulling-in `utimensat@@GLIBC_2.6` in `sftp-server`.
Really disable eventfd support…
Don't pull-in `pipe2@GLIBC_2.9`.
Since it's an old platform, take advantage of `bincheck` to detect possible regressions.
@Frenzie Frenzie merged commit d4e4cae into koreader:master Aug 13, 2024
3 checks passed
@benoit-pierre benoit-pierre deleted the pr/improved_bincheck branch August 13, 2024 18:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants