Hi, iolib developers

I'm not sure why need a (gcc-cpu-flags) function to detect a gcc compile
flag (-m32/-m64) and use this to compile C files.

First, use (cffi:foreign-type-size :int) to guess is wrong at least on
amd64 Linux: (cffi:foreign-type-size :int) return 4 on amd64 Linux, so
you guess wrong to 32-bit.

Second, if you guess wrong, a 64-bit Lisp process will can not load a
32-bit library.

If I disable this (gcc-cpu-flags), gcc with no -m32/-m64 can always do
the right thing on both 32 and 64-bit platform, and the Lisp process can
load this library. (I'm just doing this on Debian GNU/Linux amd64 and
LispWorks 5.0.2 Enterprise Edition for AMD64 Linux.) Am I right?

Thanks.

Chun Tian (binghe)
--- unix-dso.lisp.orig	2007-06-07 03:48:31.476802894 +0800
+++ unix-dso.lisp	2007-06-07 01:08:35.889116144 +0800
@@ -74,7 +74,7 @@
           (space-join (or (getenv "CC") "gcc")
                       "~A -o ~S ~{~S ~}")
           (space-join (unix-dso-link-flags dso)
-                      (gcc-cpu-flags)
+                      ;; (gcc-cpu-flags)
                       (getenv "EXTRA_LDFLAGS")
                       #+sunos "-shared -lresolv -lsocket -lnsl"
                       #+darwin "-bundle"
@@ -112,7 +112,7 @@
         (space-join (or (getenv "CC") "gcc")
                     "~A -o ~S -c ~S")
         (space-join "-O3 -Wall -fPIC"
-                    (gcc-cpu-flags)
+                    ;; (gcc-cpu-flags)
                     (getenv "EXTRA_CFLAGS"))
         (unix-name (car (asdf:output-files op c)))
         (unix-name (asdf:component-pathname c))))
_______________________________________________
iolib-devel mailing list
[email protected]
http://common-lisp.net/cgi-bin/mailman/listinfo/iolib-devel

Reply via email to