Yann, thanks for testing. I had the build working on MacOS, but gcc on my Ubuntu was not happy. The problem is something that plagued me already in mod_http2: having the same source/objects shared in two link targets.
Previously, I build libmd.la and linked that to mod_md and a2md (the cmd line util). libmd.la's objects were built with -prefer-non-pic by our build system and linking that into mod_md.so was refused by Linux linker. I did not manage to build a libmd.* that then gets statically linked into mod_md and a2md and uses pic. So, I added the objects themselves to the targets of mod_md and a2md. That made it working on Linux (Ubuntu) and MacOS for me. Why linking statically? I did not want to have to install a libmd.so in the system and manage that. I just have some common code between a module and a cmd line tool. I'd really appreciate if someone with a deeper understanding of our ancient build system could come up with a solution to this. > Am 08.09.2017 um 17:43 schrieb William A Rowe Jr <[email protected]>: > > On Fri, Sep 8, 2017 at 10:14 AM, Yann Ylavic <[email protected]> wrote: >> Hi Stefan, >> >> On Fri, Sep 8, 2017 at 5:06 PM, <[email protected]> wrote: >>> Author: icing >>> Date: Fri Sep 8 15:06:44 2017 >>> New Revision: 1807777 >>> >>> URL: http://svn.apache.org/viewvc?rev=1807777&view=rev >>> Log: >>> On the trunk: >>> >>> mod_md: added necessary CPPFLAGS for a2md build. >> >> Thanks, it fixed some APR dependencies for me. >> >> Now I'm here: >> >> || *** Warning: Linking the shared library mod_md.la against the non-libtool >> || *** objects md_acme.o md_acme_acct.o md_acme_authz.o >> md_acme_drive.o md_core.o md_curl.o md_crypt.o md_http.o md_json.o >> md_jws.o md_log.o md_reg.o md_store.o md_store_fs.o md_util.o is not >> portable! >> || /home/yle/bin/ld: error: md_json.o: requires dynamic R_X86_64_PC32 >> reloc against 'md_json_destroy' which may overflow at runtime; >> recompile with -fPIC >> || /home/yle/bin/ld: error: md_reg.o: requires dynamic R_X86_64_PC32 >> reloc against 'md_reg_find_overlap' which may overflow at runtime; >> recompile with -fPIC >> || /home/yle/bin/ld: error: md_util.o: requires dynamic R_X86_64_PC32 >> reloc against 'md_array_str_index' which may overflow at runtime; >> recompile with -fPIC >> || collect2: error: ld returned 1 exit status >> >> Any idea? I assume you had done a make clean? Those objects should have been build using pic now.
