Patch #1192

Only link with libdl on gnu/linux

Added by Matthieu Volat over 1 year ago. Updated over 1 year ago.

Status:ClosedStart date:13 Jun 2016
Priority:NormalDue date:
Assignee:Robin Mills% Done:


Category:buildEstimated time:3.00 hours
Target version:0.26



At the end of the configure script, the LDFLAGS will be appended with -ldl on the condition "host_os != windows". This should be done only for gnu/linux (*BSD, (Mac)OSX, &co put the dlopen() family in libc, as defined in posix... while android provides a fake libdl).

Here's a patch that naively complete the case block. If one was overly prudent, maybe a libdl presence should be checked...

Thanks for your work,

configure_libdl.diff Magnifier (459 Bytes) Matthieu Volat, 13 Jun 2016 17:24

cmake_libdl.diff Magnifier (911 Bytes) Matthieu Volat, 14 Jun 2016 07:43

Associated revisions

Revision 4325
Added by Robin Mills over 1 year ago

#1192 Thank You, Matthieu for the patch.

Revision 4326
Added by Robin Mills over 1 year ago

#1192. Correction to src/CMakeLists.txt. The CMake Language is a horrible mess. It's not even a language.


#1 Updated by Robin Mills over 1 year ago

  • Status changed from New to Assigned
  • Target version set to 0.26
  • % Done changed from 0 to 50
  • Estimated time set to 2.00


I've submitted your patch: r4325. I've made an equivalent change in src/CMakeLists.txt. The buildserver has built/tested Mac/Linux/MinGW/Cygwin using ./configure Looks good. Thanks. Your patch is accepted for v0.26.

Overnight the buildserver will build/test using CMake. If the CMake build fails, I will revert my changes to src/CMakeLists.txt. I'm working to get finished on v0.26 in June and don't want to be side tracked by this. Linking dl has been in CMakeLists.txt for years without complaint or incident.

I am interested in your comments about Android which is one of the Features to be added for v0.27.

Thanks for saying "Thanks". Encouragement is very much appreciated. Thank You.

#2 Updated by Matthieu Volat over 1 year ago

Ho thanks, I did not even thought of updating the CMake files!!

Great news about 0.26, then I won't try to push 0.25 yet to FreeBSD ports, but maybe I'll try to push an issue for another problem I'd really like to see solved in a stable version soon.

Regarding android, you can see bionic (android libc) source:

If that helps, comments from google engineers were that bionic was now almost vanilla openbsd libc ( ), so for the native code, so I don't think that will be hard.

#3 Updated by Robin Mills over 1 year ago

My fix to CMake isn't correct. However, I think I've remedied it this morning: r4326

Don't hit me with anything heavy for v0.26. I'm very overloaded already with a major home remodelling project which we want to finish by July 10 for a family gathering to celebrate my wife's birthday, my 65th birthday and our retirement.

I downloaded Android Studio a couple of weeks ago and haven't had time to look at it. I believe it supports native C++ apps. So, I expect Exiv2/Android shouldn't be difficult. A couple of contributors sent iOS build code in 2013. Nobody on the team could get their contributions to build, so they were rejected. I don't believe iOS supports shared libraries. I hope it supports static libraries. Anyway, this misery awaits in v0.27.

#4 Updated by Matthieu Volat over 1 year ago

Hum, in fact, I tested the cmake patch this morning, but it still confuse unix and linux, would the attached patch be acceptable? As is, I'm not sure it would set android apart (depending on what the custom toolchain will define), but that's not really a problem since they provide this fake libdl.

#5 Updated by Matthieu Volat over 1 year ago

Oops, sorry, disregard previous comment.

#6 Updated by Robin Mills over 1 year ago

  • Status changed from Assigned to Closed
  • % Done changed from 50 to 100
  • Estimated time changed from 2.00 to 3.00


Thanks for your second patch. I'm not going to spend more time on this. I also considered using STREQUAL as an alternative to the LINUX variable (which in my opinion should be defined by CMake). As you know there's more than one way to do everything. Fix r4326 has been successfully built and passed our test suite on all supported platforms using CMake. If r4326 doesn't work correctly on Android (or any other unsupported platform), it will be dealt with in v0.27.

I've still have 76 hours of work in June for v0.26 in addition to the house project (another 8 hours/day). Retirement? I've never worked harder!

Also available in: Atom PDF

Redmine Appliance - Powered by TurnKey Linux