# Git build fails on `make`, undefined references in libcrypto.a.

3 messages from 2013-03-18 to 2013-03-18. Participants: zero modulo, Konstantin Khomoutov.
Thread: https://gitlist.dev/t/33212

## zero modulo, 2013-03-18 04:03

Subject: Git build fails on `make`, undefined references in libcrypto.a.
Message-ID: <CAA8xkY==7021SyDmeiOcHMzXbX9L0GgG9yTTED5u1r+tfAPGqg@mail.gmail.com>
URL: https://gitlist.dev/e/CAA8xkY%3D%3D7021SyDmeiOcHMzXbX9L0GgG9yTTED5u1r%2BtfAPGqg%40mail.gmail.com

```
$ LDFLAGS="-L/sandbox/builds/lib" CPPFLAGS="-I/sandbox/builds/include"
./configure --prefix=$PREFIX

$ make
[…]
/sandbox/builds/lib/libcrypto.a(dso_dlfcn.o): In function `dlfcn_globallookup':
dso_dlfcn.c:(.text+0x1b): undefined reference to `dlopen'
dso_dlfcn.c:(.text+0x31): undefined reference to `dlsym'
dso_dlfcn.c:(.text+0x3b): undefined reference to `dlclose'
/sandbox/builds/lib/libcrypto.a(dso_dlfcn.o): In function `dlfcn_bind_func':
dso_dlfcn.c:(.text+0x3c1): undefined reference to `dlsym'
dso_dlfcn.c:(.text+0x4a0): undefined reference to `dlerror'
/sandbox/builds/lib/libcrypto.a(dso_dlfcn.o): In function `dlfcn_bind_var':
dso_dlfcn.c:(.text+0x521): undefined reference to `dlsym'
dso_dlfcn.c:(.text+0x600): undefined reference to `dlerror'
/sandbox/builds/lib/libcrypto.a(dso_dlfcn.o): In function `dlfcn_load':
dso_dlfcn.c:(.text+0x678): undefined reference to `dlopen'
dso_dlfcn.c:(.text+0x6e8): undefined reference to `dlclose'
dso_dlfcn.c:(.text+0x72d): undefined reference to `dlerror'
/sandbox/builds/lib/libcrypto.a(dso_dlfcn.o): In function `dlfcn_pathbyaddr':
dso_dlfcn.c:(.text+0x7e1): undefined reference to `dladdr'
dso_dlfcn.c:(.text+0x849): undefined reference to `dlerror'
/sandbox/builds/lib/libcrypto.a(dso_dlfcn.o): In function `dlfcn_unload':
dso_dlfcn.c:(.text+0x8aa): undefined reference to `dlclose'
collect2: error: ld returned 1 exit status
make: *** [git-imap-send] Error 1

```

## Konstantin Khomoutov, 2013-03-18 07:29

Subject: Re: Git build fails on `make`, undefined references in libcrypto.a.
Message-ID: <20130318072933.GC5434@localhost.localdomain>
URL: https://gitlist.dev/e/20130318072933.GC5434%40localhost.localdomain
In-Reply-To: <CAA8xkY==7021SyDmeiOcHMzXbX9L0GgG9yTTED5u1r+tfAPGqg@mail.gmail.com>

```
On Sun, Mar 17, 2013 at 10:03:37PM -0600, zero modulo wrote:

> $ LDFLAGS="-L/sandbox/builds/lib" CPPFLAGS="-I/sandbox/builds/include"
> ./configure --prefix=$PREFIX
> 
> $ make
> […]
> /sandbox/builds/lib/libcrypto.a(dso_dlfcn.o): In function `dlfcn_globallookup':
> dso_dlfcn.c:(.text+0x1b): undefined reference to `dlopen'
[...]
> make: *** [git-imap-send] Error 1

FYI, I've already tried to answer this exact question [1] with no
comments from the OP.

1. http://serverfault.com/a/488604/118848

```

## zero modulo, 2013-03-18 16:04

Subject: Re: Git build fails on `make`, undefined references in libcrypto.a.
Message-ID: <CAA8xkYmcEqt3Bmd3gJvFVL+HeiJOVgYX_01YQ0FYmMc8RnDpuQ@mail.gmail.com>
URL: https://gitlist.dev/e/CAA8xkYmcEqt3Bmd3gJvFVL%2BHeiJOVgYX_01YQ0FYmMc8RnDpuQ%40mail.gmail.com
In-Reply-To: <20130318072933.GC5434@localhost.localdomain>

```
On Mon, Mar 18, 2013 at 1:29 AM, Konstantin Khomoutov
<kostix+git@007spb.ru> wrote:
> FYI, I've already tried to answer this exact question [1] with no
> comments from the OP.
>
> 1. http://serverfault.com/a/488604/118848

It is I who posted that question. :P

I haven't made any comments yet because this issue is still a work in
progress. I re-compiled OpenSSL taking into consideration that libdl.a
probably wasn't linked properly to libcrypto.a, and have also tried
re-compiling Git afterward, but with the same errors. I have also
created a .conf file for `ld.so`, and ran `sudo ldconfig` which solved
some other issues I was having. Running `ldd msgfmt` revealed that
run-time libraries were not being found, and after running `sudo
ldconfig`, `ldd msgfmt` then showed the libgettext .so was linked. So,
I solved some of my issues, and if there was an issue with statically
linked libraries not being found, as in this case, then, I believe
re-compiling OpenSSL with the proper LDFLAGS and CPPFLAGS would have
solved the issue, but they have not.

I'm currently attempting to install GCC 4.7.2, which is having some
other issues with texinfo 5.1. I can't find the link, but I someone
said it could be the compiler version... since everything else that
seems like might be the issue isn't fixing it, I'm going to try
re-compiling OpenSSL with GCC 4.7.2 and see how that goes.

```
