0

Problem

I require latest version of git (2.12.0) and latest version of OpenSSL (1.1.0e). They are not available in my apt-get repositories so must be built from source. However, I cannot get them to work together.

Details

Installing git 2.12.0 from source worked fine

git clone was not tested straight away

Installing openssl 1.1.0e from source was tricky but got it to work in the end. The trick, based on this question, was to use:

export LD_LIBRARY_PATH=/usr/local/lib
sudo ldconfig
sudo shutdown -r now

openssl then works reports the correct version number.

Only after doing this did I test git clone. Does not work over https. I get the following error:

fatal: Unable to find remote helper for 'https'

Then, based on this question, I tried:

sudo apt-get install libcurl4-openssl-dev

and then tried re-installing git from source. However, I got this error:

collect2: error: ld returned 1 exit status
Makefile:2058: recipe for target 'git-daemon' failed

I then uninstalled openssl 1.1.0e, thus reverting back to the distro's 1.0.1t and tried installing git from source again but I get a similar error slightly later in the build:

collect2: error: ld returned 1 exit status
Makefile:2061: recipe for target 'git-imap-send' failed

So, I don't really know but I suspect I have broken something by doing that LD_LIBRARY_PATH and ldconfig stuff. Not sure how to fix that so I can build git based on the old version of openssl.

Even then, that is a workaround. What I really need is to have git 2.12.0 and OpenSSL 1.1.0e both installed and fully working.

Any help greatly appreciated, thanks :)

Community
  • 1
  • 1
Biggsy
  • 1,306
  • 1
  • 12
  • 28
  • Its a non-trivial task. Git has four to six dependencies, like Zlib, cURL and OpenSSL. The most frustrating thing is, Git will silently fail during configuration, and then leave you with a non-functioning tool. See, for example, [Git 2.4.8 built from kernel.org sources and missing HTTP/HTTPS helpers](http://stackoverflow.com/q/32192181/608639). It has some recipes for building Git, but you need to watch things like a hawk. You might also try to find a PPA (or equivalent) with Git already built. – jww Mar 17 '17 at 13:33
  • *"... [OpenSSL] trick, based on this question, was to use `export LD_LIBRARY_PATH=/usr/local/lib`"* - When you configure OpenSSL, just add `-Wl,-rpath=/usr/local/lib`. Then you don't need to worry about `LD_LIBRARY_PATH`. Also see [Compilation and Installation](https://wiki.openssl.org/index.php/Compilation_and_Installation) on the OpenSSL wiki. – jww Mar 17 '17 at 13:41
  • Thanks for the tips. The odd thing is, git built OK yesterday, albeit without https support. However, today I can't even build it. The only other thing I have changed is openssl and ldconfig so there must be some strange interaction going on there. – Biggsy Mar 17 '17 at 13:57
  • And thanks for your 2nd comment too. I did try that but it didn't like rpath. Not sure if this is an armv4 issue...? I left out -Wl though. What does that do? Something to do with warnings? – Biggsy Mar 17 '17 at 14:02
  • *" I left out -Wl though. What does that do?"* - `-rpath` is a linker option. `-Wl` passes arguments to the linker through the compiler driver. If you are invoking the linker directly, then you don't need `-Wl`. If you are passing through the compiler driver, then you need `-Wl`. – jww Mar 17 '17 at 14:06

0 Answers0