diff mbox series

libsanitizer: workaround libtool error when building in Yocto Kirkstone

Message ID 20240206165125.1156463-1-a1ba.omarov@gmail.com
State New
Headers show
Series libsanitizer: workaround libtool error when building in Yocto Kirkstone | expand

Commit Message

Alibek Omarov Feb. 6, 2024, 4:51 p.m. UTC
Some libtool versions require --tag to be set and won't run compiler
without it, throwing an `unable to infer tagged configuration` error.

I'm not sure whether it's a good idea to tag assembly files as a C source,
but it helps to avoid the issue.

Signed-off-by: Alibek Omarov <a1ba.omarov@gmail.com>

---
 libsanitizer/asan/Makefile.in   | 2 +-
 libsanitizer/hwasan/Makefile.in | 2 +-
 libsanitizer/tsan/Makefile.in   | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

Comments

Andrew Pinski Feb. 6, 2024, 4:58 p.m. UTC | #1
On Tue, Feb 6, 2024 at 8:53 AM Alibek Omarov <a1ba.omarov@gmail.com> wrote:
>
> Some libtool versions require --tag to be set and won't run compiler
> without it, throwing an `unable to infer tagged configuration` error.
>
> I'm not sure whether it's a good idea to tag assembly files as a C source,
> but it helps to avoid the issue.

This seems like an OE/Yocto issue as updating libtool inside GCC is
going to be problematic due to some local GCC patches to libtool and
some conflicts between libtool and GCC's understanding of --sysroot.

See https://gcc.gnu.org/legacy-ml/gcc-patches/2013-08/msg01465.html
(yes 10 years ago but as far as I Know this still applies).

Thanks,
Andrew Pinski

>
> Signed-off-by: Alibek Omarov <a1ba.omarov@gmail.com>
>
> ---
>  libsanitizer/asan/Makefile.in   | 2 +-
>  libsanitizer/hwasan/Makefile.in | 2 +-
>  libsanitizer/tsan/Makefile.in   | 2 +-
>  3 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/libsanitizer/asan/Makefile.in b/libsanitizer/asan/Makefile.in
> index 25c7fd7b7..5992bafd3 100644
> --- a/libsanitizer/asan/Makefile.in
> +++ b/libsanitizer/asan/Makefile.in
> @@ -188,7 +188,7 @@ am__depfiles_maybe = depfiles
>  am__mv = mv -f
>  CPPASCOMPILE = $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
>         $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS)
> -LTCPPASCOMPILE = $(LIBTOOL) $(AM_V_lt) $(AM_LIBTOOLFLAGS) \
> +LTCPPASCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
>         $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) \
>         $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
>         $(AM_CCASFLAGS) $(CCASFLAGS)
> diff --git a/libsanitizer/hwasan/Makefile.in b/libsanitizer/hwasan/Makefile.in
> index 542af8f19..a000fe570 100644
> --- a/libsanitizer/hwasan/Makefile.in
> +++ b/libsanitizer/hwasan/Makefile.in
> @@ -180,7 +180,7 @@ am__depfiles_maybe = depfiles
>  am__mv = mv -f
>  CPPASCOMPILE = $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
>         $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS)
> -LTCPPASCOMPILE = $(LIBTOOL) $(AM_V_lt) $(AM_LIBTOOLFLAGS) \
> +LTCPPASCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
>         $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) \
>         $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
>         $(AM_CCASFLAGS) $(CCASFLAGS)
> diff --git a/libsanitizer/tsan/Makefile.in b/libsanitizer/tsan/Makefile.in
> index ce11d2497..40d39e31d 100644
> --- a/libsanitizer/tsan/Makefile.in
> +++ b/libsanitizer/tsan/Makefile.in
> @@ -184,7 +184,7 @@ am__depfiles_maybe = depfiles
>  am__mv = mv -f
>  CPPASCOMPILE = $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
>         $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS)
> -LTCPPASCOMPILE = $(LIBTOOL) $(AM_V_lt) $(AM_LIBTOOLFLAGS) \
> +LTCPPASCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
>         $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) \
>         $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
>         $(AM_CCASFLAGS) $(CCASFLAGS)
> --
> 2.34.1
>
Alibek Omarov Feb. 6, 2024, 5:36 p.m. UTC | #2
Thanks for quick reply!

If it's an inappropriate patch for GCC, should I try to send it to Yocto then?

Alibek.
diff mbox series

Patch

diff --git a/libsanitizer/asan/Makefile.in b/libsanitizer/asan/Makefile.in
index 25c7fd7b7..5992bafd3 100644
--- a/libsanitizer/asan/Makefile.in
+++ b/libsanitizer/asan/Makefile.in
@@ -188,7 +188,7 @@  am__depfiles_maybe = depfiles
 am__mv = mv -f
 CPPASCOMPILE = $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
 	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS)
-LTCPPASCOMPILE = $(LIBTOOL) $(AM_V_lt) $(AM_LIBTOOLFLAGS) \
+LTCPPASCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
 	$(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) \
 	$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
 	$(AM_CCASFLAGS) $(CCASFLAGS)
diff --git a/libsanitizer/hwasan/Makefile.in b/libsanitizer/hwasan/Makefile.in
index 542af8f19..a000fe570 100644
--- a/libsanitizer/hwasan/Makefile.in
+++ b/libsanitizer/hwasan/Makefile.in
@@ -180,7 +180,7 @@  am__depfiles_maybe = depfiles
 am__mv = mv -f
 CPPASCOMPILE = $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
 	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS)
-LTCPPASCOMPILE = $(LIBTOOL) $(AM_V_lt) $(AM_LIBTOOLFLAGS) \
+LTCPPASCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
 	$(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) \
 	$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
 	$(AM_CCASFLAGS) $(CCASFLAGS)
diff --git a/libsanitizer/tsan/Makefile.in b/libsanitizer/tsan/Makefile.in
index ce11d2497..40d39e31d 100644
--- a/libsanitizer/tsan/Makefile.in
+++ b/libsanitizer/tsan/Makefile.in
@@ -184,7 +184,7 @@  am__depfiles_maybe = depfiles
 am__mv = mv -f
 CPPASCOMPILE = $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
 	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS)
-LTCPPASCOMPILE = $(LIBTOOL) $(AM_V_lt) $(AM_LIBTOOLFLAGS) \
+LTCPPASCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
 	$(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) \
 	$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
 	$(AM_CCASFLAGS) $(CCASFLAGS)