Summary: | `pkg-config --libs` should swallow -L/lib like it does with -L/usr/lib | ||
---|---|---|---|
Product: | pkg-config | Reporter: | Samuli Suominen <ssuominen> |
Component: | src | Assignee: | Dan Nicholson <dbn.lists> |
Status: | RESOLVED FIXED | QA Contact: | |
Severity: | normal | ||
Priority: | medium | CC: | freedesktop-bugs, vapier |
Version: | unspecified | ||
Hardware: | All | ||
OS: | All | ||
See Also: | https://bugs.gentoo.org/show_bug.cgi?id=445796 | ||
Whiteboard: | |||
i915 platform: | i915 features: | ||
Attachments: | Add root /lib* directories to the default -L paths |
Description
Samuli Suominen
2012-12-16 13:28:20 UTC
Created attachment 71591 [details] [review] Add root /lib* directories to the default -L paths Avoids outputting -L/lib, which the linker will search in implicitly like -L/usr/lib. Freedesktop #58363 (https://bugs.freedesktop.org/show_bug.cgi?id=58363) I can't believe I never noticed that before. Does the attached patch help? On the other hand, I'm a little wary of encoding this behavior by default since I'm only familiar with gcc, which does contain /lib in it's default. Gentoo could easily just configure their pkg-config with --with-system-library-path=/usr/lib:/lib or whatever you want to tune it to. What do you guys think? Mike? I'm waiting for a comment from other Gentoo developers (made a query on IRC) and if nobody is seeing a problem this would introduce, I'm going to apply the patch for testing with a incremental revision bumped package tomorrow. I'd rather see the configure.ac patched like you just did, than pass the ./configure flag manually, it just makes sense to have by default there. (In reply to comment #3) > I'd rather see the configure.ac patched like you just did, than pass the > ./configure flag manually, it just makes sense to have by default there. Right, I'm questioning whether it makes sense that is the default for everybody. For GCC/GNU LD, yeah definitely this makes sense. But does it for every toolchain? I suppose the alternate toolchains would be more in the minority and the onus would be on those users to configure with their correct --with-system-library-path. (In reply to comment #4) if pkg-config is doing it for /usr/lib type paths, then it makes sense for /lib type paths too. i don't think the underlying toolchain matters. however, the proposed patch isn't complete :/. to be fair, the existing code isn't complete either. it misses standard ABI dirs like lib32 and libx32. maybe the existing code could read: pc_lib_sfx=$(echo "$libdir" | sed 's:.*/lib::') case "$pc_lib_sfx" in */*|"") system_library_path="/usr/lib:/lib" ;; *) system_library_path="/usr/lib$pc_lib_sfx:/lib$pc_lib_sfx:/usr/lib:/lib" ;; esac (In reply to comment #5) > > pc_lib_sfx=$(echo "$libdir" | sed 's:.*/lib::') > case "$pc_lib_sfx" in > */*|"") > system_library_path="/usr/lib:/lib" > ;; > *) > system_library_path="/usr/lib$pc_lib_sfx:/lib$pc_lib_sfx:/usr/lib:/lib" > ;; > esac Yep, good call. I added this as a second commit and have now pushed them both. The bug is fixed in 72e1346, and the addition to handle various ABIs is in 4dac402 authored by you. Thanks! |
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.