* [Buildroot] [PATCH] package/gcc/gcc-final: only install libgcc_s for shared library builds
@ 2023-09-30 15:15 Thomas Petazzoni via buildroot
2023-09-30 15:38 ` Peter Korsgaard
0 siblings, 1 reply; 3+ messages in thread
From: Thomas Petazzoni via buildroot @ 2023-09-30 15:15 UTC (permalink / raw)
To: Buildroot List; +Cc: Giulio Benetti, Romain Naour, Thomas Petazzoni
In commit
55e83008fc82cf621d94d60ab4401a4848880bc2 ("package/gcc/gcc-final:
rework installation of libgcc_s/libatomic"), we reworked the libgcc_s
installation. In the previous code, libgcc_s was installed to
STAGING_DIR/TARGET_DIR unconditionally, but a "-cp" command was used,
which means that any failure was ignored. As we are now more picky, it
has become clear that this in fact wasn't entirely correct: libgcc_s
only exists for shared builds. For static builds, only libgcc.a is
available, but it doesn't need to be installed to STAGING_DIR (for
some reason, and as it was never installed by Buildroot, it has always
worked without libgcc.a in STAGING_DIR).
So long story short: we change the code to only install libgcc_s when
BR2_STATIC_LIBS is disabled. This fixes the following build failure on
BR2_STATIC_LIBS=y builds:
cp -dpf /home/thomas/buildroot/buildroot/output/host/arm-buildroot-linux-uclibcgnueabi/lib*/libgcc_s* /home/thomas/buildroot/buildroot/output/host/arm-buildroot-linux-uclibcgnueabi/sysroot/lib/
cp: cannot stat '/home/thomas/buildroot/buildroot/output/host/arm-buildroot-linux-uclibcgnueabi/lib*/libgcc_s*': No such file or directory
Reported-by: Peter Korsgaard <peter@korsgaard.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
---
package/gcc/gcc-final/gcc-final.mk | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/package/gcc/gcc-final/gcc-final.mk b/package/gcc/gcc-final/gcc-final.mk
index 11104167af..edb9b2f73a 100644
--- a/package/gcc/gcc-final/gcc-final.mk
+++ b/package/gcc/gcc-final/gcc-final.mk
@@ -144,7 +144,11 @@ HOST_GCC_FINAL_POST_INSTALL_HOOKS += TOOLCHAIN_WRAPPER_INSTALL
# -cc symlink to the wrapper is not created.
HOST_GCC_FINAL_POST_INSTALL_HOOKS += HOST_GCC_INSTALL_WRAPPER_AND_SIMPLE_SYMLINKS
-GCC_FINAL_LIBS = libgcc_s libatomic
+GCC_FINAL_LIBS = libatomic
+
+ifeq ($(BR2_STATIC_LIBS),)
+GCC_FINAL_LIBS += libgcc_s
+endif
ifeq ($(BR2_INSTALL_LIBSTDCPP),y)
GCC_FINAL_USR_LIBS += libstdc++
--
2.41.0
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [Buildroot] [PATCH] package/gcc/gcc-final: only install libgcc_s for shared library builds
2023-09-30 15:15 [Buildroot] [PATCH] package/gcc/gcc-final: only install libgcc_s for shared library builds Thomas Petazzoni via buildroot
@ 2023-09-30 15:38 ` Peter Korsgaard
2023-09-30 15:41 ` Peter Korsgaard
0 siblings, 1 reply; 3+ messages in thread
From: Peter Korsgaard @ 2023-09-30 15:38 UTC (permalink / raw)
To: Thomas Petazzoni; +Cc: Romain Naour, Giulio Benetti, Buildroot List
>>>>> "Thomas" == Thomas Petazzoni <thomas.petazzoni@bootlin.com> writes:
> In commit
> 55e83008fc82cf621d94d60ab4401a4848880bc2 ("package/gcc/gcc-final:
> rework installation of libgcc_s/libatomic"), we reworked the libgcc_s
> installation. In the previous code, libgcc_s was installed to
> STAGING_DIR/TARGET_DIR unconditionally, but a "-cp" command was used,
> which means that any failure was ignored. As we are now more picky, it
> has become clear that this in fact wasn't entirely correct: libgcc_s
> only exists for shared builds. For static builds, only libgcc.a is
> available, but it doesn't need to be installed to STAGING_DIR (for
> some reason, and as it was never installed by Buildroot, it has always
> worked without libgcc.a in STAGING_DIR).
> So long story short: we change the code to only install libgcc_s when
> BR2_STATIC_LIBS is disabled. This fixes the following build failure on
> BR2_STATIC_LIBS=y builds:
> cp -dpf
> /home/thomas/buildroot/buildroot/output/host/arm-buildroot-linux-uclibcgnueabi/lib*/libgcc_s*
> /home/thomas/buildroot/buildroot/output/host/arm-buildroot-linux-uclibcgnueabi/sysroot/lib/
> cp: cannot stat
> '/home/thomas/buildroot/buildroot/output/host/arm-buildroot-linux-uclibcgnueabi/lib*/libgcc_s*':
> No such file or directory
> Reported-by: Peter Korsgaard <peter@korsgaard.com>
> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Committed to 2023.08.x, thanks.
--
Bye, Peter Korsgaard
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2023-09-30 15:41 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-09-30 15:15 [Buildroot] [PATCH] package/gcc/gcc-final: only install libgcc_s for shared library builds Thomas Petazzoni via buildroot
2023-09-30 15:38 ` Peter Korsgaard
2023-09-30 15:41 ` Peter Korsgaard
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox