This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: symbol names are not created with stdcall syntax: MINGW, (GCC) 4.3.0 20061021
- From: "François-Xavier Coudert" <fxcoudert at gmail dot com>
- To: "Tobias Burnus" <burnus at net-b dot de>, "GCC Development" <gcc at gcc dot gnu dot org>, dannysmith at users dot sourceforge dot net
- Cc: "Steve Kargl" <sgk at troutmask dot apl dot washington dot edu>, fortran at gcc dot gnu dot org
- Date: Fri, 9 Mar 2007 17:06:49 +0100
- Subject: Re: symbol names are not created with stdcall syntax: MINGW, (GCC) 4.3.0 20061021
- Dkim-signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=MLfHH38xymKC8NsVfcDQKwdVzr7Nbn4IaJKzntklUxbc9lRxrfY5/crC1nWgO21WASBSxsRdxwPTr9CX8N1nTdkkd8mv5XFasFDUvvDt/ZW/x6L1CkFKU8hyBaRAGSFabIdBTJF0xMny6OFwmbJtGGY4Uz1YbZpybUc9kDRuMDg=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=fqnWIH6ymCPZtratx0t81nEcJWwOQiCu7vaao9ryix2EDZpNTs4pMoCWKxGc0+i4vleB4rurOi6a2Wq07ttk+vfXTpTQmyc5tJCYCxmqMhHlkz9PKQwdiS133v66feTN9iy9B+KCeIuqptxqche+ecm/is8wb07zVBdDw+uT2J8=
- References: <20070309133336.275890@gmx.net> <45F16CEF.889E2B59@dessent.net> <45F1796F.1030100@net-b.de> <45F17E43.A48EB89F@dessent.net> <20070309153648.GA70037@troutmask.apl.washington.edu> <45F18446.6080103@net-b.de>
Thus we may consider adding a -fstdcall option to gfortran, which
appends the @n. The -mrtd would be needed additionally and it seems to
work. (That I don't get @n in C for __stdcall might because I tested
under Linux.)
On mingw, I get the following:
$ cat a.c
int foo(int x) { return x+1; }
$ gcc.exe -mrtd a.c -shared -o a.dll
$ nm a.dll | grep foo
100011c0 T _foo
$ cat b.c
int __stdcall foo(int x) { return x+1; }
$ gcc.exe b.c -shared -o b.dll
$ nm b.dll | grep foo
100011c0 T _foo@4
$ gcc.exe b.c -shared -o b.dll -mrtd
$ nm b.dll | grep foo
100011c0 T _foo@4
I think -mrtd doesn't change the name. Maybe GCC needs another option
to add the name decoration automatically? CCing the GCC list and Danny
S. for this question.
FX