LLVM 10: devel/glib2, devel/pango

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

LLVM 10: devel/glib2, devel/pango

Christian Weisgerber
devel/pango fails to build with LLVM 10, which takes out a large part
of the ports tree.
http://build-failures.rhaalovely.net/amd64-clang/2020-07-31/devel/pango.log

The fix has two parts, picked from upstream:
(1) In glib2, define G_GNUC_FALLTHROUGH in such a way that is also
    available with LLVM 10.
(2) In pango, make use of G_GNUC_FALLTHROUGH.

This is urgently required to allow us to make progress with LLVM 10
and the ports tree.  OK?


Index: glib2/Makefile
===================================================================
RCS file: /cvs/ports/devel/glib2/Makefile,v
retrieving revision 1.332
diff -u -p -r1.332 Makefile
--- glib2/Makefile 3 Jul 2020 21:12:39 -0000 1.332
+++ glib2/Makefile 1 Aug 2020 15:41:07 -0000
@@ -5,7 +5,7 @@ COMMENT= general-purpose utility librar
 GNOME_PROJECT= glib
 GNOME_VERSION= 2.64.4
 PKGNAME= ${DISTNAME:S/glib/glib2/}
-REVISION= 0
+REVISION= 1
 
 CATEGORIES= devel
 
Index: glib2/patches/patch-glib_gmacros_h
===================================================================
RCS file: glib2/patches/patch-glib_gmacros_h
diff -N glib2/patches/patch-glib_gmacros_h
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ glib2/patches/patch-glib_gmacros_h 1 Aug 2020 15:41:07 -0000
@@ -0,0 +1,26 @@
+$OpenBSD$
+
+Define G_GNUC_FALLTHROUGH for more compilers
+https://gitlab.gnome.org/GNOME/glib/-/commit/5f38ae5f
+
+Index: glib/gmacros.h
+--- glib/gmacros.h.orig
++++ glib/gmacros.h
+@@ -532,7 +532,7 @@
+ /**
+  * G_GNUC_FALLTHROUGH:
+  *
+- * Expands to the GNU C `fallthrough` statement attribute if the compiler is gcc.
++ * Expands to the GNU C `fallthrough` statement attribute if the compiler supports it.
+  * This allows declaring case statement to explicitly fall through in switch
+  * statements. To enable this feature, use `-Wimplicit-fallthrough` during
+  * compilation.
+@@ -558,6 +558,8 @@
+  * Since: 2.60
+  */
+ #if    __GNUC__ > 6
++#define G_GNUC_FALLTHROUGH __attribute__((fallthrough))
++#elif g_macro__has_attribute (fallthrough)
+ #define G_GNUC_FALLTHROUGH __attribute__((fallthrough))
+ #else
+ #define G_GNUC_FALLTHROUGH
Index: pango/patches/patch-examples_cairotwisted_c
===================================================================
RCS file: pango/patches/patch-examples_cairotwisted_c
diff -N pango/patches/patch-examples_cairotwisted_c
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ pango/patches/patch-examples_cairotwisted_c 1 Aug 2020 15:41:07 -0000
@@ -0,0 +1,26 @@
+$OpenBSD$
+
+Replace fallthrough comments with G_GNUC_FALLTHROUGH
+https://gitlab.gnome.org/GNOME/pango/-/commit/5423136a
+
+Index: examples/cairotwisted.c
+--- examples/cairotwisted.c.orig
++++ examples/cairotwisted.c
+@@ -234,7 +234,7 @@ parametrize_path (cairo_path_t *path)
+     case CAIRO_PATH_CLOSE_PATH:
+ /* Make it look like it's a line_to to last_move_to */
+ data = (&last_move_to) - 1;
+- /* fall through */
++        G_GNUC_FALLTHROUGH;
+     case CAIRO_PATH_LINE_TO:
+ parametrization[i] = two_points_distance (&current_point, &data[1]);
+ current_point = data[1];
+@@ -361,7 +361,7 @@ point_on_path (parametrized_path_t *param,
+   case CAIRO_PATH_CLOSE_PATH:
+       /* Make it look like it's a line_to to last_move_to */
+       data = (&last_move_to) - 1;
+-      /* fall through */
++      G_GNUC_FALLTHROUGH;
+   case CAIRO_PATH_LINE_TO:
+       {
+ ratio = the_x / parametrization[i];
Index: pango/patches/patch-pango_break_c
===================================================================
RCS file: pango/patches/patch-pango_break_c
diff -N pango/patches/patch-pango_break_c
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ pango/patches/patch-pango_break_c 1 Aug 2020 15:41:07 -0000
@@ -0,0 +1,35 @@
+$OpenBSD$
+
+Replace fallthrough comments with G_GNUC_FALLTHROUGH
+https://gitlab.gnome.org/GNOME/pango/-/commit/5423136a
+
+Index: pango/break.c
+--- pango/break.c.orig
++++ pango/break.c
+@@ -405,7 +405,7 @@ pango_default_break (const gchar   *text,
+                 GB_type = GB_Prepend;
+                 break;
+               }
+-    /* fall through */
++            G_GNUC_FALLTHROUGH;
+  case G_UNICODE_CONTROL:
+  case G_UNICODE_LINE_SEPARATOR:
+  case G_UNICODE_PARAGRAPH_SEPARATOR:
+@@ -421,7 +421,7 @@ pango_default_break (const gchar   *text,
+ GB_type = GB_ControlCRLF;
+ break;
+      }
+-    /* fall through */
++            G_GNUC_FALLTHROUGH;
+
+  case G_UNICODE_OTHER_LETTER:
+    if (makes_hangul_syllable)
+@@ -594,7 +594,7 @@ pango_default_break (const gchar   *text,
+ case G_UNICODE_CONTROL:
+  if (wc != 0x000D && wc != 0x000A && wc != 0x000B && wc != 0x000C && wc != 0x0085)
+    break;
+-  /* fall through */
++                  G_GNUC_FALLTHROUGH;
+ case G_UNICODE_LINE_SEPARATOR:
+ case G_UNICODE_PARAGRAPH_SEPARATOR:
+  WB_type = WB_NewlineCRLF; /* CR, LF, Newline */
Index: pango/patches/patch-pango_pango-renderer_c
===================================================================
RCS file: pango/patches/patch-pango_pango-renderer_c
diff -N pango/patches/patch-pango_pango-renderer_c
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ pango/patches/patch-pango_pango-renderer_c 1 Aug 2020 15:41:07 -0000
@@ -0,0 +1,17 @@
+$OpenBSD$
+
+Replace fallthrough comments with G_GNUC_FALLTHROUGH
+https://gitlab.gnome.org/GNOME/pango/-/commit/5423136a
+
+Index: pango/pango-renderer.c
+--- pango/pango-renderer.c.orig
++++ pango/pango-renderer.c
+@@ -222,7 +222,7 @@ draw_underline (PangoRenderer *renderer,
+     rect->y + 2 * rect->height,
+     rect->width,
+     rect->height);
+-      /* Fall through */
++      G_GNUC_FALLTHROUGH;
+     case PANGO_UNDERLINE_SINGLE:
+     case PANGO_UNDERLINE_LOW:
+       pango_renderer_draw_rectangle (renderer,
Index: pango/patches/patch-tests_testboundaries_ucd_c
===================================================================
RCS file: pango/patches/patch-tests_testboundaries_ucd_c
diff -N pango/patches/patch-tests_testboundaries_ucd_c
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ pango/patches/patch-tests_testboundaries_ucd_c 1 Aug 2020 15:41:07 -0000
@@ -0,0 +1,17 @@
+$OpenBSD$
+
+Replace fallthrough comments with G_GNUC_FALLTHROUGH
+https://gitlab.gnome.org/GNOME/pango/-/commit/5423136a
+
+Index: tests/testboundaries_ucd.c
+--- tests/testboundaries_ucd.c.orig
++++ tests/testboundaries_ucd.c
+@@ -104,7 +104,7 @@ parse_line (gchar *line,
+         {
+         case 0x00f7: /* DIVISION SIGN: boundary here */
+           temp_attr.bits |= bits.bits;
+-          /* fall through */
++          G_GNUC_FALLTHROUGH;
+
+         case 0x00d7: /* MULTIPLICATION SIGN: no boundary here */
+           break;
--
Christian "naddy" Weisgerber                          [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: LLVM 10: devel/glib2, devel/pango

Antoine Jacoutot-7
Sure ok.
Is there a missing pango bump?


Antoine

> On 1 Aug 2020, at 17:45, Christian Weisgerber <[hidden email]> wrote:
>
> devel/pango fails to build with LLVM 10, which takes out a large part
> of the ports tree.
> http://build-failures.rhaalovely.net/amd64-clang/2020-07-31/devel/pango.log
>
> The fix has two parts, picked from upstream:
> (1) In glib2, define G_GNUC_FALLTHROUGH in such a way that is also
>    available with LLVM 10.
> (2) In pango, make use of G_GNUC_FALLTHROUGH.
>
> This is urgently required to allow us to make progress with LLVM 10
> and the ports tree.  OK?
>
>
> Index: glib2/Makefile
> ===================================================================
> RCS file: /cvs/ports/devel/glib2/Makefile,v
> retrieving revision 1.332
> diff -u -p -r1.332 Makefile
> --- glib2/Makefile    3 Jul 2020 21:12:39 -0000    1.332
> +++ glib2/Makefile    1 Aug 2020 15:41:07 -0000
> @@ -5,7 +5,7 @@ COMMENT=        general-purpose utility librar
> GNOME_PROJECT=        glib
> GNOME_VERSION=        2.64.4
> PKGNAME=        ${DISTNAME:S/glib/glib2/}
> -REVISION=        0
> +REVISION=        1
>
> CATEGORIES=        devel
>
> Index: glib2/patches/patch-glib_gmacros_h
> ===================================================================
> RCS file: glib2/patches/patch-glib_gmacros_h
> diff -N glib2/patches/patch-glib_gmacros_h
> --- /dev/null    1 Jan 1970 00:00:00 -0000
> +++ glib2/patches/patch-glib_gmacros_h    1 Aug 2020 15:41:07 -0000
> @@ -0,0 +1,26 @@
> +$OpenBSD$
> +
> +Define G_GNUC_FALLTHROUGH for more compilers
> +https://gitlab.gnome.org/GNOME/glib/-/commit/5f38ae5f
> +
> +Index: glib/gmacros.h
> +--- glib/gmacros.h.orig
> ++++ glib/gmacros.h
> +@@ -532,7 +532,7 @@
> + /**
> +  * G_GNUC_FALLTHROUGH:
> +  *
> +- * Expands to the GNU C `fallthrough` statement attribute if the compiler is gcc.
> ++ * Expands to the GNU C `fallthrough` statement attribute if the compiler supports it.
> +  * This allows declaring case statement to explicitly fall through in switch
> +  * statements. To enable this feature, use `-Wimplicit-fallthrough` during
> +  * compilation.
> +@@ -558,6 +558,8 @@
> +  * Since: 2.60
> +  */
> + #if    __GNUC__ > 6
> ++#define G_GNUC_FALLTHROUGH __attribute__((fallthrough))
> ++#elif g_macro__has_attribute (fallthrough)
> + #define G_GNUC_FALLTHROUGH __attribute__((fallthrough))
> + #else
> + #define G_GNUC_FALLTHROUGH
> Index: pango/patches/patch-examples_cairotwisted_c
> ===================================================================
> RCS file: pango/patches/patch-examples_cairotwisted_c
> diff -N pango/patches/patch-examples_cairotwisted_c
> --- /dev/null    1 Jan 1970 00:00:00 -0000
> +++ pango/patches/patch-examples_cairotwisted_c    1 Aug 2020 15:41:07 -0000
> @@ -0,0 +1,26 @@
> +$OpenBSD$
> +
> +Replace fallthrough comments with G_GNUC_FALLTHROUGH
> +https://gitlab.gnome.org/GNOME/pango/-/commit/5423136a
> +
> +Index: examples/cairotwisted.c
> +--- examples/cairotwisted.c.orig
> ++++ examples/cairotwisted.c
> +@@ -234,7 +234,7 @@ parametrize_path (cairo_path_t *path)
> +     case CAIRO_PATH_CLOSE_PATH:
> +    /* Make it look like it's a line_to to last_move_to */
> +    data = (&last_move_to) - 1;
> +-    /* fall through */
> ++        G_GNUC_FALLTHROUGH;
> +     case CAIRO_PATH_LINE_TO:
> +    parametrization[i] = two_points_distance (&current_point, &data[1]);
> +    current_point = data[1];
> +@@ -361,7 +361,7 @@ point_on_path (parametrized_path_t *param,
> +   case CAIRO_PATH_CLOSE_PATH:
> +       /* Make it look like it's a line_to to last_move_to */
> +       data = (&last_move_to) - 1;
> +-      /* fall through */
> ++      G_GNUC_FALLTHROUGH;
> +   case CAIRO_PATH_LINE_TO:
> +       {
> +    ratio = the_x / parametrization[i];
> Index: pango/patches/patch-pango_break_c
> ===================================================================
> RCS file: pango/patches/patch-pango_break_c
> diff -N pango/patches/patch-pango_break_c
> --- /dev/null    1 Jan 1970 00:00:00 -0000
> +++ pango/patches/patch-pango_break_c    1 Aug 2020 15:41:07 -0000
> @@ -0,0 +1,35 @@
> +$OpenBSD$
> +
> +Replace fallthrough comments with G_GNUC_FALLTHROUGH
> +https://gitlab.gnome.org/GNOME/pango/-/commit/5423136a
> +
> +Index: pango/break.c
> +--- pango/break.c.orig
> ++++ pango/break.c
> +@@ -405,7 +405,7 @@ pango_default_break (const gchar   *text,
> +                 GB_type = GB_Prepend;
> +                 break;
> +               }
> +-        /* fall through */
> ++            G_GNUC_FALLTHROUGH;
> +      case G_UNICODE_CONTROL:
> +      case G_UNICODE_LINE_SEPARATOR:
> +      case G_UNICODE_PARAGRAPH_SEPARATOR:
> +@@ -421,7 +421,7 @@ pango_default_break (const gchar   *text,
> +        GB_type = GB_ControlCRLF;
> +        break;
> +          }
> +-        /* fall through */
> ++            G_GNUC_FALLTHROUGH;
> +
> +      case G_UNICODE_OTHER_LETTER:
> +        if (makes_hangul_syllable)
> +@@ -594,7 +594,7 @@ pango_default_break (const gchar   *text,
> +        case G_UNICODE_CONTROL:
> +          if (wc != 0x000D && wc != 0x000A && wc != 0x000B && wc != 0x000C && wc != 0x0085)
> +            break;
> +-          /* fall through */
> ++                  G_GNUC_FALLTHROUGH;
> +        case G_UNICODE_LINE_SEPARATOR:
> +        case G_UNICODE_PARAGRAPH_SEPARATOR:
> +          WB_type = WB_NewlineCRLF; /* CR, LF, Newline */
> Index: pango/patches/patch-pango_pango-renderer_c
> ===================================================================
> RCS file: pango/patches/patch-pango_pango-renderer_c
> diff -N pango/patches/patch-pango_pango-renderer_c
> --- /dev/null    1 Jan 1970 00:00:00 -0000
> +++ pango/patches/patch-pango_pango-renderer_c    1 Aug 2020 15:41:07 -0000
> @@ -0,0 +1,17 @@
> +$OpenBSD$
> +
> +Replace fallthrough comments with G_GNUC_FALLTHROUGH
> +https://gitlab.gnome.org/GNOME/pango/-/commit/5423136a
> +
> +Index: pango/pango-renderer.c
> +--- pango/pango-renderer.c.orig
> ++++ pango/pango-renderer.c
> +@@ -222,7 +222,7 @@ draw_underline (PangoRenderer *renderer,
> +                     rect->y + 2 * rect->height,
> +                     rect->width,
> +                     rect->height);
> +-      /* Fall through */
> ++      G_GNUC_FALLTHROUGH;
> +     case PANGO_UNDERLINE_SINGLE:
> +     case PANGO_UNDERLINE_LOW:
> +       pango_renderer_draw_rectangle (renderer,
> Index: pango/patches/patch-tests_testboundaries_ucd_c
> ===================================================================
> RCS file: pango/patches/patch-tests_testboundaries_ucd_c
> diff -N pango/patches/patch-tests_testboundaries_ucd_c
> --- /dev/null    1 Jan 1970 00:00:00 -0000
> +++ pango/patches/patch-tests_testboundaries_ucd_c    1 Aug 2020 15:41:07 -0000
> @@ -0,0 +1,17 @@
> +$OpenBSD$
> +
> +Replace fallthrough comments with G_GNUC_FALLTHROUGH
> +https://gitlab.gnome.org/GNOME/pango/-/commit/5423136a
> +
> +Index: tests/testboundaries_ucd.c
> +--- tests/testboundaries_ucd.c.orig
> ++++ tests/testboundaries_ucd.c
> +@@ -104,7 +104,7 @@ parse_line (gchar *line,
> +         {
> +         case 0x00f7: /* DIVISION SIGN: boundary here */
> +           temp_attr.bits |= bits.bits;
> +-          /* fall through */
> ++          G_GNUC_FALLTHROUGH;
> +
> +         case 0x00d7: /* MULTIPLICATION SIGN: no boundary here */
> +           break;
> --
> Christian "naddy" Weisgerber                          [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: LLVM 10: devel/glib2, devel/pango

Christian Weisgerber
Antoine Jacoutot:

> Sure ok.
> Is there a missing pango bump?

It's only changing the fallthrough annotation so
-Werror=implicit-fallthrough won't abort the build.
There is no code change.

--
Christian "naddy" Weisgerber                          [hidden email]