From 970ccb7c362c25f7a968fa9d334286c8d8d94469 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Daniel=20Kochma=C5=84ski?= Date: Wed, 23 Sep 2015 09:03:51 +0200 Subject: [PATCH] compiler: accept foreign object files MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Sometimes we want to build with objects from CFFI (like wrappers). These doesn't have entry point and initialization function. If we'll encounter such an object just attach it without adding it to the initialization queue. Fixes #174. Signed-off-by: Daniel Kochmański --- src/cmp/cmpmain.lsp | 3 ++- src/cmp/cmpname.lsp | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/cmp/cmpmain.lsp b/src/cmp/cmpmain.lsp index 6e8aa53..9f7e742 100755 --- a/src/cmp/cmpmain.lsp +++ b/src/cmp/cmpmain.lsp @@ -471,7 +471,8 @@ output = si_safe_eval(2, ecl_read_from_cstring(lisp_code), ECL_NIL); (flags (guess-ld-flags path))) ;; We should give a warning that we cannot link this module in (when flags (push flags ld-flags)) - (push (list init-fn path) submodules)))) + (when init-fn + (push (list init-fn path) submodules))))) (setf submodules-data (apply #'concatenate '(array base-char (*)) submodules-data)) (setq c-file (open c-name :direction :output :external-format :default)) diff --git a/src/cmp/cmpname.lsp b/src/cmp/cmpname.lsp index 6f611d9..d97c4b4 100644 --- a/src/cmp/cmpname.lsp +++ b/src/cmp/cmpname.lsp @@ -107,7 +107,7 @@ the function name it precedes." ((:object :c :static-library :lib :shared-library :dll) (or (and (probe-file pathname) (find-init-name pathname :tag (kind->tag kind))) - (error "Cannot find out entry point for binary file ~A" pathname))) + (cmpnote "Cannot find out entry point for binary file ~A" pathname))) (otherwise (compute-init-name pathname kind)))) (defun remove-prefix (prefix name) -- 2.9.0