public inbox for libffi-discuss@sourceware.org
 help / color / mirror / Atom feed
From: Mladen Turk <mturk@redhat.com>
To: libffi-discuss@sourceware.org
Subject: Re: [patch] port libffi to x86/msvc
Date: Tue, 23 Feb 2010 17:36:00 -0000	[thread overview]
Message-ID: <4B841205.9020006@redhat.com> (raw)
In-Reply-To: <491309914.120062.1263581177621.JavaMail.root@cm-mail03.mozilla.org>

On 01/15/2010 07:46 PM, Dan Witte wrote:
 >> Thanks Dan -- I've checked this in.  I've also add the cc.sh script
 >
 > The '--enable-shared --enable-static' aren't necessary, I just happened to use them, so you may want to change that.
 >

Just tried the build and the msvcc.sh breaks by the backslash chars,
so additional backslashes are needed since they are unescaped once
during eval and second time durig actual shell exec.
This ends up with cl failing with 'cannot find srcdebug.c'
which is actually src\debug.c unescaped.

diff --git a/msvcc.sh b/msvcc.sh
index 8301839..d841a3e 100755
--- a/msvcc.sh
+++ b/msvcc.sh
@@ -176,6 +176,7 @@ if [ -n "$assembly" ]; then
      #mv *.obj $outdir
  else
      args="$md $args"
+    args="$(echo $args | sed 's%\\%\\\\\\\\%g')"
      echo "$cl $args"
      eval "\"$cl\" $args"
      result=$?


Finally, the produced libffi-5.dll doesn't have any exported
symbols so it's basically unusable.
IMHO the real msvc makefile would be needed and all
externs should be LIBFFI_DECLARE(type)

eg.

#ifdef(WIN32)
#define  LIBFFI_DECLARE(type)      __declspec(dllexport) type __stdcall
#define  LIBFFI_DECLARE_DATA       __declspec(dllexport)
#else
#define  LIBFFI_DECLARE(type)      __attribute__ ((visibility("default")) type
#define  LIBFFI_DECLARE_DATA       extern
#endif

... or something like that

and then

LIBFFI_DECLARE_DATA ffi_type ffi_type_void;
...
LIBFFI_DECLARE(void) ffi_raw_call ...

etc.

Without dllexport there is not much sense creating dll or windows build
using msvc thought.

 > Secondly, I put cc.sh under a Mozilla tri-license, because, well, that's what we use 'round here, and Timothy said any license is fine. But if you'd prefer it under a BSD license for consistency, I don't mind.
 >

Shouldn't that match the LICENSE file?
IMHO mixing licenses in the same package might be confusing.


Regards
-- 
^TM

  reply	other threads:[~2010-02-23 17:36 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1961299951.120059.1263581161934.JavaMail.root@cm-mail03.mozilla.org>
2010-01-15 18:46 ` Dan Witte
2010-02-23 17:36   ` Mladen Turk [this message]
2010-02-23 22:33     ` Dan Witte
2010-02-24 15:53       ` Anthony Green
     [not found] <1233161867.115183.1263521983853.JavaMail.root@cm-mail03.mozilla.org>
2010-01-15  2:20 ` Dan Witte
     [not found] <1180535804.107543.1263423246934.JavaMail.root@cm-mail03.mozilla.org>
2010-01-13 23:41 ` Dan Witte
2010-01-14  2:21   ` Timothy Wall
2010-01-14  4:17     ` Dan Witte
2010-01-14 12:49       ` Timothy Wall
2010-01-14 17:24   ` Anthony Green
2010-01-14 17:27     ` Anthony Green
2010-01-15 16:34   ` Anthony Green

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4B841205.9020006@redhat.com \
    --to=mturk@redhat.com \
    --cc=libffi-discuss@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).