NJU-ProjectN / nemu

NJU EMUlator, a full system x86/mips32/riscv32/riscv64 emulator for teaching
Other
858 stars 184 forks source link

make menuconfig failed on Gentoo Linux #67

Closed ccbry closed 1 year ago

ccbry commented 1 year ago

Running make menuconfig on Gentoo Linux can produce following error message even if nucrses being installed: /usr/lib/gcc/x86_64-pc-linux-gnu/12/../../../../x86_64-pc-linux-gnu/bin/ld: /home/pzy/Documents/Sync/ics2022/nemu/tools/kconfig/build/obj-mconf/lxdialog/util.o: undefined reference to symbol 'nodelay' /usr/lib/gcc/x86_64-pc-linux-gnu/12/../../../../x86_64-pc-linux-gnu/bin/ld: /usr/lib64/libtinfo.so.6: error adding symbols: DSO missing from command line It turns out to be the problem of Gentoo's "tinfo" USE flag, this use flag forces some symbols from libncurses.so to be moved to libtinfo.so. This can be easily fixed bu adding "-ltinfo" after LIBS += -lncurses of /nemu/tools/kconfig/Makefile

However, I'm wondering if there is need to add this fix to source code or if pkg-config can be intruduce to source code to generate needed libraries to compeletely avoid this problem?

sashimi-yzh commented 1 year ago

We do not want to introduce pkg-config, since it is complicated and not easy for students to understand in terms of teaching.

I think you can add -ltinfo if the current system is Gentoo Linux. Would you please open a PR for this?

sashimi-yzh commented 1 year ago

Fixed in #68