bugmake - Bugs: bug #39560, directory search order for link...


bug #39560: directory search order for link libraries

Submitted by:  Tobias Preclik <macin>
Submitted on:  Wed 24 Jul 2013 09:22:07 AM UTC  
Severity:  3 - Normal Item Group:  Bug
Status:  Duplicate Privacy:  Public
Assigned to:  None Open/Closed:  Closed
Component Version:  3.82 Operating System:  None
Fixed Release:  None Triage Status:  None

Add a New Comment(Rich Markup)

You are not logged in

Please log in, so followups can be emailed to you.


Sun 22 Sep 2013 07:31:03 PM UTC, comment #1:

I can reproduce this on 3.82, but only if the (ostensibly not used) vpath lib%.a pattern is present. If I remove that first line it works properly. Weird.

I can't reproduce this at all in the current release candidates for the next version of GNU make, so this issue must have already been fixed.

Paul D. Smith <psmith>
Project Administrator
Wed 24 Jul 2013 09:22:07 AM UTC, original submission:

Consider the following Makefile:

# --- >8 ---

vpath lib%.a /tmp/boosttmp/
vpath lib%.so /tmp/boosttmp/

a: -lm -lboost_system
@echo target a: $^

b: -lboost_system -lm
@echo target b: $^

# --- >8 ---

Note that /tmp/boosttmp/ as well as some system library path must contain libboost_system.so to reproduce the bug. From my understanding make will search the vpath first and then the system directories. Now consider the following executions of make:

$ make a
target a: /usr/lib64/libm.so /usr/lib64/libboost_system.so
$ make b
target b: /tmp/boosttmp/libboost_system.a /usr/lib64/libm.so
$ make a b
target a: /usr/lib64/libm.so /usr/lib64/libboost_system.so
target b: /usr/lib64/libboost_system.so /usr/lib64/libm.so
$ make b a
target b: /tmp/boosttmp/libboost_system.a /usr/lib64/libm.so
target a: /usr/lib64/libm.so /tmp/boosttmp/libboost_system.a

"make a" and "make a b" find the libboost_system libray in the system directories but "make b" and "make b a" in the vpath directory. Note also that the expansion of target a and b is inconsistent in the different executions.

Tobias Preclik <macin>


(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:

No files currently attached


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by psmith (Posted a comment)
  • -email is unavailable- added by macin (Submitted the item)

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.




    Follow 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2013-09-22 psmith StatusNone => Duplicate
        Open/ClosedOpen => Closed

    Back to the top

    Powered by Savane 3.3