Conversation
Makefile.common included first Makeconf, and set AS, CC, LD unconditionally afterwards. This lead to the LD in Makeconf never having any effect. It turns out (I didn't yet dig which commit) that FreeBSD's ld (version 2.17.50) works fine with Solo5 now. I tested this with a) solo5 examples, b) mirage-skeleton examples up to stackv4 and static_website_tls.
|
At first glance this seems OK. I also noticed that at some point the standard FreeBSD Just to confirm, the two |
|
sure. yes, the two readelf are same ocaml source code and binaries, only once using system ld and once the one from ports |
|
As far as I can tell there have been no changes to the FreeBSD system |
|
sure. I was surprised by this as well. FreeBSD has not changed its |
|
I've done some more tests with the Solo5 standalone tests and stackv4. The only material difference in My theory is this is due to the newer (GNU) ld being smarter about removing unneeded output sections. So, this change should not break anything. However: binaries linked with the system ld will be slightly larger on disk and in memory (the difference with stackv4 is about 57kB). @hannesm If you're OK with the above analysis and caveat then I'm happy to merge this. |
|
Also just verified against static_website_tls, identical behaviour, size difference is 128kB. |
|
I'm ok with merging, and thanks for the detailed analysis. I'm willing to accept the extension of 57kB/128kB. |
remove unnecessary depext to binutils on FreeBSD since #123 is merged
Makefile.common included first Makeconf, and set AS, CC, LD unconditionally
afterwards. This lead to the LD in Makeconf never having any effect.
It turns out (I didn't yet dig which commit) that FreeBSD's ld (version 2.17.50)
works fine with Solo5 now. I tested this with a) solo5 examples,
b) mirage-skeleton examples up to stackv4 and static_website_tls.
This commit a) removes the LD detection (executed on FreeBSD only), b) moves the .include in Makefile.common to a later point so that we can actually override these variables in Makeconf. It worked before #106, but not after (before
?=was used, after=).@mato a review would be appreciated. This complements mirage/mirage#692 pretty well.
Here is
readelf -S mir-stackv4.virtiocompiled with ld 2.17.50:And here with 2.27:
I tested this with a FreeBSD-CURRENT (the ld in RELENG_11 is the same, as it is in FreeBSD-11 RELEASE). Would be great if someone else could test this PR and verify that the linker issue is really gone.