meson: Use AR via wrapper
PATCH 1/1 meson: Use AR via wrapper
If building with LTO enabled we need to use GCC wrapper for AR otherwise archives get created improperly and we see a lot of unresolved symbols on finla linkage.
In particular this allows to build SystemD with LTO.
--- package/meson/cross-compilation.conf.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
package/meson/cross-compilation.conf.in +1 -1
@@ -6,7 +6,7 @@ [binaries] c = '@TARGET_CROSS at gcc' cpp = '@TARGET_CROSS at g++' -ar = '@TARGET_CROSS at ar' +ar = '@TARGET_CROSS at gcc-ar' strip = '@TARGET_CROSS at strip' pkgconfig = '@HOST_DIR@/usr/bin/pkg-config'
Signature · 1 line
2.16.2
PATCH 1/1 meson: Use AR via wrapper
Alexey, All,
On 2018-10-09 22:24 +0300, Alexey Brodkin spake thusly:
Quoted 5 lines
If building with LTO enabled we need to use GCC wrapper for AR otherwise archives get created improperly and we see a lot of unresolved symbols on finla linkage.
In particular this allows to build SystemD with LTO.
This is just 'systemd', not SystemD, or any other case-mangling on it
https://www.freedesktop.org/wiki/Software/systemd/ ;-)
There, I'm done with the nit-picking. ;-) Now read on, for the real review lies below...
Quoted 15 lines
Signed-off-by Alexey Brodkin <[email protected]>Cc Thomas Petazzoni <[email protected]>Cc Eric Le Bihan <[email protected]>Cc Mark Corbin <[email protected]>Cc Peter Korsgaard <[email protected]>Cc Peter Seiderer <[email protected]>--- package/meson/cross-compilation.conf.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)package/meson/cross-compilation.conf.in +0
-0
package/meson/cross-compilation.conf.in line 9
Quoted 5 lines
package/meson/cross-compilation.conf.in +1
-1@@ -6,7 +6,7 @@ [binaries] c = '@TARGET_CROSS at gcc' cpp = '@TARGET_CROSS at g++' -ar = '@TARGET_CROSS at ar' +ar = '@TARGET_CROSS at gcc-ar'
I was curioous as to see for how long gcc provided that wrapper. It turns out that at least 4.9 did.
Regards,
Yann E. MORIN.
Quoted 10 lines
package/meson/cross-compilation.conf.in +0
-0strip = '@TARGET_CROSS at strip' pkgconfig = '@HOST_DIR@/usr/bin/pkg-config'Signature · 6 lines
2.16.2 _______________________________________________ buildroot mailing list buildroot at busybox.net http://lists.busybox.net/mailman/listinfo/buildroot
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------. | Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: | | +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ | | +33 223 225 172 `------------.-------: X AGAINST | \e/ There is no | | http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. | '------------------------------^-------^------------------^--------------------'
PATCH 1/1 meson: Use AR via wrapper
Hello Alexey,
Quoted 6 lines · Yann E. MORIN
Alexey, All,
On 2018-10-09 22:24 +0300, Alexey Brodkin spake thusly:
Quoted 3 lines
If building with LTO enabled we need to use GCC wrapper for AR otherwise archives get created improperly and we see a lot of unresolved symbols on finla linkage.
From quick review another minor nit: s/finla/final/
Will try to test the patch the next days...
Regards,
Peter
Quoted 49 lines
Quoted 2 lines
In particular this allows to build SystemD with LTO.
This is just 'systemd', not SystemD, or any other case-mangling on it
https://www.freedesktop.org/wiki/Software/systemd/ ;-)There, I'm done with the nit-picking. ;-) Now read on, for the real review lies below...
Quoted 15 lines
Signed-off-by Alexey Brodkin <[email protected]>Cc Thomas Petazzoni <[email protected]>Cc Eric Le Bihan <[email protected]>Cc Mark Corbin <[email protected]>Cc Peter Korsgaard <[email protected]>Cc Peter Seiderer <[email protected]>--- package/meson/cross-compilation.conf.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)package/meson/cross-compilation.conf.in +0
-0package/meson/cross-compilation.conf.in line 9
Quoted 5 lines
package/meson/cross-compilation.conf.in +1
-1@@ -6,7 +6,7 @@ [binaries] c = '@TARGET_CROSS at gcc' cpp = '@TARGET_CROSS at g++' -ar = '@TARGET_CROSS at ar' +ar = '@TARGET_CROSS at gcc-ar'I was curioous as to see for how long gcc provided that wrapper. It turns out that at least 4.9 did.
Reviewed-by "Yann E. MORIN" <[email protected]>Regards,
Yann E. MORIN.Quoted 10 lines
package/meson/cross-compilation.conf.in +0
-0strip = '@TARGET_CROSS at strip' pkgconfig = '@HOST_DIR@/usr/bin/pkg-config'Signature · 6 lines
2.16.2 _______________________________________________ buildroot mailing list buildroot at busybox.net http://lists.busybox.net/mailman/listinfo/buildroot
PATCH 1/1 meson: Use AR via wrapper
In reply to Yann E. MORINHello,
Quoted 5 lines · Yann E. MORIN
package/meson/cross-compilation.conf.in line 9
Quoted 2 lines
package/meson/cross-compilation.conf.in +1
-1-ar = '@TARGET_CROSS at ar' +ar = '@TARGET_CROSS at gcc-ar'I was curioous as to see for how long gcc provided that wrapper. It turns out that at least 4.9 did.
Actually, we support external toolchains older than gcc 4.9. So no, it is not good to use gcc-ar unconditionally.
So, it's like I replied on the LTO-enabling patch for systemd, we need a global Config.in option that tells us if the toolchain supports LTO or not, and another if the user wants to use LTO.
Best regards,
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin Embedded Linux and Kernel engineering https://bootlin.com