Skip to contentSkip to conversation

static build with curses fails if requires -ltinfo

Qemu-devel Felagund 4 participants 6 messages Dec 30, 2012 – Aug 17, 2016

lore
Share & tools
lore

Felagund

author
#0 lore raw

Public bug reported:

On my system (amd64 Debian wheezy/sid) static ncurses build requires -ltinfo:

$ pkg-config --libs --static ncurses
-lncurses -ltinfo
$ ../../configure --enable-curses --static
# Actually this fails on line
    if compile_prog "" "$curses_lib" ; then
# with
ERROR
ERROR: User requested feature curses
ERROR: configure was not able to find it
ERROR
# but if we add -ltinfo to this line check succeds
...
static build      yes
...
$ make
...
...
  CC    i386-softmmu/hw/i386/../kvm/pci-assign.o
  LINK  i386-softmmu/qemu-system-i386
../os-posix.o: In function `change_process_uid':
/home/vadim/soft/qemu/os-posix.c:205: warning: Using 'initgroups' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking # and many alike warnings
...
../ui/curses.o: In function `curses_cursor_position':
/home/vadim/soft/qemu/ui/curses.c:137: undefined reference to `COLS'
/home/vadim/soft/qemu/ui/curses.c:137: undefined reference to `LINES'
/home/vadim/soft/qemu/ui/curses.c:138: undefined reference to `stdscr'
/home/vadim/soft/qemu/ui/curses.c:139: undefined reference to `curs_set'
../ui/curses.o: In function `curses_calc_pad':
/home/vadim/soft/qemu/ui/curses.c:68: undefined reference to `stdscr'
/home/vadim/soft/qemu/ui/curses.c:69: undefined reference to `stdscr'
... and so on

I tried to build the very minimal static qemu executable. Actual configure line I tried first was
../../configure --target-list=i386-softmmu --disable-sdl --disable-virtfs --disable-vnc --disable-xen --disable-brlapi --disable-bluez --disable-slirp --disable-kvm --disable-user --disable-vde --disable-vhost-net --disable-spice --disable-libiscsi --disable-smartcard --disable-usb-redir --disable-guest-agent --audio-drv-list= --audio-card-list= --enable-curses --static

and the errors was the same.

** Affects: qemu
Importance: Undecided
Status: New

Signature · 53 lines
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1094786

Title:
  static build with curses fails if requires -ltinfo

Status in QEMU:
  New

Bug description:
  On my system (amd64 Debian wheezy/sid) static ncurses build requires -ltinfo:
  $ pkg-config --libs --static ncurses
  -lncurses -ltinfo

  $ ../../configure --enable-curses --static
  # Actually this fails on line
      if compile_prog "" "$curses_lib" ; then
  # with
  ERROR
  ERROR: User requested feature curses
  ERROR: configure was not able to find it
  ERROR
  # but if we add -ltinfo to this line check succeds
  ...
  static build      yes
  ...

  $ make
  ...
  ...
    CC    i386-softmmu/hw/i386/../kvm/pci-assign.o
    LINK  i386-softmmu/qemu-system-i386
  ../os-posix.o: In function `change_process_uid':
  /home/vadim/soft/qemu/os-posix.c:205: warning: Using 'initgroups' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking # and many alike warnings
  ...
  ../ui/curses.o: In function `curses_cursor_position':
  /home/vadim/soft/qemu/ui/curses.c:137: undefined reference to `COLS'
  /home/vadim/soft/qemu/ui/curses.c:137: undefined reference to `LINES'
  /home/vadim/soft/qemu/ui/curses.c:138: undefined reference to `stdscr'
  /home/vadim/soft/qemu/ui/curses.c:139: undefined reference to `curs_set'
  ../ui/curses.o: In function `curses_calc_pad':
  /home/vadim/soft/qemu/ui/curses.c:68: undefined reference to `stdscr'
  /home/vadim/soft/qemu/ui/curses.c:69: undefined reference to `stdscr'
  ... and so on

  I tried to build the very minimal static qemu executable. Actual configure line I tried first was 
  ../../configure --target-list=i386-softmmu --disable-sdl --disable-virtfs --disable-vnc --disable-xen --disable-brlapi --disable-bluez --disable-slirp --disable-kvm --disable-user --disable-vde --disable-vhost-net --disable-spice --disable-libiscsi --disable-smartcard --disable-usb-redir --disable-guest-agent  --audio-drv-list=  --audio-card-list= --enable-curses --static

  and the errors was the same.

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1094786/+subscriptions
#1 lore raw

I can reproduce this issue.

I tried

./configure --static --target-list="x86_64-softmmu" --enable-curse

I get

ERROR
ERROR: User requested feature curses
ERROR: configure was not able to find it
ERROR

Signature · 53 lines
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1094786

Title:
  static build with curses fails if requires -ltinfo

Status in QEMU:
  New

Bug description:
  On my system (amd64 Debian wheezy/sid) static ncurses build requires -ltinfo:
  $ pkg-config --libs --static ncurses
  -lncurses -ltinfo

  $ ../../configure --enable-curses --static
  # Actually this fails on line
      if compile_prog "" "$curses_lib" ; then
  # with
  ERROR
  ERROR: User requested feature curses
  ERROR: configure was not able to find it
  ERROR
  # but if we add -ltinfo to this line check succeds
  ...
  static build      yes
  ...

  $ make
  ...
  ...
    CC    i386-softmmu/hw/i386/../kvm/pci-assign.o
    LINK  i386-softmmu/qemu-system-i386
  ../os-posix.o: In function `change_process_uid':
  /home/vadim/soft/qemu/os-posix.c:205: warning: Using 'initgroups' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking # and many alike warnings
  ...
  ../ui/curses.o: In function `curses_cursor_position':
  /home/vadim/soft/qemu/ui/curses.c:137: undefined reference to `COLS'
  /home/vadim/soft/qemu/ui/curses.c:137: undefined reference to `LINES'
  /home/vadim/soft/qemu/ui/curses.c:138: undefined reference to `stdscr'
  /home/vadim/soft/qemu/ui/curses.c:139: undefined reference to `curs_set'
  ../ui/curses.o: In function `curses_calc_pad':
  /home/vadim/soft/qemu/ui/curses.c:68: undefined reference to `stdscr'
  /home/vadim/soft/qemu/ui/curses.c:69: undefined reference to `stdscr'
  ... and so on

  I tried to build the very minimal static qemu executable. Actual configure line I tried first was 
  ../../configure --target-list=i386-softmmu --disable-sdl --disable-virtfs --disable-vnc --disable-xen --disable-brlapi --disable-bluez --disable-slirp --disable-kvm --disable-user --disable-vde --disable-vhost-net --disable-spice --disable-libiscsi --disable-smartcard --disable-usb-redir --disable-guest-agent  --audio-drv-list=  --audio-card-list= --enable-curses --static

  and the errors was the same.

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1094786/+subscriptions
#2 lore raw
In reply to Felagund

Please try qemu.git/master.

If the error still occurs, please attach config.log.

The problem may have to do with the way ./configure compile_prog and pkg_config interact with the --static option. The --static option is supposed to set up LDFLAGS -static and pkg-config --static.

The curses probing code tries building -lncurses, -lcurses, and finally pkg-config ncurses. Try the following change:
curses_list="$($pkg_config --libs ncurses 2>/dev/null):-lncurses:-lcurses"

That will probe pkg-config ncurses first.

Signature · 53 lines
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1094786

Title:
  static build with curses fails if requires -ltinfo

Status in QEMU:
  New

Bug description:
  On my system (amd64 Debian wheezy/sid) static ncurses build requires -ltinfo:
  $ pkg-config --libs --static ncurses
  -lncurses -ltinfo

  $ ../../configure --enable-curses --static
  # Actually this fails on line
      if compile_prog "" "$curses_lib" ; then
  # with
  ERROR
  ERROR: User requested feature curses
  ERROR: configure was not able to find it
  ERROR
  # but if we add -ltinfo to this line check succeds
  ...
  static build      yes
  ...

  $ make
  ...
  ...
    CC    i386-softmmu/hw/i386/../kvm/pci-assign.o
    LINK  i386-softmmu/qemu-system-i386
  ../os-posix.o: In function `change_process_uid':
  /home/vadim/soft/qemu/os-posix.c:205: warning: Using 'initgroups' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking # and many alike warnings
  ...
  ../ui/curses.o: In function `curses_cursor_position':
  /home/vadim/soft/qemu/ui/curses.c:137: undefined reference to `COLS'
  /home/vadim/soft/qemu/ui/curses.c:137: undefined reference to `LINES'
  /home/vadim/soft/qemu/ui/curses.c:138: undefined reference to `stdscr'
  /home/vadim/soft/qemu/ui/curses.c:139: undefined reference to `curs_set'
  ../ui/curses.o: In function `curses_calc_pad':
  /home/vadim/soft/qemu/ui/curses.c:68: undefined reference to `stdscr'
  /home/vadim/soft/qemu/ui/curses.c:69: undefined reference to `stdscr'
  ... and so on

  I tried to build the very minimal static qemu executable. Actual configure line I tried first was 
  ../../configure --target-list=i386-softmmu --disable-sdl --disable-virtfs --disable-vnc --disable-xen --disable-brlapi --disable-bluez --disable-slirp --disable-kvm --disable-user --disable-vde --disable-vhost-net --disable-spice --disable-libiscsi --disable-smartcard --disable-usb-redir --disable-guest-agent  --audio-drv-list=  --audio-card-list= --enable-curses --static

  and the errors was the same.

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1094786/+subscriptions
#3 lore raw
In reply to Felagund

** Also affects: freebsd-ports-mirror
Importance: Undecided
Status: New

** No longer affects: freebsd-ports-mirror

Signature · 53 lines
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1094786

Title:
  static build with curses fails if requires -ltinfo

Status in QEMU:
  New

Bug description:
  On my system (amd64 Debian wheezy/sid) static ncurses build requires -ltinfo:
  $ pkg-config --libs --static ncurses
  -lncurses -ltinfo

  $ ../../configure --enable-curses --static
  # Actually this fails on line
      if compile_prog "" "$curses_lib" ; then
  # with
  ERROR
  ERROR: User requested feature curses
  ERROR: configure was not able to find it
  ERROR
  # but if we add -ltinfo to this line check succeds
  ...
  static build      yes
  ...

  $ make
  ...
  ...
    CC    i386-softmmu/hw/i386/../kvm/pci-assign.o
    LINK  i386-softmmu/qemu-system-i386
  ../os-posix.o: In function `change_process_uid':
  /home/vadim/soft/qemu/os-posix.c:205: warning: Using 'initgroups' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking # and many alike warnings
  ...
  ../ui/curses.o: In function `curses_cursor_position':
  /home/vadim/soft/qemu/ui/curses.c:137: undefined reference to `COLS'
  /home/vadim/soft/qemu/ui/curses.c:137: undefined reference to `LINES'
  /home/vadim/soft/qemu/ui/curses.c:138: undefined reference to `stdscr'
  /home/vadim/soft/qemu/ui/curses.c:139: undefined reference to `curs_set'
  ../ui/curses.o: In function `curses_calc_pad':
  /home/vadim/soft/qemu/ui/curses.c:68: undefined reference to `stdscr'
  /home/vadim/soft/qemu/ui/curses.c:69: undefined reference to `stdscr'
  ... and so on

  I tried to build the very minimal static qemu executable. Actual configure line I tried first was 
  ../../configure --target-list=i386-softmmu --disable-sdl --disable-virtfs --disable-vnc --disable-xen --disable-brlapi --disable-bluez --disable-slirp --disable-kvm --disable-user --disable-vde --disable-vhost-net --disable-spice --disable-libiscsi --disable-smartcard --disable-usb-redir --disable-guest-agent  --audio-drv-list=  --audio-card-list= --enable-curses --static

  and the errors was the same.

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1094786/+subscriptions
#4 lore raw
In reply to Felagund

I ran into the same issue on FreeBSD, and just posted my patch to the qemu-devel list. It's the same solution stefanha describes above.

(On FreeBSD we have an additional issue; we don't ship the .pc file with the ncurses port right now. I just hacked one together to include -ltinfo in Libs.private.)

Signature · 53 lines
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1094786

Title:
  static build with curses fails if requires -ltinfo

Status in QEMU:
  New

Bug description:
  On my system (amd64 Debian wheezy/sid) static ncurses build requires -ltinfo:
  $ pkg-config --libs --static ncurses
  -lncurses -ltinfo

  $ ../../configure --enable-curses --static
  # Actually this fails on line
      if compile_prog "" "$curses_lib" ; then
  # with
  ERROR
  ERROR: User requested feature curses
  ERROR: configure was not able to find it
  ERROR
  # but if we add -ltinfo to this line check succeds
  ...
  static build      yes
  ...

  $ make
  ...
  ...
    CC    i386-softmmu/hw/i386/../kvm/pci-assign.o
    LINK  i386-softmmu/qemu-system-i386
  ../os-posix.o: In function `change_process_uid':
  /home/vadim/soft/qemu/os-posix.c:205: warning: Using 'initgroups' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking # and many alike warnings
  ...
  ../ui/curses.o: In function `curses_cursor_position':
  /home/vadim/soft/qemu/ui/curses.c:137: undefined reference to `COLS'
  /home/vadim/soft/qemu/ui/curses.c:137: undefined reference to `LINES'
  /home/vadim/soft/qemu/ui/curses.c:138: undefined reference to `stdscr'
  /home/vadim/soft/qemu/ui/curses.c:139: undefined reference to `curs_set'
  ../ui/curses.o: In function `curses_calc_pad':
  /home/vadim/soft/qemu/ui/curses.c:68: undefined reference to `stdscr'
  /home/vadim/soft/qemu/ui/curses.c:69: undefined reference to `stdscr'
  ... and so on

  I tried to build the very minimal static qemu executable. Actual configure line I tried first was 
  ../../configure --target-list=i386-softmmu --disable-sdl --disable-virtfs --disable-vnc --disable-xen --disable-brlapi --disable-bluez --disable-slirp --disable-kvm --disable-user --disable-vde --disable-vhost-net --disable-spice --disable-libiscsi --disable-smartcard --disable-usb-redir --disable-guest-agent  --audio-drv-list=  --audio-card-list= --enable-curses --static

  and the errors was the same.

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1094786/+subscriptions
#5 lore raw
In reply to Felagund

Patch had been included here:
http://git.qemu.org/?p=qemu.git;a=commitdiff;h=cfeda5f4b8710b6ba14
So I think we can now mark this ticket as "Fix released".

** Changed in: qemu
Status: New => Fix Released

Signature · 53 lines
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1094786

Title:
  static build with curses fails if requires -ltinfo

Status in QEMU:
  Fix Released

Bug description:
  On my system (amd64 Debian wheezy/sid) static ncurses build requires -ltinfo:
  $ pkg-config --libs --static ncurses
  -lncurses -ltinfo

  $ ../../configure --enable-curses --static
  # Actually this fails on line
      if compile_prog "" "$curses_lib" ; then
  # with
  ERROR
  ERROR: User requested feature curses
  ERROR: configure was not able to find it
  ERROR
  # but if we add -ltinfo to this line check succeds
  ...
  static build      yes
  ...

  $ make
  ...
  ...
    CC    i386-softmmu/hw/i386/../kvm/pci-assign.o
    LINK  i386-softmmu/qemu-system-i386
  ../os-posix.o: In function `change_process_uid':
  /home/vadim/soft/qemu/os-posix.c:205: warning: Using 'initgroups' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking # and many alike warnings
  ...
  ../ui/curses.o: In function `curses_cursor_position':
  /home/vadim/soft/qemu/ui/curses.c:137: undefined reference to `COLS'
  /home/vadim/soft/qemu/ui/curses.c:137: undefined reference to `LINES'
  /home/vadim/soft/qemu/ui/curses.c:138: undefined reference to `stdscr'
  /home/vadim/soft/qemu/ui/curses.c:139: undefined reference to `curs_set'
  ../ui/curses.o: In function `curses_calc_pad':
  /home/vadim/soft/qemu/ui/curses.c:68: undefined reference to `stdscr'
  /home/vadim/soft/qemu/ui/curses.c:69: undefined reference to `stdscr'
  ... and so on

  I tried to build the very minimal static qemu executable. Actual configure line I tried first was 
  ../../configure --target-list=i386-softmmu --disable-sdl --disable-virtfs --disable-vnc --disable-xen --disable-brlapi --disable-bluez --disable-slirp --disable-kvm --disable-user --disable-vde --disable-vhost-net --disable-spice --disable-libiscsi --disable-smartcard --disable-usb-redir --disable-guest-agent  --audio-drv-list=  --audio-card-list= --enable-curses --static

  and the errors was the same.

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1094786/+subscriptions