sabotage-linux / netbsd-curses

libcurses and dependencies taken from netbsd and brought into a portable shape (at least to musl or glibc)
Other
152 stars 15 forks source link

ul (util-linux 2.29): undefined references #20

Closed githububub closed 7 years ago

githububub commented 7 years ago

Workaround is to --disable-ul.

text-utils/ul-ul.o: In function `xsetmode':
ul.c:(.text+0x259): undefined reference to `tputs'
ul.c:(.text+0x276): undefined reference to `tputs'
text-utils/ul-ul.o: In function `outc':
ul.c:(.text+0x4f5): undefined reference to `tputs'
ul.c:(.text+0x535): undefined reference to `tputs'
text-utils/ul-ul.o: In function `flushln':
ul.c:(.text+0x6bb): undefined reference to `tputs'
text-utils/ul-ul.o:ul.c:(.text+0xbe7): more undefined references to `tputs' follow
text-utils/ul-ul.o: In function `main':
ul.c:(.text.startup+0x145): undefined reference to `setupterm'
ul.c:(.text.startup+0x17b): undefined reference to `setupterm'
ul.c:(.text.startup+0x187): undefined reference to `tigetstr'
ul.c:(.text.startup+0x19a): undefined reference to `tigetstr'
ul.c:(.text.startup+0x1ad): undefined reference to `tigetstr'
ul.c:(.text.startup+0x1ce): undefined reference to `tigetstr'
ul.c:(.text.startup+0x1e1): undefined reference to `tigetstr'
text-utils/ul-ul.o:ul.c:(.text.startup+0x1f4): more undefined references to `tigetstr' follow
text-utils/ul-ul.o: In function `main':
ul.c:(.text.startup+0x2d7): undefined reference to `tigetflag'
ul.c:(.text.startup+0x2f5): undefined reference to `tigetflag'
collect2: error: ld returned 1 exit status
make[2]: *** [Makefile:6883: ul] Error 1
make[2]: *** Waiting for unfinished jobs....
ar: `u' modifier ignored since `D' is the default (see `U')
copying selected object files to avoid basename conflicts...
ar: `u' modifier ignored since `D' is the default (see `U')
make[2]: Leaving directory '/tmp/archives/util-linux/src/util-linux-2.29'
make[1]: *** [Makefile:11436: all-recursive] Error 1
make[1]: Leaving directory '/tmp/archives/util-linux/src/util-linux-2.29'
make: *** [Makefile:4767: all] Error 2
==> ERROR: A failure occurred in build().
    Aborting...
rofl0r commented 7 years ago

these are all funcs found in libterminfo.so:

~ $ readelf -a /lib/libterminfo.so | grep setupterm
00000020e3e0  001000000007 R_X86_64_JUMP_SLO 0000000000002c82 ti_setupterm + 0
00000020e4f8  004500000007 R_X86_64_JUMP_SLO 0000000000002e00 setupterm + 0
    16: 0000000000002c82   382 FUNC    GLOBAL DEFAULT    8 ti_setupterm
    69: 0000000000002e00    59 FUNC    GLOBAL DEFAULT    8 setupterm
    48: 0000000000000000     0 FILE    LOCAL  DEFAULT  ABS setupterm.c
   116: 0000000000002c82   382 FUNC    GLOBAL DEFAULT    8 ti_setupterm
   169: 0000000000002e00    59 FUNC    GLOBAL DEFAULT    8 setupterm
~ $ readelf -a /lib/libterminfo.so | grep tputs
00000020e488  002e00000007 R_X86_64_JUMP_SLO 000000000000402b tputs + 0
    46: 000000000000402b    50 FUNC    GLOBAL DEFAULT    8 tputs
    59: 0000000000000000     0 FILE    LOCAL  DEFAULT  ABS tputs.c
   146: 000000000000402b    50 FUNC    GLOBAL DEFAULT    8 tputs
~ $ readelf -a /lib/libterminfo.so | grep tigetstr
    53: 0000000000002c66    28 FUNC    GLOBAL DEFAULT    8 tigetstr
   153: 0000000000002c66    28 FUNC    GLOBAL DEFAULT    8 tigetstr
~ $ readelf -a /lib/libterminfo.so | grep tigetflag
    40: 0000000000002b4f    27 FUNC    GLOBAL DEFAULT    8 tigetflag
   140: 0000000000002b4f    27 FUNC    GLOBAL DEFAULT    8 tigetflag
~ $ 

that means you somehow got to add -lterminfo into LDFLAGS/LIBS

githububub commented 7 years ago

Got it. I initially followed the followed the Sabotage build recipe and used LIBS= instead of LDFLAGS=. Thanks. I will have to try out Sabotage on a spare box one of these days...