mold icon indicating copy to clipboard operation
mold copied to clipboard

SEARCH_DIR token not recognized in ld script

Open danyspin97 opened this issue 2 years ago • 2 comments

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

danyspin97 avatar Mar 01 '22 12:03 danyspin97

Maybe it is better to fix pkgconfig files in ncurses package?

X547 avatar Mar 02 '22 13:03 X547

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.

rui314 avatar Apr 07 '22 07:04 rui314