New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ocamlopt 4.08.1 triggers ld relocation warnings on i386 with binutils 2.35 #9800
Comments
The same warnings are triggered with 4.11.0+beta2. |
It is quite possible that PIE needs to be turned off for i386 and perhaps other 32-bit platforms. We already do it for musl-based systems, see da12974 . This, or the warning needs to be silenced. |
Adding
|
There are also dynlink tests that still fail with
|
If I understand correctly, emitting PIC code would solve this issue. Unfortunately, ocamlopt does not seem to support emitting PIC code on i386. |
The new behavior is triggered by this commit. I didn't find any rationale for this. |
If ocaml doesn't support PIC, please pass "-z notext" to ld in your driver. |
I've applied this patch (disabling the warnings) to the Debian package. |
Note that this change breaks the compiler-libs ABI (the option ends up in a string that is exposed in config.cmx). Hence, it needs recompilation of all reverse-dependencies :-( |
Text relocations are almost always created by accident. This is also what seems to be happening here, so the warning has already served its purpose. |
The patch is the best solution to the issue, I believe. Just to document what's going on:
|
Bug: ocaml/ocaml#9800 Gbp-Pq: Name 0008-Disable-DT_TEXTREL-warnings-on-Linux-i386.patch
Bug: ocaml/ocaml#9800 Gbp-Pq: Name 0006-Disable-DT_TEXTREL-warnings-on-Linux-i386.patch
Bug: ocaml/ocaml#9800 Gbp-Pq: Name 0006-Disable-DT_TEXTREL-warnings-on-Linux-i386.patch
Bug: ocaml/ocaml#9800 Gbp-Pq: Name 0006-Disable-DT_TEXTREL-warnings-on-Linux-i386.patch
Ah, I've figured out what's going on. The patch is inadequate because it updates |
There is a warning due to ocaml/ocaml#9800
There is a warning due to ocaml/ocaml#9800
There is a warning due to ocaml/ocaml#9800
There is a warning due to ocaml/ocaml#9800
Hi, on riscv64 and ocaml 4.12.1, I also got this warning in some tests, causing a few tests failure (expect empty output). Does ocamlopt currently support generating PIC for riscv64? for example:
|
It should. The testsuite passes on our test server, but it uses gcc 9.2.1 which is older than the one you are using 11.2.0... perhaps that has something to do with it. |
Maybe it is gcc version. I noticed in your test server, flambda is set false for riscv. so I disabled it, but the warnings are still there plus 3 unexpected errors. Should I open an issue for this? |
OK, but as we don't currently have an easy way to reproduce the issue, it may not get looked at immediately. We should look into maybe upgrading the VM we use for testing. Which distribution are you using by the way? |
I use Gentoo and tested on it.
Not a problem for me. Thanks for the comments. I am just testing packages for Gentoo. not pushing for anything. |
Disable cram tests on i386 due to relocation warnings. ocaml/ocaml#9800
We seem to have hit this issue on x86 in the opam-repository CI on ocaml/opam-repository#19949 and ocaml/opam-repository#19943 |
Bug: ocaml/ocaml#9800 Gbp-Pq: Name 0006-Disable-DT_TEXTREL-warnings-on-Linux-i386.patch
Bug: ocaml/ocaml#9800 Gbp-Pq: Name 0004-Disable-DT_TEXTREL-warnings-on-Linux-i386.patch
This avoids relocations issues, as explained by @xavierleroy #9800 (comment) Patch is adapted from @glondu https://salsa.debian.org/ocaml-team/ocaml/-/blob/2f4a827125dcf79e2b6a193de69b018379bae836/debian/patches/0006-Disable-DT_TEXTREL-warnings-on-Linux-i386.patch Co-Authored-By: Stephane Glondu <steph@glondu.net>
Just for information for distribution maintainers out-there: the patch for this has been upstreamed in #10835 It would probably be good to use this one instead to detect outdated patches in future releases. |
Bug: ocaml/ocaml#9800 Gbp-Pq: Name 0004-Disable-DT_TEXTREL-warnings-on-Linux-i386.patch
Disable cram tests on i386 due to relocation warnings. ocaml/ocaml#9800
Bug: ocaml/ocaml#9800 Gbp-Pq: Name 0004-Disable-DT_TEXTREL-warnings-on-Linux-i386.patch
Bug: ocaml/ocaml#9800 Gbp-Pq: Name 0004-Disable-DT_TEXTREL-warnings-on-Linux-i386.patch
Bug: ocaml/ocaml#9800 Gbp-Pq: Name 0004-Disable-DT_TEXTREL-warnings-on-Linux-i386.patch
Bug: ocaml/ocaml#9800 Gbp-Pq: Name 0004-Disable-DT_TEXTREL-warnings-on-Linux-i386.patch
When compiled in current Debian unstable (2020-07-27), ocamlopt 4.08.1 on an empty file gives on i386:
These warnings seem to be triggered on any file. Because of this, the test suite does not pass and is messy. I suspect this is due to a new version of binutils (2.35).
The text was updated successfully, but these errors were encountered: