From: Daniel Kochmański Date: Thu, 1 Oct 2015 11:25:02 +0000 (+0200) Subject: cmpname: don't randomize init function names for libraries X-Git-Url: http://git.pulsar-zone.net/?a=commitdiff_plain;h=55bbfcfaeb13b154f8b78d8d00a876107b74c17a;p=ecl.git 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 --- diff --git a/CHANGELOG b/CHANGELOG index 82270ad..e15c661 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -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 diff --git a/src/cmp/cmpname.lsp b/src/cmp/cmpname.lsp index d97c4b4..0f0ca87 100644 --- a/src/cmp/cmpname.lsp +++ b/src/cmp/cmpname.lsp @@ -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)