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

readline: Fix readline.pc to depend on ncursesw #6283

Merged
merged 1 commit into from
Oct 15, 2024

Conversation

th0ma7
Copy link
Contributor

@th0ma7 th0ma7 commented Oct 15, 2024

Description

readline: Fix readline.pc to depend on ncursesw

Fixes issue when compiling python 3.13.0 - relates to #6282

Checklist

  • Build rule all-supported completed successfully
  • New installation of package completed successfully
  • Package upgrade completed successfully (Manually install the package again)
  • Package functionality was tested
  • Any needed documentation is updated/created

Type of change

  • Bug fix
  • New Package
  • Package update
  • Includes small framework changes
  • This change requires a documentation update (e.g. Wiki)

@th0ma7 th0ma7 self-assigned this Oct 15, 2024
@th0ma7 th0ma7 merged commit 5b963ec into SynoCommunity:master Oct 15, 2024
2 checks passed
@th0ma7 th0ma7 deleted the readline-ncursesw-fix branch October 15, 2024 20:15
@hgy59
Copy link
Contributor

hgy59 commented Oct 22, 2024

@th0ma7 it seems that this PR has broken the build of synocli-net

it fails to link the tools of cross/bind (libreadline does not find the exports of ncurses)
extract of gibhub build log (https://github.com/SynoCommunity/spksrc/actions/runs/11460061521):

2024-10-22T12:52:25.8083096Z make[7]: Entering directory '/github/workspace/spk/synocli-net/work-x64-7.1/bind-9.17.22/bin/rndc'
2024-10-22T12:52:25.8102415Z   CC       rndc.o
2024-10-22T12:52:25.8102845Z   CC       util.o
2024-10-22T12:52:26.0038076Z   CCLD     rndc
2024-10-22T12:52:26.2121652Z make[7]: Leaving directory '/github/workspace/spk/synocli-net/work-x64-7.1/bind-9.17.22/bin/rndc'
2024-10-22T12:52:26.2122278Z Making all in dig
2024-10-22T12:52:26.2142202Z make[7]: Entering directory '/github/workspace/spk/synocli-net/work-x64-7.1/bind-9.17.22/bin/dig'
2024-10-22T12:52:26.2161815Z   CC       dig.o
2024-10-22T12:52:26.2162484Z   CC       dighost.lo
2024-10-22T12:52:26.2179708Z   CC       host.o
2024-10-22T12:52:26.2186705Z   CC       nslookup-nslookup.o
2024-10-22T12:52:27.0736297Z   CCLD     libdighost.la
2024-10-22T12:52:27.1426585Z   CCLD     host
2024-10-22T12:52:27.1433437Z   CCLD     dig
2024-10-22T12:52:27.1440046Z   CCLD     nslookup
2024-10-22T12:52:27.4507263Z /github/workspace/spk/synocli-net/work-x64-7.1/install/var/packages/synocli-net/target/lib/libreadline.so: undefined reference to `tgetstr'
2024-10-22T12:52:27.4509469Z /github/workspace/spk/synocli-net/work-x64-7.1/install/var/packages/synocli-net/target/lib/libreadline.so: undefined reference to `tputs'
2024-10-22T12:52:27.4510864Z /github/workspace/spk/synocli-net/work-x64-7.1/install/var/packages/synocli-net/target/lib/libreadline.so: undefined reference to `BC'
2024-10-22T12:52:27.4512230Z /github/workspace/spk/synocli-net/work-x64-7.1/install/var/packages/synocli-net/target/lib/libreadline.so: undefined reference to `tgetent'
2024-10-22T12:52:27.4513604Z /github/workspace/spk/synocli-net/work-x64-7.1/install/var/packages/synocli-net/target/lib/libreadline.so: undefined reference to `tgetflag'
2024-10-22T12:52:27.4514969Z /github/workspace/spk/synocli-net/work-x64-7.1/install/var/packages/synocli-net/target/lib/libreadline.so: undefined reference to `tgoto'
2024-10-22T12:52:27.4516325Z /github/workspace/spk/synocli-net/work-x64-7.1/install/var/packages/synocli-net/target/lib/libreadline.so: undefined reference to `UP'
2024-10-22T12:52:27.4517952Z /github/workspace/spk/synocli-net/work-x64-7.1/install/var/packages/synocli-net/target/lib/libreadline.so: undefined reference to `tgetnum'
2024-10-22T12:52:27.4520786Z /github/workspace/spk/synocli-net/work-x64-7.1/install/var/packages/synocli-net/target/lib/libreadline.so: undefined reference to `PC'
2024-10-22T12:52:27.4521656Z collect2: error: ld returned 1 exit status
2024-10-22T12:52:27.4522062Z make[7]: *** [Makefile:587: nslookup] Error 1
2024-10-22T12:52:27.4522755Z make[7]: Leaving directory '/github/workspace/spk/synocli-net/work-x64-7.1/bind-9.17.22/bin/dig'
2024-10-22T12:52:27.4525693Z make[6]: *** [Makefile:437: all-recursive] Error 1
2024-10-22T12:52:27.4527458Z make[6]: Leaving directory '/github/workspace/spk/synocli-net/work-x64-7.1/bind-9.17.22/bin'
2024-10-22T12:52:27.4531367Z make[5]: *** [Makefile:616: all-recursive] Error 1
2024-10-22T12:52:27.4532407Z make[5]: Leaving directory '/github/workspace/spk/synocli-net/work-x64-7.1/bind-9.17.22'
2024-10-22T12:52:27.4533973Z make[4]: *** [Makefile:522: all] Error 2
2024-10-22T12:52:27.4535055Z make[4]: Leaving directory '/github/workspace/spk/synocli-net/work-x64-7.1/bind-9.17.22'
2024-10-22T12:52:27.4538991Z make[3]: *** [../../mk/spksrc.compile.mk:44: compile_target] Error 2
2024-10-22T12:52:27.4540096Z make[3]: Leaving directory '/github/workspace/cross/bind'
2024-10-22T12:52:27.4544099Z make[2]: *** [../../mk/spksrc.depend.mk:54: depend_target] Error 2
2024-10-22T12:52:27.4545174Z make[2]: Leaving directory '/github/workspace/spk/synocli-net'
2024-10-22T12:52:27.4563122Z make[1]: *** [../../mk/spksrc.supported.mk:74: build-arch-x64-7.1] Error 1
2024-10-22T12:52:27.4564149Z make[1]: Leaving directory '/github/workspace/spk/synocli-net'
2024-10-22T12:52:27.4567141Z make: Leaving directory '/github/workspace/spk/synocli-net'
2024-10-22T12:52:27.4686179Z make: Entering directory '/github/workspace/spk/synocli-net'
2024-10-22T12:52:27.5091607Z rm -fr work work-* build-*.log publish-*.log status-*.log
2024-10-22T12:52:28.6431515Z make: Leaving directory '/github/workspace/spk/synocli-net'
2024-10-22T12:52:28.6434620Z ##[endgroup]

BTW synocli-net was merged as #6269 and successfully published just before this PR was merged.

@th0ma7
Copy link
Contributor Author

th0ma7 commented Oct 22, 2024

Wouldn't this mean that bind requires to be adjusted to use ncursesw?

Edit: btw, mostly away from keyboard for a few days...

@hgy59
Copy link
Contributor

hgy59 commented Oct 22, 2024

Edit: btw, mostly away from keyboard for a few days...

me too, just rebased #6220 away from my dev. env. as this popped up...

@hgy59
Copy link
Contributor

hgy59 commented Oct 22, 2024

synocli-net was the only package that failed with this PR https://github.com/SynoCommunity/spksrc/actions/runs/11353683916

@th0ma7
Copy link
Contributor Author

th0ma7 commented Oct 23, 2024

I'll try to have a look over the next week and figure what the issue really is. Feel free to remind me if i forget by then.

@hgy59
Copy link
Contributor

hgy59 commented Oct 25, 2024

I'll try to have a look over the next week and figure what the issue really is. Feel free to remind me if i forget by then.

It is an issue of cross/bind - you don't have to analyze cross/readline.

Before your readline fix, bind didn't use libreadline at all.
But with this fix, bind finds readline but has the linker error reported above.

hgy59 pushed a commit to hgy59/spksrc that referenced this pull request Oct 26, 2024
- update cross/readline from v8.2 to v8.2.13
- configure to use shared ncursesw library
- adjust patch of readline.pc introduced with SynoCommunity#6283
@hgy59 hgy59 mentioned this pull request Oct 26, 2024
7 tasks
@hgy59
Copy link
Contributor

hgy59 commented Oct 26, 2024

@th0ma7 finally found that it IS an issue with readline.

The issue was that libreadline didn't depend on libncursesw at all as you could see with readelf -d libreadline.so.8.2

Dynamic section at offset 0x482e0 contains 22 entries:
  Tag        Type                         Name/Value
 0x0000000000000001 (NEEDED)             Shared library: [libc.so.6]
 0x000000000000000e (SONAME)             Library soname: [libreadline.so.8]
 0x000000000000000f (RPATH)              Library rpath: [/usr/local/readline/lib]
 0x000000000000000c (INIT)               0x16048
 0x000000000000000d (FINI)               0x3d7bc
 0x0000000000000004 (HASH)               0x158

This is now fixed in #6292 with the configure argument --with-shared-termcap-library=-lncursesw

The patch of readline.pc is still required, but I updated it to patch the orginally created file after compilation instead of patching the file after installation.

The real cause is the configure file of readline. It does not handle the --with-shared-termcap-library correctly.

case "$opt_shared_termcap_lib" in
[Yy][Ee][Ss])	SHARED_TERMCAP="$TERMCAP_LIB" ;;
-l*)		SHARED_TERMCAP="$opt_shared_termcap_lib" ;;
esac

case "$TERMCAP_LIB" in
-ltinfo)  TERMCAP_PKG_CONFIG_LIB=tinfo ;;
-lcurses) TERMCAP_PKG_CONFIG_LIB=ncurses ;;
-lncurses) TERMCAP_PKG_CONFIG_LIB=ncurses ;;
-ltermcap) TERMCAP_PKG_CONFIG_LIB=termcap ;;
*) TERMCAP_PKG_CONFIG_LIB=termcap ;;
esac

as you can see in the extract above, the definition of TERMCAP_PKG_CONFIG_LIB does not regard the definition of SHARED_TERMCAP (and does not handle -lncursesw anyway).

unfortunately a gitlab login is required to report this upstream...
https://gitlab.isc.org/isc-projects/bind9/-/issues

@th0ma7
Copy link
Contributor Author

th0ma7 commented Oct 26, 2024

Nice catch @hgy59 !

hgy59 added a commit that referenced this pull request Oct 26, 2024
- update cross/readline from v8.2 to v8.2.13
- configure to use shared ncursesw library
- adjust patch of readline.pc introduced with #6283

Co-authored-by: hgy59 <[email protected]>
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.

2 participants