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 - NormalItem Group: Bug
Status: DuplicatePrivacy: Public
Assigned to: NoneOpen/Closed: Closed
Component Version: 3.82Operating System: None
Fixed Release: NoneTriage 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 File(s):

No files currently attached


Depends on the following items: None found

Items that depend on this one: None found


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

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

    Only logged-in users can vote.


    Please enter the title of George Orwell's famous dystopian book (it's a date):



    Follow 2 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sun 22 Sep 2013 07:31:03 PM UTCpsmithStatusNone=>Duplicate

    Back to the top

    Powered by Savane 3.1-cleanup1