https://sourceware.org/bugzilla/show_bug.cgi?id=26169
Bug ID: 26169 Summary: --dependency-file generates dependencies on unnecessary shared libraries Product: binutils Version: 2.35 (HEAD) Status: NEW Severity: normal Priority: P2 Component: ld Assignee: unassigned at sourceware dot org Reporter: hjl.tools at gmail dot com CC: roland at gnu dot org Target Milestone: --- Created attachment 12659 --> https://sourceware.org/bugzilla/attachment.cgi?id=12659&action=edit A testcase [hjl@gnu-cfl-2 foo]$ gcc -m32 -shared -Wl,-soname,libbar.so -o libbar.so bar.c -fPIC [hjl@gnu-cfl-2 foo]$ make gcc -B./ -fPIC -c -o foo.o foo.c gcc -B./ -fPIC -c -o bar.o bar.c mkdir -p 64 gcc -B./ -shared -Wl,-soname,libbar.so -o 64/libbar.so bar.o gcc -B./ -shared -o libfoo.so foo.o 64/libbar.so gcc -B./ -c -o a.o a.c gcc -B./ -o a a.o -L. -L64 -lfoo -Wl,-R,.:64,--dependency-file,a.dep ./a Hello [hjl@gnu-cfl-2 foo]$ rm libbar.so [hjl@gnu-cfl-2 foo]$ make gcc -B./ -o a a.o -L. -L64 -lfoo -Wl,-R,.:64,--dependency-file,a.dep ^^^^^^^^^^^^^^ This rebuild is unnecessary. ./a Hello [hjl@gnu-cfl-2 foo]$ make ./a Hello [hjl@gnu-cfl-2 foo]$ -- You are receiving this mail because: You are on the CC list for the bug.