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

failed to build with ncurses-6 #250

Closed
oz123 opened this issue Nov 8, 2019 · 12 comments
Closed

failed to build with ncurses-6 #250

oz123 opened this issue Nov 8, 2019 · 12 comments

Comments

@oz123
Copy link

oz123 commented Nov 8, 2019

Version information.
4.5.1

Bug description. Provide a clear and concise description of what the bug is.

$ ./configure
... snipped ...
config.status: creating po/Makefile
config.status: executing depfiles commands

========================================================================
calcurse is configured as follows.
Please check that this configuration matches your expectations.
Also give a look at the config.h file to check for preprocessor symbols.

Host system type   : x86_64-pc-linux-gnu

Options used to compile and link:
  PREFIX           = /usr/local
  VERSION          = 4.5.1
  CC               = gcc
  CFLAGS           = -g -O2 -Wall
  CPPFLAGS         = 
  DEFS             = -DHAVE_CONFIG_H
  LD               = /usr/x86_64-pc-linux-gnu/bin/ld
  LDFLAGS          = 
  LIBS             = -lm -lncursesw -pthread
========================================================================

oznn@oz-nn:~/Software/calcurse [±|master ?:12 ✗|] $ make

gcc -DLOCALEDIR=\"/usr/local/share/locale\" -DHAVE_CONFIG_H -I. -I..  -DDOCDIR=\"/usr/local/share/doc/calcurse\"  -std=c99 -pedantic -D_POSIX_C_SOURCE=200809L -g -O2 -Wall -MT dmon.o -MD -MP -MF .deps/dmon.Tpo -c -o dmon.o dmon.c
mv -f .deps/dmon.Tpo .deps/dmon.Po
gcc -std=c99 -pedantic -D_POSIX_C_SOURCE=200809L -g -O2 -Wall   -o calcurse calcurse.o apoint.o args.o config.o custom.o day.o event.o getstring.o help.o hooks.o ical.o io.o keys.o listbox.o llist.o note.o notify.o pcal.o queue.o recur.o sha1.o sigs.o strings.o todo.o ui-calendar.o ui-day.o ui-todo.o utf8.o utils.o vars.o vector.o wins.o mem.o dmon.o  -lm -lncursesw -pthread -lm
/usr/lib/gcc/x86_64-pc-linux-gnu/8.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: custom.o: undefined reference to symbol 'keypad'
/usr/lib/gcc/x86_64-pc-linux-gnu/8.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: /lib64/libtinfow.so.6: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
make[2]: *** [Makefile:426: calcurse] Error 1
make[2]: Leaving directory '/home/oznn/Software/calcurse/src'
make[1]: *** [Makefile:388: all-recursive] Error 1
make[1]: Leaving directory '/home/oznn/Software/calcurse'
make: *** [Makefile:329: all] Error 2

I was able to fix the build issue with:

./configure LIBS="-ltinfo"

But when I start the application is segfaults.

@lfos
Copy link
Owner

lfos commented Dec 16, 2019

Could you provide more information, such as a backtrace?

@lfos
Copy link
Owner

lfos commented Jan 30, 2020

Closing. Please reopen if the issue persists.

@lfos lfos closed this as completed Jan 30, 2020
@oz123
Copy link
Author

oz123 commented Jan 30, 2020

Hi, sorry that it took me so long to reply.

Here is a stacktrace:

 $ catchsegv ./src/calcurse 
*** Segmentation fault
Register dump:

 RAX: 0000000000000000   RBX: ffffffffffffffff   RCX: 0000000000000000
 RDX: 0000000000000009   RSI: 00007f6a0787fab2   RDI: 0000557bd0d96620
 RBP: 0000000000000000   R8 : 0000000000000000   R9 : 0000000000000003
 R10: 0000000000000000   R11: 00007f6a0786e0a0   R12: 00007f6a078c6de8
 R13: 0000557bd0d96620   R14: 0000000000000000   R15: 0000000000000000
 RSP: 00007ffe62f6a668

 RIP: 00007f6a0786e0c9   EFLAGS: 00010246

 CS: 0033   FS: 0000   GS: 0000

 Trap: 0000000e   Error: 00000004   OldMask: 00000000   CR2: 000000d1

 FPUCW: 0000037f   FPUSW: 00000000   TAG: 00000000
 RIP: 00000000   RDP: 00000000

 ST(0) 0000 0000000000000000   ST(1) 0000 0000000000000000
 ST(2) 0000 0000000000000000   ST(3) 0000 0000000000000000
 ST(4) 0000 0000000000000000   ST(5) 0000 0000000000000000
 ST(6) 0000 0000000000000000   ST(7) 0000 0000000000000000
 mxcsr: 1f80
 XMM0:  000000000000000000000000ffffffff XMM1:  000000000000000000000000ffffffff
 XMM2:  000000000000000000000000ffffffff XMM3:  000000000000000000000000ffffffff
 XMM4:  000000000000000000000000ffffffff XMM5:  000000000000000000000000ffffffff
 XMM6:  000000000000000000000000ffffffff XMM7:  000000000000000000000000ffffffff
 XMM8:  000000000000000000000000ffffffff XMM9:  000000000000000000000000ffffffff
 XMM10: 000000000000000000000000ffffffff XMM11: 000000000000000000000000ffffffff
 XMM12: 000000000000000000000000ffffffff XMM13: 000000000000000000000000ffffffff
 XMM14: 000000000000000000000000ffffffff XMM15: 000000000000000000000000ffffffff

Backtrace:
/lib64/libncursesw.so.6(termattrs_sp+0x29)[0x7f6a0786e0c9]
/lib64/libncursesw.so.6(_nc_setupscreen_sp+0x3ff)[0x7f6a0786b45f]
/lib64/libncursesw.so.6(newterm_sp+0xbe)[0x7f6a07866c7e]
/lib64/libncursesw.so.6(newterm+0x38)[0x7f6a07867108]
/lib64/libncursesw.so.6(initscr+0x63)[0x7f6a07862be3]
./src/calcurse(+0x5a88)[0x557bcfb24a88]
/lib64/libc.so.6(__libc_start_main+0xeb)[0x7f6a0753cefb]
./src/calcurse(+0x677a)[0x557bcfb2577a]

Memory map:

557bcfb1f000-557bcfb24000 r--p 00000000 00:2c 24779077 /home/oznn/Software/calcurse-4.5.1/src/calcurse
557bcfb24000-557bcfb51000 r-xp 00005000 00:2c 24779077 /home/oznn/Software/calcurse-4.5.1/src/calcurse
557bcfb51000-557bcfb61000 r--p 00032000 00:2c 24779077 /home/oznn/Software/calcurse-4.5.1/src/calcurse
557bcfb62000-557bcfb63000 r--p 00042000 00:2c 24779077 /home/oznn/Software/calcurse-4.5.1/src/calcurse
557bcfb63000-557bcfb65000 rw-p 00043000 00:2c 24779077 /home/oznn/Software/calcurse-4.5.1/src/calcurse
557bcfb65000-557bcfb75000 rw-p 00000000 00:00 0
557bd0d90000-557bd0db1000 rw-p 00000000 00:00 0 [heap]
7f6a06f76000-7f6a06f79000 r--p 00000000 08:01 3269434 /usr/lib/gcc/x86_64-pc-linux-gnu/9.2.0/libgcc_s.so.1
7f6a06f79000-7f6a06f8a000 r-xp 00003000 08:01 3269434 /usr/lib/gcc/x86_64-pc-linux-gnu/9.2.0/libgcc_s.so.1
7f6a06f8a000-7f6a06f8e000 r--p 00014000 08:01 3269434 /usr/lib/gcc/x86_64-pc-linux-gnu/9.2.0/libgcc_s.so.1
7f6a06f8e000-7f6a06f8f000 r--p 00017000 08:01 3269434 /usr/lib/gcc/x86_64-pc-linux-gnu/9.2.0/libgcc_s.so.1
7f6a06f8f000-7f6a06f90000 rw-p 00018000 08:01 3269434 /usr/lib/gcc/x86_64-pc-linux-gnu/9.2.0/libgcc_s.so.1
7f6a06f90000-7f6a074d0000 r--p 00000000 08:01 1442664 /usr/lib64/locale/locale-archive
7f6a074d0000-7f6a074d3000 rw-p 00000000 00:00 0
7f6a074d3000-7f6a074e2000 r--p 00000000 08:01 3866552 /lib64/libtinfow.so.6.1
7f6a074e2000-7f6a074fa000 r-xp 0000f000 08:01 3866552 /lib64/libtinfow.so.6.1
7f6a074fa000-7f6a0750a000 r--p 00027000 08:01 3866552 /lib64/libtinfow.so.6.1
7f6a0750a000-7f6a0750b000 ---p 00037000 08:01 3866552 /lib64/libtinfow.so.6.1
7f6a0750b000-7f6a0750f000 r--p 00037000 08:01 3866552 /lib64/libtinfow.so.6.1
7f6a0750f000-7f6a07510000 rw-p 0003b000 08:01 3866552 /lib64/libtinfow.so.6.1
7f6a07510000-7f6a07511000 rw-p 00000000 00:00 0
7f6a07511000-7f6a07512000 r--p 00000000 08:01 210048 /lib64/libdl-2.29.so
7f6a07512000-7f6a07514000 r-xp 00001000 08:01 210048 /lib64/libdl-2.29.so
7f6a07514000-7f6a07515000 r--p 00003000 08:01 210048 /lib64/libdl-2.29.so
7f6a07515000-7f6a07516000 r--p 00003000 08:01 210048 /lib64/libdl-2.29.so
7f6a07516000-7f6a07517000 rw-p 00004000 08:01 210048 /lib64/libdl-2.29.so
7f6a07517000-7f6a07519000 rw-p 00000000 00:00 0
7f6a07519000-7f6a0753b000 r--p 00000000 08:01 209834 /lib64/libc-2.29.so
7f6a0753b000-7f6a07694000 r-xp 00022000 08:01 209834 /lib64/libc-2.29.so
7f6a07694000-7f6a076dd000 r--p 0017b000 08:01 209834 /lib64/libc-2.29.so
7f6a076dd000-7f6a076de000 ---p 001c4000 08:01 209834 /lib64/libc-2.29.so
7f6a076de000-7f6a076e2000 r--p 001c4000 08:01 209834 /lib64/libc-2.29.so
7f6a076e2000-7f6a076e4000 rw-p 001c8000 08:01 209834 /lib64/libc-2.29.so
7f6a076e4000-7f6a076e8000 rw-p 00000000 00:00 0
7f6a076e8000-7f6a076ee000 r--p 00000000 08:01 209812 /lib64/libpthread-2.29.so
7f6a076ee000-7f6a07700000 r-xp 00006000 08:01 209812 /lib64/libpthread-2.29.so
7f6a07700000-7f6a07705000 r--p 00018000 08:01 209812 /lib64/libpthread-2.29.so
7f6a07705000-7f6a07706000 r--p 0001c000 08:01 209812 /lib64/libpthread-2.29.so
7f6a07706000-7f6a07707000 rw-p 0001d000 08:01 209812 /lib64/libpthread-2.29.so
7f6a07707000-7f6a0770b000 rw-p 00000000 00:00 0
7f6a0770b000-7f6a07718000 r--p 00000000 08:01 209755 /lib64/libm-2.29.so
7f6a07718000-7f6a077b3000 r-xp 0000d000 08:01 209755 /lib64/libm-2.29.so
7f6a077b3000-7f6a0784c000 r--p 000a8000 08:01 209755 /lib64/libm-2.29.so
7f6a0784c000-7f6a0784d000 r--p 00140000 08:01 209755 /lib64/libm-2.29.so
7f6a0784d000-7f6a0784e000 rw-p 00141000 08:01 209755 /lib64/libm-2.29.so
7f6a0784e000-7f6a07858000 r--p 00000000 08:01 3866575 /lib64/libncursesw.so.6.1
7f6a07858000-7f6a0787f000 r-xp 0000a000 08:01 3866575 /lib64/libncursesw.so.6.1
7f6a0787f000-7f6a07888000 r--p 00031000 08:01 3866575 /lib64/libncursesw.so.6.1
7f6a07888000-7f6a07889000 r--p 00039000 08:01 3866575 /lib64/libncursesw.so.6.1
7f6a07889000-7f6a0788a000 rw-p 0003a000 08:01 3866575 /lib64/libncursesw.so.6.1
7f6a0788a000-7f6a07899000 r--p 00000000 08:01 3863299 /lib64/libtinfo.so.6.1
7f6a07899000-7f6a078b1000 r-xp 0000f000 08:01 3863299 /lib64/libtinfo.so.6.1
7f6a078b1000-7f6a078c1000 r--p 00027000 08:01 3863299 /lib64/libtinfo.so.6.1
7f6a078c1000-7f6a078c2000 ---p 00037000 08:01 3863299 /lib64/libtinfo.so.6.1
7f6a078c2000-7f6a078c6000 r--p 00037000 08:01 3863299 /lib64/libtinfo.so.6.1
7f6a078c6000-7f6a078c7000 rw-p 0003b000 08:01 3863299 /lib64/libtinfo.so.6.1
7f6a078c7000-7f6a078c8000 rw-p 00000000 00:00 0
7f6a078f9000-7f6a078fa000 r--p 00000000 08:01 209760 /lib64/libSegFault.so
7f6a078fa000-7f6a078fd000 r-xp 00001000 08:01 209760 /lib64/libSegFault.so
7f6a078fd000-7f6a078fe000 r--p 00004000 08:01 209760 /lib64/libSegFault.so
7f6a078fe000-7f6a078ff000 r--p 00004000 08:01 209760 /lib64/libSegFault.so
7f6a078ff000-7f6a07900000 rw-p 00005000 08:01 209760 /lib64/libSegFault.so
7f6a07900000-7f6a07902000 rw-p 00000000 00:00 0
7f6a07902000-7f6a07903000 r--p 00000000 08:01 209415 /lib64/ld-2.29.so
7f6a07903000-7f6a07921000 r-xp 00001000 08:01 209415 /lib64/ld-2.29.so
7f6a07921000-7f6a07929000 r--p 0001f000 08:01 209415 /lib64/ld-2.29.so
7f6a0792a000-7f6a0792b000 r--p 00027000 08:01 209415 /lib64/ld-2.29.so
7f6a0792b000-7f6a0792c000 rw-p 00028000 08:01 209415 /lib64/ld-2.29.so
7f6a0792c000-7f6a0792d000 rw-p 00000000 00:00 0
7ffe62f4a000-7ffe62f6c000 rw-p 00000000 00:00 0 [stack]
7ffe62fc6000-7ffe62fc9000 r--p 00000000 00:00 0 [vvar]
7ffe62fc9000-7ffe62fcb000 r-xp 00000000 00:00 0 [vdso]
ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0 [vsyscall]

@lfos
Copy link
Owner

lfos commented Jan 31, 2020

Are you using Gentoo? Potentially related: jonas/tig#568

@lfos lfos changed the title failed to build with ncurses-6 - /usr/lib/gcc/x86_64-pc-linux-gnu/8.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: /lib64/libtinfow.so.6: error adding symbols: DSO missing from command line failed to build with ncurses-6 Jan 31, 2020
@lfos lfos reopened this Jan 31, 2020
@oz123
Copy link
Author

oz123 commented Jan 31, 2020

Yes, I am using Gentoo.

@crocket
Copy link

crocket commented May 18, 2020

I'm also having this exact same issue on gentoo linux.

I can work around the issue by applying the following patch to calcurse 4.4.0

--- a/configure.ac
+++ b/configure.ac
@@ -3,7 +3,7 @@
 #-------------------------------------------------------------------------------
 AC_PREREQ(2.59)
 AC_INIT([calcurse],
-        m4_esyscmd([build-aux/git-version-gen .version]),
+        m4_esyscmd_s([cat .version]),
         [bugs@calcurse.org])
 AM_INIT_AUTOMAKE
 #m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
@@ -51,6 +51,9 @@
   LIBS="$LIBS -l$available_ncurses"
 ])
 
+AC_SEARCH_LIBS([cbreak], [tinfow tinfo],,
+    AC_MSG_ERROR([Cannot find a library providing cbreak]))
+
 AC_CHECK_HEADERS([pthread.h], [
     AC_CHECK_LIB(pthread, pthread_create, [
 	LIBS="$LIBS -pthread"

But, this patch doesn't work on the latest release.

@lfos
Copy link
Owner

lfos commented May 18, 2020

Thanks for the patch!

How exactly do you build calcurse? Are you using a Git clone, the official release tarballs or an ebuild?

Also, are you sure the first hunk of the patch is required? I don't see how it could be related to the issue described in the original bug report.

@crocket
Copy link

crocket commented May 18, 2020

@lfos
Copy link
Owner

lfos commented May 18, 2020

Thanks! Does this mean you are using the ebuild? Are you sure the first hunk of your patch is required? Which error message do you get with the most recent release? Does it work with 4.5.0?

@crocket
Copy link

crocket commented May 19, 2020

I'm using the ebuild. I don't know if anything is required.

This is the error I see if I try to compile 4.6.0 or the latest commit without any patch.

/usr/lib/gcc/x86_64-pc-linux-gnu/8.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: custom.o: undefined reference to symbol 'keypad'
/usr/lib/gcc/x86_64-pc-linux-gnu/8.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: /lib64/libtinfow.so.6: error adding symbols: DSO missing from command line

The patch doesn't work on 4.6.0 or the latest commit.

@lhca
Copy link
Contributor

lhca commented May 19, 2020

I was able to fix the build issue with:

./configure LIBS="-ltinfo"

But when I start the application is segfaults.

You could try

./configure LIBS="-ltinfow"

@crocket
Copy link

crocket commented May 19, 2020

./configure LIBS="-ltinfow" works around the issue. I built 4.6.0 with this trick.

@lfos lfos closed this as completed in 661da1d Oct 16, 2021
lfos pushed a commit that referenced this issue Nov 7, 2021
Properly discovers libtinfow for customized systems (e.g., Gentoo) while
offloading search handling to autoconf builtins.

Additionally adds autoconf-archive as a buildtime dependency.

Fixes #250.

Signed-off-by: Marco Sirabella <marco@sirabella.org>
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
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

No branches or pull requests

4 participants