Uploaded image for project: 'CouchDB'
  1. CouchDB
  2. COUCHDB-2225

configure should fail if system cannot generate shared libraries (in LT_INIT)

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.7.0
    • Component/s: Build System
    • Labels:
      None

      Description

      The LT_INIT autoconf macro checks if the system can build shared libraries, which couch needs:

      configure.ac
      ...
      AC_ENABLE_SHARED                                                           
      AC_DISABLE_STATIC     
      
      AC_PROG_CC
      LT_INIT([win32-dll])     
      LT_INIT             
      AC_PROG_LN_S   
      ...
      

      The AC_DISABLE/ENABLE_* requests that the system builds shared libraries and not static libraries, but does not enforce it. It should.

      An example of a failure mode is the observed configure output on a Synology (linux-based) system:

      ...
      checking whether the gcc linker (/usr/local/x86_64-linux-gnu/x86_64-linux-gnu/x86_64-linux-gnu/bin/ld -m elf_x86_64) supports shared libraries... no
      checking dynamic linker characteristics... GNU/Linux ld.so
      checking how to hardcode library paths into programs... unsupported
      checking whether stripping libraries is possible... no
      checking if libtool supports shared libraries... no
      checking whether to build shared libraries... no
      checking whether to build static libraries... yes
      ...
      

      In this case, gcc returns a broken path to ld, but configure succeeds even though no shared libraries will/can be built. 'make' does fail later, but not in a way that makes the source of the failure obvious:

      cp .libs/ejson.so priv/ejson.so
      cp: can't stat '.libs/ejson.so': No such file or directory
      

      which arises because the so files are not built. In this case, configuration and make succeed when the correct path to ld is given (e.g. ./configure LD=/path/to/ld). However, generally, configure should die with an appropriate error if the system can not build shared libraries.

      Solution:

      Change of the above lines in configure.ac:

      configure.ac
      ...
      LT_INIT
      AS_IF([test x"${enable_shared}" = "xno"], [
        AC_MSG_ERROR([System as configured cannot build shared libraries.])
      ])
      ...
      

      And regeneration of configure. I'm happy to produce a pull request for this.

        Activity

        Hide
        githubbot ASF GitHub Bot added a comment -

        GitHub user mgmarino opened a pull request:

        https://github.com/apache/couchdb/pull/209

        COUCHDB-2225 Enforce that shared libraries can be built by the system.

        configure stage should ensure that shared libraries can be built.

        You can merge this pull request into a Git repository by running:

        $ git pull https://github.com/mgmarino/couchdb 2225-configure-enforce-shared-libraries

        Alternatively you can review and apply these changes as the patch at:

        https://github.com/apache/couchdb/pull/209.patch

        To close this pull request, make a commit to your master/trunk branch
        with (at least) the following in the commit message:

        This closes #209


        commit 0c319d98bd49485f67988cedecd385acbfb83603
        Author: Michael Marino <mmarino@gmail.com>
        Date: 2014-04-15T12:09:12Z

        COUCHDB-2225 Enforce that shared libraries can be built by the system.


        Show
        githubbot ASF GitHub Bot added a comment - GitHub user mgmarino opened a pull request: https://github.com/apache/couchdb/pull/209 COUCHDB-2225 Enforce that shared libraries can be built by the system. configure stage should ensure that shared libraries can be built. You can merge this pull request into a Git repository by running: $ git pull https://github.com/mgmarino/couchdb 2225-configure-enforce-shared-libraries Alternatively you can review and apply these changes as the patch at: https://github.com/apache/couchdb/pull/209.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #209 commit 0c319d98bd49485f67988cedecd385acbfb83603 Author: Michael Marino <mmarino@gmail.com> Date: 2014-04-15T12:09:12Z COUCHDB-2225 Enforce that shared libraries can be built by the system.
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit 02b02d622a6cf108e019e2b31a3534436f1b754d in couchdb's branch refs/heads/1.x.x from Michael Marino
        [ https://git-wip-us.apache.org/repos/asf?p=couchdb.git;h=02b02d6 ]

        COUCHDB-2225 Enforce that shared libraries can be built by the system

        This closes #209

        Signed-off-by: Alexander Shorin <kxepal@apache.org>

        Show
        jira-bot ASF subversion and git services added a comment - Commit 02b02d622a6cf108e019e2b31a3534436f1b754d in couchdb's branch refs/heads/1.x.x from Michael Marino [ https://git-wip-us.apache.org/repos/asf?p=couchdb.git;h=02b02d6 ] COUCHDB-2225 Enforce that shared libraries can be built by the system This closes #209 Signed-off-by: Alexander Shorin <kxepal@apache.org>
        Hide
        githubbot ASF GitHub Bot added a comment -

        Github user kxepal commented on the pull request:

        https://github.com/apache/couchdb/pull/209#issuecomment-62030111

        Merged in [02b02d6](https://git-wip-us.apache.org/repos/asf?p=couchdb.git;h=02b02d6) for 1.7.0, thanks! On master there is 2.0 version which uses different build system. You may close this PR.

        Show
        githubbot ASF GitHub Bot added a comment - Github user kxepal commented on the pull request: https://github.com/apache/couchdb/pull/209#issuecomment-62030111 Merged in [02b02d6] ( https://git-wip-us.apache.org/repos/asf?p=couchdb.git;h=02b02d6 ) for 1.7.0, thanks! On master there is 2.0 version which uses different build system. You may close this PR.
        Hide
        githubbot ASF GitHub Bot added a comment -

        Github user mgmarino commented on the pull request:

        https://github.com/apache/couchdb/pull/209#issuecomment-62111729

        Great, thanks!

        Show
        githubbot ASF GitHub Bot added a comment - Github user mgmarino commented on the pull request: https://github.com/apache/couchdb/pull/209#issuecomment-62111729 Great, thanks!
        Hide
        githubbot ASF GitHub Bot added a comment -

        Github user mgmarino closed the pull request at:

        https://github.com/apache/couchdb/pull/209

        Show
        githubbot ASF GitHub Bot added a comment - Github user mgmarino closed the pull request at: https://github.com/apache/couchdb/pull/209

          People

          • Assignee:
            Unassigned
            Reporter:
            mmarino Michael Marino
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development