Reini Urban
Sun, 08 Aug 2010 03:45:05 -0700
2010/7/1 Heka Treep <zena.tr...@gmail.com>: > Hi, some problem I have with this: > > (defsystem > ... > (cffi-grovel:wrapper-file "...") > ... > > generates a call: > > gcc -m32 -fPIC -o *.dll *.c -shared > > but cygwin want at least flag `-mno-cygwin'. It would be possible to > define this flag in some variable, but the flag is added to the end of > the list of arguments - and it just not work.
cygwin does not want, neither support -mno-cygwin anymore.
It was used for the old mingw cross-compiler, never for cygwin.
-fPIC is also invalid for mingw/cygwin.
> I try this format:
>
> gcc cpu-flags cc-flags platform-library-flags* -o output-file input-file
>
> by reimplement `cc-compile-and-link' function:
>
> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
> (in-package :cffi-grovel)
>
> (defun cc-compile-and-link (input-file output-file &key library)
> (apply #'invoke (or (getenv "CC") *cc*)
> *cpu-word-size-flags*
> `(,@*cc-flags*
> ,@(when library *platform-library-flags*)
> "-o"
> ,(native-namestring output-file)
> ,(native-namestring input-file))))
>
> (setf *cc* "C:/dev/cygwin/bin/gcc-3.exe") ;; its my
> (setf *cc-flags* '()) ;; remove -fPIC
> (setf *cpu-word-size-flags* "") ;; and this too
> (setf *platform-library-flags* '("-mno-cygwin" "-shared")) ;; added
> -mno-cygwin in begin
Using your native compiler, and not using a cross-compiler will help.
strawberry perl for example includes the gcc mingw compiler and most
dependencies.
http://strawberryperl.com/
--
Reini Urban
http://phpwiki.org/ http://murbreak.at/
_______________________________________________
cffi-devel mailing list
cffi-devel@common-lisp.net
http://common-lisp.net/cgi-bin/mailman/listinfo/cffi-devel