Monolithic build of static library

Иван Трусков trus19 at gmail.com
Sun Nov 29 12:17:46 UTC 2020


Hello. I am trying to make a library that makes use of 'STR' package and
link it into my C program.
I presumed that using :monolithic t flag would result in the static library
that contained all systems my library depends on. However it seems that is
not the case.

Here is my .asd file:

(defsystem "embedded-console"
  :description "embedded console - ECL functions for smart snake game"
  :author "Ivan Truskov <trus19 at gmail.com>"
  :components ((:file "embedded-console"))
  :depends-on ("str"))

I am compiling the library with command:

ecl -norc -eval '(require :ecl-quicklisp)'
                    -eval '(push \"/my/src/dir/\" asdf:*central-registry*)'
                    -eval '(asdf:make-build :embedded-console :type
:static-library :move-here \#P\"/my/output/dir}\" :monolithic t )'
                    -eval '(quit)'

However, when i try to link with resulting library, this is what i get:

... undefined reference to `init_lib_CL_PPCRE'
... undefined reference to `init_lib_BASE'
... undefined reference to `init_lib_CL_UNICODE'
... undefined reference to `init_lib_CL_PPCRE_UNICODE'
... undefined reference to `init_lib_CL_CHANGE_CASE'
... undefined reference to `init_lib_STR'
... undefined reference to `init_lib_EMBEDDED_CONSOLE'

And indeed, when i run nm over the built file
embedded-console--all-systems.a, this is output:

eclinitVtJU9J.o:
0000000000000000 b Cblock.10857
                 U cl_boot
                 U cl_symbols
                 U _ecl_frs_push
                 U ecl_init_module
                 U ecl_make_codeblock
                 U ecl_process_env
                 U _GLOBAL_OFFSET_TABLE_
                 U init_lib_BASE
                 U init_lib_CL_CHANGE_CASE
                 U init_lib_CL_PPCRE
                 U init_lib_CL_PPCRE_UNICODE
                 U init_lib_CL_UNICODE
                 U init_lib_EMBEDDED_CONSOLE
0000000000000000 T init_lib_EMBEDDED_CONSOLE__ALL_SYSTEMS
                 U init_lib_STR
0000000000000110 T main_lib_EMBEDDED_CONSOLE__ALL_SYSTEMS
                 U _setjmp
nm: cl-ppcre.a: File format not recognized
nm: base.a: File format not recognized
nm: cl-unicode.a: File format not recognized
nm: cl-ppcre-unicode.a: File format not recognized
nm: cl-change-case.a: File format not recognized
nm: str.a: File format not recognized
nm: embedded-console.a: File format not recognized

What am i doing wrong? What should i change to get static library
containing all systems i am intending to use (and maybe only them, if
possible)?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.common-lisp.net/pipermail/ecl-devel/attachments/20201129/adfef712/attachment.htm>


More information about the ecl-devel mailing list