cmpname: don't randomize init function names for libraries

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>
This commit is contained in:
Daniel Kochmański 2015-10-01 13:25:02 +02:00
parent 03045d98ae
commit 55bbfcfaeb
2 changed files with 10 additions and 10 deletions

View file

@ -80,6 +80,11 @@
- 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

View 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)