[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[BUG] GNU Make - bad default .LIBPATTERNS on Windows/Cygwin

From: Pavel Fedin
Subject: [BUG] GNU Make - bad default .LIBPATTERNS on Windows/Cygwin
Date: Fri, 10 Jan 2014 15:49:35 +0400

 Hello! I've just discovered one more bug in GNU Make under Cygwin.

 Make is able to understand -lfoo as depencencies and tries its best to look
up libraries correctly. However in some situations it fails to do so because
it lacks proper templates for Cygwin.
 The problem is fixed by adding the following proper definitions to
--- cut ---
#elif defined(__CYGWIN__) || defined(WINDOWS32)
    ".LIBPATTERNS", "lib%.dll.a %.dll.a lib%.a %.lib lib%.dll %.dll",
--- cut ---
 I have obtained these rules from GNU ld source code:
 Since this file is for all PE targets, i suggest that the same applies also
to native Windows target.

 The problem was triggered by attempting to rebuild nfs-server package with
tirpc library. Its makefiles list $(LIBS) as dependencies. tirpc package for
x86-64 for some reason does not include static version libtirpc.a, only
libtirpc.dll.a. This caused the failure.

 I decided to cross-post this also in Cygwin ML for convenience.

 By the way... A good question: is this approach correct ? Actually i could
cross-compile this package for e.g. Linux host, and in this case i would
have come to the inversed version of the same problem. May be Make could be
more smart and somehow know for which target we are compiling ? For example,
this could be done by calling $(CC) -dumpmachine (in case of gcc >= v4). Or
could it check something like $(HOST) set by makefile ?

Kind regards,
Pavel Fedin
Expert Engineer
Samsung Electronics Research center Russia

reply via email to

[Prev in Thread] Current Thread [Next in Thread]