All of lore.kernel.org
 help / color / mirror / Atom feed
From: Giulio Benetti <giulio.benetti@benettiengineering.com>
To: Fabrice Fontaine <fontaine.fabrice@gmail.com>, buildroot@buildroot.org
Subject: Re: [Buildroot] [PATCH 1/1] package/harfbuzz: fix build with gcc < 7
Date: Tue, 12 Jul 2022 23:08:12 +0200	[thread overview]
Message-ID: <d0608d3b-51f0-d069-866f-11efcd1240f1@benettiengineering.com> (raw)
In-Reply-To: <20220712162712.1582871-1-fontaine.fabrice@gmail.com>

Hi Fabrice,

On 12/07/22 18:27, Fabrice Fontaine wrote:
> Fix the following build failure with gcc < 7 raised since bump to
> version 4.4.0 in commit e186b4d89dcd3eb9fae557959181d7176e7c873c:
> 
> In file included from ../src/hb.hh:473:0,
>                   from ../src/hb-buffer-verify.cc:27:
> ../src/hb-cplusplus.hh:170:13: error: specialization of 'template<class _Tp> struct std::hash' in different namespace [-fpermissive]
>   struct std::hash<hb::shared_ptr<T>>
>               ^
> 
> Fixes:
>   - http://autobuild.buildroot.org/results/3fe7526b685368007ae0f66e15ef2b27d30d5063
> 
> Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>

thank you for providing such fix.

Reviewed-by: Giulio Benetti <giulio.benetti@benettiengineering.com>

Best regards
-- 
Giulio Benetti
CTO/CEO@Benetti Engineering sas

> ---
>   .../0002-cplusplus-Fix-build-on-GCC-7.patch   | 50 +++++++++++++++++
>   .../0003-GSUB-Fix-build-on-GCC-7.patch        | 56 +++++++++++++++++++
>   2 files changed, 106 insertions(+)
>   create mode 100644 package/harfbuzz/0002-cplusplus-Fix-build-on-GCC-7.patch
>   create mode 100644 package/harfbuzz/0003-GSUB-Fix-build-on-GCC-7.patch
> 
> diff --git a/package/harfbuzz/0002-cplusplus-Fix-build-on-GCC-7.patch b/package/harfbuzz/0002-cplusplus-Fix-build-on-GCC-7.patch
> new file mode 100644
> index 0000000000..de2955d8b5
> --- /dev/null
> +++ b/package/harfbuzz/0002-cplusplus-Fix-build-on-GCC-7.patch
> @@ -0,0 +1,50 @@
> +From 7b51bc95d9cf0d9a2e91a37319fa34e4e5f26927 Mon Sep 17 00:00:00 2001
> +From: Kleis Auke Wolthuizen <github@kleisauke.nl>
> +Date: Wed, 6 Jul 2022 12:58:15 +0200
> +Subject: [PATCH] [cplusplus] Fix build on GCC < 7
> +
> +[Retrieved from:
> +https://github.com/harfbuzz/harfbuzz/commit/7b51bc95d9cf0d9a2e91a37319fa34e4e5f26927]
> +Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
> +---
> + src/hb-cplusplus.hh | 12 ++++++++++--
> + 1 file changed, 10 insertions(+), 2 deletions(-)
> +
> +diff --git a/src/hb-cplusplus.hh b/src/hb-cplusplus.hh
> +index 86d0452080..f06a32d912 100644
> +--- a/src/hb-cplusplus.hh
> ++++ b/src/hb-cplusplus.hh
> +@@ -166,8 +166,14 @@ HB_DEFINE_VTABLE (unicode_funcs);
> +
> + } // namespace hb
> +
> ++/* Workaround for GCC < 7, see:
> ++ * https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56480
> ++ * https://stackoverflow.com/a/25594741 */
> ++namespace std {
> ++
> ++
> + template<typename T>
> +-struct std::hash<hb::shared_ptr<T>>
> ++struct hash<hb::shared_ptr<T>>
> + {
> +     std::size_t operator()(const hb::shared_ptr<T>& v) const noexcept
> +     {
> +@@ -177,7 +183,7 @@ struct std::hash<hb::shared_ptr<T>>
> + };
> +
> + template<typename T>
> +-struct std::hash<hb::unique_ptr<T>>
> ++struct hash<hb::unique_ptr<T>>
> + {
> +     std::size_t operator()(const hb::unique_ptr<T>& v) const noexcept
> +     {
> +@@ -187,6 +193,8 @@ struct std::hash<hb::unique_ptr<T>>
> + };
> +
> +
> ++} // namespace std
> ++
> + #endif /* __cplusplus */
> +
> + #endif /* HB_CPLUSPLUS_HH */
> diff --git a/package/harfbuzz/0003-GSUB-Fix-build-on-GCC-7.patch b/package/harfbuzz/0003-GSUB-Fix-build-on-GCC-7.patch
> new file mode 100644
> index 0000000000..d3355443b7
> --- /dev/null
> +++ b/package/harfbuzz/0003-GSUB-Fix-build-on-GCC-7.patch
> @@ -0,0 +1,56 @@
> +From 79eb0f74860fb6309e3162b4f17f98481c05a318 Mon Sep 17 00:00:00 2001
> +From: Kleis Auke Wolthuizen <github@kleisauke.nl>
> +Date: Wed, 6 Jul 2022 13:29:55 +0200
> +Subject: [PATCH] [GSUB] Fix build on GCC < 7
> +
> +[Retrieved (and backported) from:
> +https://github.com/harfbuzz/harfbuzz/commit/79eb0f74860fb6309e3162b4f17f98481c05a318]
> +Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
> +---
> + src/OT/Layout/GSUB/GSUB.hh     | 5 +++--
> + src/hb-ot-layout-gsub-table.hh | 8 ++++----
> + 2 files changed, 7 insertions(+), 6 deletions(-)
> +
> +diff --git a/src/OT/Layout/GSUB/GSUB.hh b/src/OT/Layout/GSUB/GSUB.hh
> +index 372862e2bb..750dca1da3 100644
> +--- a/src/OT/Layout/GSUB/GSUB.hh
> ++++ b/src/OT/Layout/GSUB/GSUB.hh
> +@@ -5,9 +5,10 @@
> + #include "Common.hh"
> + #include "SubstLookup.hh"
> +
> +-using OT::Layout::GSUB::SubstLookup;
> +-
> + namespace OT {
> ++
> ++using Layout::GSUB::SubstLookup;
> ++
> + namespace Layout {
> +
> + /*
> +diff --git a/src/hb-ot-layout-gsub-table.hh b/src/hb-ot-layout-gsub-table.hh
> +index 1eca613b6a..50301ff1d9 100644
> +--- a/src/hb-ot-layout-gsub-table.hh
> ++++ b/src/hb-ot-layout-gsub-table.hh
> +@@ -32,9 +32,8 @@
> + #include "OT/Layout/GSUB/GSUB.hh"
> +
> + namespace OT {
> +-
> +-using Layout::GSUB::SubstLookup;
> +-using Layout::GSUB::ExtensionSubst;
> ++namespace Layout {
> ++namespace GSUB {
> +
> + // TODO(garretrieger): Move into the new layout directory.
> + /* Out-of-class implementation for methods recursing */
> +@@ -82,7 +81,8 @@ inline bool SubstLookup::dispatch_recurse_func<hb_ot_apply_context_t> (hb_ot_app
> + }
> + #endif
> +
> +-
> ++} /* namespace GSUB */
> ++} /* namespace Layout */
> + } /* namespace OT */
> +
> +

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

  reply	other threads:[~2022-07-12 21:08 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-12 16:27 [Buildroot] [PATCH 1/1] package/harfbuzz: fix build with gcc < 7 Fabrice Fontaine
2022-07-12 21:08 ` Giulio Benetti [this message]
2022-07-20 11:50 ` Thomas Petazzoni via buildroot
     [not found] <20220712162712.1582871-1-fontaine.fabrice__39469.849776809$1657643442$gmane$org@gmail.com>
2022-07-17 11:10 ` Bernd Kuhls
2022-07-20 17:17 Bernd Kuhls
2022-07-20 23:21 ` Giulio Benetti
2022-07-22 17:24 ` Arnout Vandecappelle

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d0608d3b-51f0-d069-866f-11efcd1240f1@benettiengineering.com \
    --to=giulio.benetti@benettiengineering.com \
    --cc=buildroot@buildroot.org \
    --cc=fontaine.fabrice@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.