mold
mold copied to clipboard
SEARCH_DIR token not recognized in ld script
Hi! While testing mold, I have found out a token in a ld script not recognized. I am using openSUSE Tumbleweed, mold-1.1. The file libncursesw.so contains the following script:
/* GNU ld script */
SEARCH_DIR(/usr/lib64/ncurses5)
INPUT(/usr/lib64/libncursesw.so.5 AS_NEEDED(-ltinfo))
The error was the following:
mold: /usr/lib64/ncurses5/libncursesw.so:2: SEARCH_DIR(/usr/lib64/ncurses5)
^ unknown linker script token
Maybe it is better to fix pkgconfig files in ncurses package?
I agree with @X547. Adding a library path that way may surprise users of the library, as "just appending -lncursew" has a hidden side effect. It may be very hard for users to notice that libncursesw.so
is not a shared object file but actually a text file, so it is hard to debug if that side effect causes a problem.