cmpname: don't randomize init function names for libraries
authorDaniel Kochmański <daniel@turtleware.eu>
Thu, 1 Oct 2015 11:25:02 +0000 (13:25 +0200)
committerDaniel Kochmański <daniel@turtleware.eu>
Thu, 1 Oct 2015 11:29:53 +0000 (13:29 +0200)
Both shared and static libraries might be linked from C code and names
of the initialization functions has to be known without parsing the
file. Related to #177 and #74. FWIW it doesn't introduce regression on
ADSF bundles (#74) and solves initialization problem (#177).

Signed-off-by: Daniel Kochmański <daniel@turtleware.eu>
CHANGELOG
src/cmp/cmpname.lsp

index 82270ad..e15c661 100644 (file)
--- a/CHANGELOG
+++ b/CHANGELOG
 
    - Building with object files not created by ECL works (CFFI wrappers)
 
+   - Regression regarding initialization of build by ECL libraries from
+     external code fixed. Static and shared libraries initialization
+     funcitons has predetermined name while object files has randomized
+     names.
+
 * 16.0.0 changes since 15.3.7
 ** API changes
 
index d97c4b4..0f0ca87 100644 (file)
@@ -116,6 +116,9 @@ the function name it precedes."
       name))
 
 (defun compute-init-name (pathname &key (kind (guess-kind pathname)) (prefix nil))
+  "Computes initialization function name. Libraries, FASLS and
+programs init function names can't be randomized to allow
+initialization from the C code which wants to use it."
   (let ((filename (pathname-name (translate-logical-pathname pathname)))
         (unique-name (unique-init-name pathname)))
     (case kind
@@ -124,19 +127,11 @@ the function name it precedes."
       ((:fasl :fas)
        (init-function-name "CODE" :kind :fas :prefix prefix))
       ((:static-library :lib)
-       (init-function-name (if (string-equal "LSP"
-                                             (remove-prefix
-                                              +static-library-prefix+ filename))
-                               (remove-prefix +static-library-prefix+ filename)
-                               unique-name)
+       (init-function-name (remove-prefix +static-library-prefix+ filename)
                            :kind :lib
                            :prefix prefix))
       ((:shared-library :dll)
-       (init-function-name (if (string-equal "LSP"
-                                             (remove-prefix
-                                              +shared-library-prefix+ filename))
-                               (remove-prefix +shared-library-prefix+ filename)
-                               unique-name)
+       (init-function-name (remove-prefix +shared-library-prefix+ filename)
                            :kind :dll
                            :prefix prefix))
       ((:program)