X-Loop: help-debbugs@HIDDEN
Subject: bug#29298: C++ compiler, Newlib and "implicit declaration of function '_spawnv'"
Resent-From: Jeffrey Walton <noloader@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-libtool@HIDDEN
Resent-Date: Tue, 14 Nov 2017 16:58:02 +0000
Resent-Message-ID: <handler.29298.B.151067865014579 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: report 29298
X-GNU-PR-Package: libtool
X-GNU-PR-Keywords:
To: 29298 <at> debbugs.gnu.org
X-Debbugs-Original-To: bug-libtool@HIDDEN
Reply-To: noloader@HIDDEN
Received: via spool by submit <at> debbugs.gnu.org id=B.151067865014579
(code B ref -1); Tue, 14 Nov 2017 16:58:02 +0000
Received: (at submit) by debbugs.gnu.org; 14 Nov 2017 16:57:30 +0000
Received: from localhost ([127.0.0.1]:40446 helo=debbugs.gnu.org)
by debbugs.gnu.org with esmtp (Exim 4.84_2)
(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
id 1eEeWb-0003my-QT
for submit <at> debbugs.gnu.org; Tue, 14 Nov 2017 11:57:30 -0500
Received: from eggs.gnu.org ([208.118.235.92]:52408)
by debbugs.gnu.org with esmtp (Exim 4.84_2)
(envelope-from <noloader@HIDDEN>) id 1eEeWY-0003mj-Lj
for submit <at> debbugs.gnu.org; Tue, 14 Nov 2017 11:57:23 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
(envelope-from <noloader@HIDDEN>) id 1eEeWS-0007ut-5E
for submit <at> debbugs.gnu.org; Tue, 14 Nov 2017 11:57:17 -0500
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level:
X-Spam-Status: No, score=0.0 required=5.0 tests=BAYES_40,FREEMAIL_FROM,
T_DKIM_INVALID autolearn=disabled version=3.3.2
Received: from lists.gnu.org ([2001:4830:134:3::11]:44403)
by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32)
(Exim 4.71) (envelope-from <noloader@HIDDEN>) id 1eEeWS-0007uk-25
for submit <at> debbugs.gnu.org; Tue, 14 Nov 2017 11:57:16 -0500
Received: from eggs.gnu.org ([2001:4830:134:3::10]:43370)
by lists.gnu.org with esmtp (Exim 4.71)
(envelope-from <noloader@HIDDEN>) id 1eEeWQ-0000WR-Jo
for bug-libtool@HIDDEN; Tue, 14 Nov 2017 11:57:15 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
(envelope-from <noloader@HIDDEN>) id 1eEeWN-0007tg-Fe
for bug-libtool@HIDDEN; Tue, 14 Nov 2017 11:57:14 -0500
Received: from mail-oi0-x22c.google.com ([2607:f8b0:4003:c06::22c]:53718)
by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16)
(Exim 4.71) (envelope-from <noloader@HIDDEN>) id 1eEeWN-0007tX-AR
for bug-libtool@HIDDEN; Tue, 14 Nov 2017 11:57:11 -0500
Received: by mail-oi0-x22c.google.com with SMTP id h6so14086941oia.10
for <bug-libtool@HIDDEN>; Tue, 14 Nov 2017 08:57:11 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
h=mime-version:reply-to:from:date:message-id:subject:to;
bh=7vttROe7WGksR90c5t17scQcCimqb/S+wgHupCZIc4c=;
b=FL0o9QhuHkXsK38v9D/bYNz2+sBVAoA16LaWAM/iBSfsC+FwerqnNTnNEBjKawQc/8
2vHVmEeuLSto6E48zxc9XSlLhXla9nSRrAV4ByzHPYTECEqiSiu43CLS39akpoD0r2hI
Bj4oB05RmfpfcounxSA/NJDEf1AWb4ehzpw4Ezu8nNPJSN2KEcNMB5S7GIkO/HU6j6PO
UyIJosjIBu2/yMpRVK/mJBuneb5FTsCZ+YVVDiUm0NtIio/tulGrBkKVJ5aRZRcmN9LA
fI2k61DRpc6Wkasnzq1kXAC/35uJLGQcOwKxJmqXOr9gTFArJRgXvdlCkcgbG5waCmgi
o9rg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20161025;
h=x-gm-message-state:mime-version:reply-to:from:date:message-id
:subject:to;
bh=7vttROe7WGksR90c5t17scQcCimqb/S+wgHupCZIc4c=;
b=t6Wf6Wkpad3+b/BE1De9aYp757/p5LXFu0YsTPuXMy6Ux/3VRlN8cOe9l+VWtd3qTS
iphvji/quUpxln851x6v7yZW8mt5SocqWmZWX+GgM8X/QYrhsxSYTd9jFJX/cuQrmMdp
Bb+ybSZP7jcHmWIcqFYyazEdDLHxTFX8B1/h4Gi8+i1OSHfmjGjmp+/XEMwIkuzwzHkv
2A4HLuWJqsWBGDRI6HkHv6it801F1rnjJlXPTNy+tcQPMdZRolE22Ww7c1bqCZDRHWiW
K9pq1CVWUOajspe7AcxcIkWHvCwXOQ4VmLkcJ8zR6z9YSm39bdDoiU4FzgjWFeB1emCr
9YxA==
X-Gm-Message-State: AJaThX5sIxQfuegU1hxGgbuhWOUxWo640vTlSw1ScfG6SykQgFJuo4R+
yOI6soweemFRqjvWH6WI/LOPnR/rM8Nbk23P09ME1Mos
X-Google-Smtp-Source: AGs4zMbFCIgRXcoiX3eCa8J8bWNmJpGBj1Q69n9jUQ+w5pdj5lFYQwG92nOjYUzDN6TFLwNju1lrAucKnqKrRxp4Qkk=
X-Received: by 10.202.8.133 with SMTP id 127mr7492266oii.264.1510678630079;
Tue, 14 Nov 2017 08:57:10 -0800 (PST)
MIME-Version: 1.0
Received: by 10.74.19.71 with HTTP; Tue, 14 Nov 2017 08:57:09 -0800 (PST)
From: Jeffrey Walton <noloader@HIDDEN>
Date: Tue, 14 Nov 2017 11:57:09 -0500
Message-ID: <CAH8yC8mUrmng5HC5YHRwYyPL5gQCRxw6myU=gyAgSdU-fruMRA@HIDDEN>
Content-Type: text/plain; charset="UTF-8"
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
recognized.
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x
X-Received-From: 2001:4830:134:3::11
X-Spam-Score: -4.0 (----)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: 1.0 (+)
Hi Everyone,
We are testing an Autotools front-end on MSYS2. The download is
available from https://mingw-w64.org/.
We are a C++ project so we AC_PROG_CXX and AC_LANG([C++]) in
configure.ac. MSYS2 uses Newlib, and quite a few symbols are missing
because Newlib adheres to Posix more strictly than glibc and
libstdc++. The Autotools machinery produces files like lt-cryptest.c
and lt-cryptestcwd.c.
When libtool compiles its C source files with the C++ compiler on a
system with Newlib, I believe it needs to set _XOPEN_SOURCE=600.
Otherwise, errors like below are encountered. Also see
http://pubs.opengroup.org/onlinepubs/007904975/functions/xsh_chap02_02.html.
In fact, the Newlib folks recommend setting _XOPEN_SOURCE for both the
GNU and Newlib runtimes. Also see
https://sourceware.org/ml/newlib/2017/msg01100.html.
Jeff
**********
/bin/sh ./libtool --tag=CXX --mode=link g++ -pthread
-fdata-sections -ffunction-sections -pipe
-DCRYPTOPP_DATA_DIR='"@pkgdatadir@/cryptopp/"' -g -O2 -pthread
-Wl,--gc-sections -o cryptest.exe cryptest-test.o cryptest-bench1.o
cryptest-bench2.o cryptest-validat0.o cryptest-validat1.o
cryptest-validat2.o cryptest-validat3.o cryptest-datatest.o
cryptest-regtest1.o cryptest-regtest2.o cryptest-regtest3.o
cryptest-dlltest.o cryptest-fipsalgt.o cryptest-adhoc.o libcryptopp.la
/bin/sh ./libtool --tag=CXX --mode=link g++ -pthread
-fdata-sections -ffunction-sections -pipe -g -O2 -pthread
-Wl,--gc-sections -o cryptestcwd.exe cryptestcwd-test.o
cryptestcwd-bench1.o cryptestcwd-bench2.o cryptestcwd-validat0.o
cryptestcwd-validat1.o cryptestcwd-validat2.o cryptestcwd-validat3.o
cryptestcwd-datatest.o cryptestcwd-regtest1.o cryptestcwd-regtest2.o
cryptestcwd-regtest3.o cryptestcwd-dlltest.o cryptestcwd-fipsalgt.o
cryptestcwd-adhoc.o libcryptopp.la
libtool: link: g++ -pthread -fdata-sections -ffunction-sections -pipe
-g -O2 -pthread -Wl,--gc-sections -o .libs/cryptestcwd.exe
cryptestcwd-test.o cryptestcwd-bench1.o cryptestcwd-bench2.o
cryptestcwd-validat0.o cryptestcwd-validat1.o cryptestcwd-validat2.o
cryptestcwd-validat3.o cryptestcwd-datatest.o cryptestcwd-regtest1.o
cryptestcwd-regtest2.o cryptestcwd-regtest3.o cryptestcwd-dlltest.o
cryptestcwd-fipsalgt.o cryptestcwd-adhoc.o ./.libs/libcryptopp.a
-pthread
libtool: link: g++ -pthread -fdata-sections -ffunction-sections -pipe
-DCRYPTOPP_DATA_DIR=\"@pkgdatadir@/cryptopp/\" -g -O2 -pthread
-Wl,--gc-sections -o .libs/cryptest.exe cryptest-test.o
cryptest-bench1.o cryptest-bench2.o cryptest-validat0.o
cryptest-validat1.o cryptest-validat2.o cryptest-validat3.o
cryptest-datatest.o cryptest-regtest1.o cryptest-regtest2.o
cryptest-regtest3.o cryptest-dlltest.o cryptest-fipsalgt.o
cryptest-adhoc.o ./.libs/libcryptopp.a -pthread
./.libs/lt-cryptestcwd.c: In function 'main':
./.libs/lt-cryptest.c: In function 'main':
./.libs/lt-cryptestcwd.c:319:16: warning: implicit declaration of
function '_spawnv' [-Wimplicit-function-declaration]
rval = (int) _spawnv (_P_WAIT, lt_argv_zero, (const char * const *) newargz);
^~~~~~~
./.libs/lt-cryptest.c:319:16: warning: implicit declaration of
function '_spawn ' [-Wimplicit-function-declaration]
rval = (int) _spawnv (_P_WAIT, lt_argv_zero, (const char * const *) newargz);
^~~~~~~
/tmp/ccFfsaBb.o: In function `main':
/home/cryptopp/./.libs/lt-cryptest.c:319: undefined reference to `_spawnv'
/home/cryptopp/./.libs/lt-cryptest.c:319:(.text.startup+0x4b4):
relocation truncated to fit: R_X86_64_PC32 against undefined symbol
`_spawnv'
collect2: error: ld returned 1 exit status
/tmp/ccfJfnlw.o: In function `main':
/home/cryptopp/./.libs/lt-cryptestcwd.c:319: undefined reference to `_spawnv'
/home/cryptopp/./.libs/lt-cryptestcwd.c:319:(.text.startup+0x4b4):
relocation truncated to fit: R_X86_64_PC32 against undefined symbol
`_spawnv'
strip: './cryptest.exe': No such file
collect2: error: ld returned 1 exit status
strip: './cryptestcwd.exe': No such file
./libtool: line 11083: ./cryptest.exe: No such file or directory
./libtool: line 11083: ./cryptestcwd.exe: No such file or directory
make[1]: Leaving directory '/home/cryptopp'
...
Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) Content-Type: text/plain; charset=utf-8 X-Loop: help-debbugs@HIDDEN From: help-debbugs@HIDDEN (GNU bug Tracking System) To: noloader@HIDDEN Subject: bug#29298: Acknowledgement (C++ compiler, Newlib and "implicit declaration of function '_spawnv'") Message-ID: <handler.29298.B.151067865014579.ack <at> debbugs.gnu.org> References: <CAH8yC8mUrmng5HC5YHRwYyPL5gQCRxw6myU=gyAgSdU-fruMRA@HIDDEN> X-Gnu-PR-Message: ack 29298 X-Gnu-PR-Package: libtool Reply-To: 29298 <at> debbugs.gnu.org Date: Tue, 14 Nov 2017 16:58:02 +0000 Thank you for filing a new bug report with debbugs.gnu.org. This is an automatically generated reply to let you know your message has been received. Your message is being forwarded to the package maintainers and other interested parties for their attention; they will reply in due course. Your message has been sent to the package maintainer(s): bug-libtool@HIDDEN If you wish to submit further information on this problem, please send it to 29298 <at> debbugs.gnu.org. Please do not send mail to help-debbugs@HIDDEN unless you wish to report a problem with the Bug-tracking system. --=20 29298: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D29298 GNU Bug Tracking System Contact help-debbugs@HIDDEN with problems
X-Loop: help-debbugs@HIDDEN
Subject: bug#29298: C++ compiler, Newlib and "implicit declaration of function '_spawnv'"
Resent-From: Jeffrey Walton <noloader@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-libtool@HIDDEN
Resent-Date: Tue, 14 Nov 2017 17:09:01 +0000
Resent-Message-ID: <handler.29298.B29298.151067933215686 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 29298
X-GNU-PR-Package: libtool
X-GNU-PR-Keywords:
To: 29298 <at> debbugs.gnu.org
Reply-To: noloader@HIDDEN
Received: via spool by 29298-submit <at> debbugs.gnu.org id=B29298.151067933215686
(code B ref 29298); Tue, 14 Nov 2017 17:09:01 +0000
Received: (at 29298) by debbugs.gnu.org; 14 Nov 2017 17:08:52 +0000
Received: from localhost ([127.0.0.1]:40457 helo=debbugs.gnu.org)
by debbugs.gnu.org with esmtp (Exim 4.84_2)
(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
id 1eEehg-00044w-GK
for submit <at> debbugs.gnu.org; Tue, 14 Nov 2017 12:08:52 -0500
Received: from mail-oi0-f42.google.com ([209.85.218.42]:46912)
by debbugs.gnu.org with esmtp (Exim 4.84_2)
(envelope-from <noloader@HIDDEN>) id 1eEehe-00044j-Nb
for 29298 <at> debbugs.gnu.org; Tue, 14 Nov 2017 12:08:51 -0500
Received: by mail-oi0-f42.google.com with SMTP id n16so5078772oig.3
for <29298 <at> debbugs.gnu.org>; Tue, 14 Nov 2017 09:08:50 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
h=mime-version:reply-to:in-reply-to:references:from:date:message-id
:subject:to; bh=MXFM6WgIw1YhnPFRp9TmCzgSUeYuPki9ueBKuiir7cg=;
b=h5BFkpadYBP6tfq2Ty0Qp8Gi7xoqQzzMaHyqafEloRBBBbQD2xkLkUSbeS4ZOf2Hqg
o2x3UdWlpSELmo2RW1xXPUsrPgt3MO1Vu7wUy1llXa/GzzHNAnQUM/Hb/fQq9n0+2HT8
2NeOWiWD4/nzjei+99Jsv59otVvYkRCNgLIoe32Ae1333K82TZkHoge4e2zbENAiCftA
XX3jvt3SSlRR3cgF3EAii3pwVXpN4CMQBi583AjCuWCM/kMeoKVdIwIlwfiWaR9lHMzD
JR/IXVWgqMLCP95us9AEjf+bub2qbYycL4f9WwqgX1Y6PQMPFqRsbdGFM5/dn6A1H8kp
UJCw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20161025;
h=x-gm-message-state:mime-version:reply-to:in-reply-to:references
:from:date:message-id:subject:to;
bh=MXFM6WgIw1YhnPFRp9TmCzgSUeYuPki9ueBKuiir7cg=;
b=WnfwYfMqVhNbnfyXo+WvELcfZrRi/9AzOuDl4DBof9wzGDcWsx4DGk4nAdxTyd11N6
hz9D+luFoeLbSYqrvewjcnYrdJIiWlFmGu1HZm2boRH5sHsmZ8OpOHxVl/xn/WmLd7hN
JREkBzvVw+h4rgx0SzWdqNAan+azG8j5N9QGYzKt6o8maMR1u6fPQWlQYa0xyHzMbNud
3CTgVCnffivT4VVqtHCIzuOtvgDiFZwa84mRsG5vMOYFTahNg9+RfZlYBDegbe0H1Wwl
rVdhROmQKWm9IB1T313l8QOL/mDt+0LMe8LxeJBuhfUypEgtSxb9bvR5JGDWswemedOg
9uPg==
X-Gm-Message-State: AJaThX6EojC0c7tBsHsge3mJOwbqJ9h82Jk2ozjOU2HvwCuTkgMUJj1K
u7XFVDwWwhcsp8ybOgilbDakYf8l1Pex4kTx2mdo1u9N
X-Google-Smtp-Source: AGs4zMZQtENXOuUhjZerBO/qdpPZlVk5PTlzIdv92fHHAgMph/WfUH0p9gesr+cv3s/DS5y66oYp/2X+Ch6MTFvk2Lo=
X-Received: by 10.202.8.133 with SMTP id 127mr7517825oii.264.1510679324631;
Tue, 14 Nov 2017 09:08:44 -0800 (PST)
MIME-Version: 1.0
Received: by 10.74.19.71 with HTTP; Tue, 14 Nov 2017 09:08:44 -0800 (PST)
In-Reply-To: <CAH8yC8mUrmng5HC5YHRwYyPL5gQCRxw6myU=gyAgSdU-fruMRA@HIDDEN>
References: <CAH8yC8mUrmng5HC5YHRwYyPL5gQCRxw6myU=gyAgSdU-fruMRA@HIDDEN>
From: Jeffrey Walton <noloader@HIDDEN>
Date: Tue, 14 Nov 2017 12:08:44 -0500
Message-ID: <CAH8yC8nru68V6k18aWbYZkSjF2D_-Bh1UBiiTCr+=5Hx1Tqc0Q@HIDDEN>
Content-Type: text/plain; charset="UTF-8"
X-Spam-Score: -0.0 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.0 (/)
On Tue, Nov 14, 2017 at 11:57 AM, Jeffrey Walton <noloader@HIDDEN> wrote:
> Hi Everyone,
>
> We are testing an Autotools front-end on MSYS2. The download is
> available from https://mingw-w64.org/.
>
> ...
> /bin/sh ./libtool --tag=CXX --mode=link g++ -pthread
> -fdata-sections -ffunction-sections -pipe
> -DCRYPTOPP_DATA_DIR='"@pkgdatadir@/cryptopp/"' -g -O2 -pthread
> -Wl,--gc-sections -o cryptest.exe cryptest-test.o cryptest-bench1.o
> cryptest-bench2.o cryptest-validat0.o cryptest-validat1.o
> cryptest-validat2.o cryptest-validat3.o cryptest-datatest.o
> cryptest-regtest1.o cryptest-regtest2.o cryptest-regtest3.o
> cryptest-dlltest.o cryptest-fipsalgt.o cryptest-adhoc.o libcryptopp.la
> /bin/sh ./libtool --tag=CXX --mode=link g++ -pthread
> -fdata-sections -ffunction-sections -pipe -g -O2 -pthread
> -Wl,--gc-sections -o cryptestcwd.exe cryptestcwd-test.o
> cryptestcwd-bench1.o cryptestcwd-bench2.o cryptestcwd-validat0.o
> cryptestcwd-validat1.o cryptestcwd-validat2.o cryptestcwd-validat3.o
> cryptestcwd-datatest.o cryptestcwd-regtest1.o cryptestcwd-regtest2.o
> cryptestcwd-regtest3.o cryptestcwd-dlltest.o cryptestcwd-fipsalgt.o
> cryptestcwd-adhoc.o libcryptopp.la
> libtool: link: g++ -pthread -fdata-sections -ffunction-sections -pipe
> -g -O2 -pthread -Wl,--gc-sections -o .libs/cryptestcwd.exe
> cryptestcwd-test.o cryptestcwd-bench1.o cryptestcwd-bench2.o
> cryptestcwd-validat0.o cryptestcwd-validat1.o cryptestcwd-validat2.o
> cryptestcwd-validat3.o cryptestcwd-datatest.o cryptestcwd-regtest1.o
> cryptestcwd-regtest2.o cryptestcwd-regtest3.o cryptestcwd-dlltest.o
> cryptestcwd-fipsalgt.o cryptestcwd-adhoc.o ./.libs/libcryptopp.a
> -pthread
> libtool: link: g++ -pthread -fdata-sections -ffunction-sections -pipe
> -DCRYPTOPP_DATA_DIR=\"@pkgdatadir@/cryptopp/\" -g -O2 -pthread
> -Wl,--gc-sections -o .libs/cryptest.exe cryptest-test.o
> cryptest-bench1.o cryptest-bench2.o cryptest-validat0.o
> cryptest-validat1.o cryptest-validat2.o cryptest-validat3.o
> cryptest-datatest.o cryptest-regtest1.o cryptest-regtest2.o
> cryptest-regtest3.o cryptest-dlltest.o cryptest-fipsalgt.o
> cryptest-adhoc.o ./.libs/libcryptopp.a -pthread
> ./.libs/lt-cryptestcwd.c: In function 'main':
> ./.libs/lt-cryptest.c: In function 'main':
> ./.libs/lt-cryptestcwd.c:319:16: warning: implicit declaration of
> function '_spawnv' [-Wimplicit-function-declaration]
> rval = (int) _spawnv (_P_WAIT, lt_argv_zero, (const char * const *) newargz);
> ^~~~~~~
> ./.libs/lt-cryptest.c:319:16: warning: implicit declaration of
> function '_spawn ' [-Wimplicit-function-declaration]
> rval = (int) _spawnv (_P_WAIT, lt_argv_zero, (const char * const *) newargz);
> ^~~~~~~
> /tmp/ccFfsaBb.o: In function `main':
> /home/cryptopp/./.libs/lt-cryptest.c:319: undefined reference to `_spawnv'
> /home/cryptopp/./.libs/lt-cryptest.c:319:(.text.startup+0x4b4):
> relocation truncated to fit: R_X86_64_PC32 against undefined symbol
> `_spawnv'
> collect2: error: ld returned 1 exit status
> /tmp/ccfJfnlw.o: In function `main':
> /home/cryptopp/./.libs/lt-cryptestcwd.c:319: undefined reference to `_spawnv'
> /home/cryptopp/./.libs/lt-cryptestcwd.c:319:(.text.startup+0x4b4):
> relocation truncated to fit: R_X86_64_PC32 against undefined symbol
> `_spawnv'
> strip: './cryptest.exe': No such file
> collect2: error: ld returned 1 exit status
> strip: './cryptestcwd.exe': No such file
> ./libtool: line 11083: ./cryptest.exe: No such file or directory
> ./libtool: line 11083: ./cryptestcwd.exe: No such file or directory
> make[1]: Leaving directory '/home/cryptopp'
Looking at the flags selected by libtool, I think there's another bug
present (correct me if I am wrong)...
When C and C++ are mixed/matched like above, the C source files also
need to be compiled with (1) -frtti to ensure type information is
available; and (2) -fexceptions to ensure exceptions pass correctly
through functions in C object files.
It may be better for libtools to provide both lt-cryptest.cpp and
lt-cryptestcwd.cpp in C++ projects so the mixing and matching does not
occur. That is, the libtool provided files will get the correct
CXXFLAGS by default.
It may be worth mentioning: we don't use/set CFLAGS; libtool needs to
get the project flags through CXXFLAGS in this case.
Jeff
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997 nCipher Corporation Ltd,
1994-97 Ian Jackson.