From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qt1-x835.google.com (mail-qt1-x835.google.com [IPv6:2607:f8b0:4864:20::835]) by sourceware.org (Postfix) with ESMTPS id 98C953898523 for ; Fri, 18 Dec 2020 03:45:56 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 98C953898523 Received: by mail-qt1-x835.google.com with SMTP id 2so465528qtt.10 for ; Thu, 17 Dec 2020 19:45:56 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=ZjZdVq20ubVqAgY367yOUYjBiaV5hz0IjAmUzTdZU/E=; b=p+EM9muD63K1C86S3nn4SXKYs06ztQYLio5hFUIjYXsXOzb1AEmTM/q8gzYLCiYASa cR6yybful50vNfDZfz33F1hBJGGJuNqqG+MnG8XwSGLh4zunBLzi29GiVgoxzrqO9eqQ jB5ormVz4d5bsQWHLD1idKIIIcg2mVhqESaPQ8LcRLExhjLSwbRCwWoIoOrD0I1M1GPz +HUo8dco2kOVNX1ie0aY2x4Y7bSs8FEne9qeBiA4m+83dVswHEUWtqzZ0QyAm+Bi6edl nYo4IOZRwtwK00OADyixmRdyD7itGtkoP6qD8lPLVaKiOFLWLXSdJbnre71TC1YeJ+05 U9jg== X-Gm-Message-State: AOAM530TfGdgOldTVd9oGXcW53NafLeLYgIpx1GSJFXafusdoaunR77x 2FYSgVsLUPvwT6s5jTL1TDb5yF0R2DAQaxDBd52CJWyABLQ= X-Google-Smtp-Source: ABdhPJyNn04aGxa2qEMRlSNUjQLav1G4OwLZwnlhSxAzXEmr8ZnPT/EGd51g5h8q0Bouc6nwhYF3/E/TjogFuVBfNFQ= X-Received: by 2002:ac8:148f:: with SMTP id l15mr2141889qtj.130.1608263156067; Thu, 17 Dec 2020 19:45:56 -0800 (PST) MIME-Version: 1.0 Received: by 2002:a0c:f40f:0:0:0:0:0 with HTTP; Thu, 17 Dec 2020 19:45:55 -0800 (PST) From: Lee Date: Fri, 18 Dec 2020 03:45:55 +0000 Message-ID: Subject: why does i686-w64-mingw32-gcc -static fail? To: cygwin@cygwin.com Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: cygwin@cygwin.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: General Cygwin discussions and problem reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Dec 2020 03:45:57 -0000 Would someone please explain why adding "-static" makes i686-w64-mingw32-gcc fail? This works (or at least the compiler doesn't complain) $ i686-w64-mingw32-gcc -o a.exe conftest-pcre.c -lpcreposix -lpcre This does not work $ i686-w64-mingw32-gcc -o a.exe -static conftest-pcre.c -lpcreposix -lpcre /usr/lib/gcc/i686-w64-mingw32/10/../../../../i686-w64-mingw32/bin/ld: cannot find -lpcreposix /usr/lib/gcc/i686-w64-mingw32/10/../../../../i686-w64-mingw32/bin/ld: cannot find -lpcre collect2: error: ld returned 1 exit status Why does adding "-static" make it fail? $ cat conftest-pcre.c /* i686-w64-mingw32-gcc -o a.exe -static conftest-pcre.c -lpcreposix -lpcre * and yet this works * i686-w64-mingw32-gcc -o a.exe conftest-pcre.c -lpcreposix -lpcre */ char pcre_compile (); char regcomp (); int main () { return pcre_compile (); return regcomp (); ; return 0; } Thanks Lee