Skip to content

Conversation

MartinNowak
Copy link
Member

  • create a libcurl_stub.so for linking
  • set it's soname to libcurl.so so that phobos
    gets a DT_NEEDED libcurl.so entry
  • the runtime linker will load libcurl.so and resolve
    all undefined references
  • disable pragma(lib, "curl") because it doesn't work
    for archives anyways and additionally links against
    the real libcurl

Issue 10710

@jordisayol
Copy link

With dmd v2.064 beta3:

$ objdump -x linux/lib64/libphobos2.so | grep " curl" | awk '{print $NF}'
curl_easy_setopt@@CURL_GNUTLS_3
curl_slist_append@@CURL_GNUTLS_3
curl_slist_free_all@@CURL_GNUTLS_3
curl_global_cleanup@@CURL_GNUTLS_3
curl_easy_strerror@@CURL_GNUTLS_3
curl_easy_init@@CURL_GNUTLS_3
curl_easy_cleanup@@CURL_GNUTLS_3
curl_easy_duphandle@@CURL_GNUTLS_3
curl_easy_perform@@CURL_GNUTLS_3
curl_easy_pause@@CURL_GNUTLS_3
curl_global_init@@CURL_GNUTLS_3

Whit this pull request:

$ objdump -x libphobos2.so.0.64.0 | grep " curl" | awk '{print $NF}'
curl_easy_setopt
curl_global_cleanup
curl_easy_init
curl_slist_append
curl_easy_pause
curl_slist_free_all
curl_easy_duphandle
curl_easy_perform
curl_easy_cleanup
curl_global_init
curl_easy_strerror

This pull request removes curl "versioned symbols" fixing the problem!

The SONAME "libcurl.so" forces to install curl development packages to run programs compiled with dmd/phobos. It should be "libcurl.so.4".

@MartinNowak
Copy link
Member Author

Thx and done.
This should also go into 2.064 @WalterBright.

@jordisayol
Copy link

Autotest fails on OSX.
"libcurl_stub.so" should be generated on Linux building process only.

- create a libcurl_stub.so for linking

- set it's soname to libcurl.so.4 so that phobos
  gets a DT_NEEDED libcurl.so.4 entry

- the runtime linker will load libcurl.so and resolve
  all undefined references

- disable pragma(lib, "curl") because it doesn't work
  for archives anyways and additionally links against
  the real libcurl
@MartinNowak
Copy link
Member Author

OK, did this on linux only.

@jordisayol
Copy link

I'm agree that this should be merged before 2.064 release. @WalterBright @andralex ...

@braddr
Copy link
Member

braddr commented Oct 25, 2013

Why? The current state is not a regression over any previous release, much less the most recent release. It's an improvement, no doubt, but we're in regression fixing mode, not general improvement mode.

@braddr
Copy link
Member

braddr commented Oct 25, 2013

To forestall an obvious objection, any release since curl was added as a dependency. If you go back to pre-curl, then ok, but that's a good ways back at this point.

@jordisayol
Copy link

It's no a regression because Linux shared libraries are present from dmd v2.063.2, so it cannot be a regression, but if this is not merged, phobos shared libraries will be not usable on Linux systems that are not based on Debian, like Fedora, Centos, Redhat, OpenSUSE, LinuxArch, etc.

@MartinNowak
Copy link
Member Author

Why? The current state is not a regression over any previous release, much less the most recent release. It's an improvement, no doubt, but we're in regression fixing mode, not general improvement mode.

Well the shared libphobos2.so that we shipped with the last release is broken on many linux distributions.
We support link-time shared libraries since the last release (through -defaultlib=libphobos2.so) and this pull is necessary to fix the feature.

@MartinNowak
Copy link
Member Author

Why? The current state is not a regression over any previous release, much less the most recent release. It's an improvement, no doubt, but we're in regression fixing mode, not general improvement mode.

I'd rather not waste another release cycle without a working libphobos2.so because this blocks important work (e.g. shared library support in dub). Also we're hardly getting any testing/feedback for this still optional feature (-defaultlib=libphobos2.so) if it's not usable.

@MartinNowak
Copy link
Member Author

Why? The current state is not a regression over any previous release, much less the most recent release. It's an improvement, no doubt, but we're in regression fixing mode, not general improvement mode.

For this release I could build the Fedora and openSUSE package so that we don't ship another broken libphobos2.so.

@jordisayol
Copy link

Good! But please use the last commit on https://github.com/D-Programming-Language/installer/blob/master/linux/dmd_rpm.sh instead of any previous release.

@MartinNowak
Copy link
Member Author

Good! But please use the last commit on https://github.com/D-Programming-Language/installer/blob/master/linux/dmd_rpm.sh instead of any previous release.

Can you please open a pull request which cherry-picks the 2.064 relevant installer changes.

@jordisayol
Copy link

All the changes are already committed. You only have to use it with a modified (libphobos) release zip file, and don't forget to put https://github.com/D-Programming-Language/installer/blob/master/linux/dmd-completion together with the zip file. If not, the resulting packages will not have command line auto completion.

@MartinNowak
Copy link
Member Author

All the changes are already committed.

Yes, but they're on master. We should build the 2.064 release with the 2.064 tag of the installer repo.

@jordisayol
Copy link

Ah, ok, but I have no idea how to do it.

@jordisayol
Copy link

Anyway, you will create the rpm packages from a non 2.064 tag, isn't it?

@MartinNowak
Copy link
Member Author

Anyway, you will create the rpm packages from a non 2.064 tag, isn't it?

No can do, it's not reproducible.
Can you please list which of those commits are strictly required?
dlang/installer@v2.064...master

@jordisayol
Copy link

@MartinNowak MartinNowak deleted the fix10710 branch November 29, 2013 21:48
@MartinNowak MartinNowak restored the fix10710 branch December 13, 2013 15:11
@MartinNowak
Copy link
Member Author

Let's resurrect this, it fixes 2 issues until we have per distribution build scripts. #1772.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants