delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2014/01/10/06:49:58

X-Recipient: archive-cygwin AT delorie DOT com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:from:to:cc:subject:date:message-id
:mime-version:content-type:content-transfer-encoding; q=dns; s=
default; b=rIWvmaeKv3qSZ2kMNqfqV1L2iILIe7o/q27nooGe/tVUsSsdzYdnF
wLS3VQkTGpyXgiV9uO9PThBQxnfUiraG+uhdTlazSvMoKXofQecUTdP5QXCqhbKa
+9BbIJJeHtCmr1Wclu+bCP7efzMGpg2xGdqlnV1IcSrifZ1eNTGCc0=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:from:to:cc:subject:date:message-id
:mime-version:content-type:content-transfer-encoding; s=default;
bh=Nv0qDyP7kMzJ9LiyP17/WTqcMO4=; b=sGWuOZ1TCmKV7kx7BUDKT2kRpg0k
tDCyPXpEXr+Td49x8LzG8nWK/15yncsC6prukfy8Q/SoWxPGrE/eYJNnAMd4DKVL
WX5wuad4JDhBEb/cNIKvjqy2OrAvg5xwcZHXNxDOjBlPQLTzd+FEiw/vkzJ3XKN6
fYQ3PUWcKFbJUiA=
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Authentication-Results: sourceware.org; auth=none
X-Virus-Found: No
X-Spam-SWARE-Status: No, score=-1.0 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS,T_MANY_HDRS_LCASE autolearn=ham version=3.3.2
X-HELO: mailout3.w1.samsung.com
From: Pavel Fedin <p DOT fedin AT samsung DOT com>
To: bug-make AT gnu DOT org
Cc: cygwin AT cygwin DOT com
Subject: [BUG] GNU Make - bad default .LIBPATTERNS on Windows/Cygwin
Date: Fri, 10 Jan 2014 15:49:35 +0400
Message-id: <001601cf0dfa$09311370$1b933a50$%fedin@samsung.com>
MIME-version: 1.0
X-IsSubscribed: yes

 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
default.c:
--- 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:
http://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=blob;f=ld/emultemp
l/pe.em;h=5d6da9e05f14425cfad9cc4ec71e1a20e450b336;hb=HEAD#l2068
 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




--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019