NetBSD Problem Report #43944

From www@NetBSD.org  Tue Oct  5 08:31:55 2010
Return-Path: <www@NetBSD.org>
Received: from mail.netbsd.org (mail.netbsd.org [204.152.190.11])
	by www.NetBSD.org (Postfix) with ESMTP id 0A54B63B8CF
	for <gnats-bugs@gnats.NetBSD.org>; Tue,  5 Oct 2010 08:31:55 +0000 (UTC)
Message-Id: <20101005083154.C9F5C63B8CD@www.NetBSD.org>
Date: Tue,  5 Oct 2010 08:31:54 +0000 (UTC)
From: daniel.vergien@googlemail.com
Reply-To: daniel.vergien@googlemail.com
To: gnats-bugs@NetBSD.org
Subject: graphics/cario fails to compile with sun c compiler
X-Send-Pr-Version: www-1.0

>Number:         43944
>Category:       pkg
>Synopsis:       graphics/cario fails to compile with sun c compiler
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Oct 05 08:35:00 +0000 2010
>Last-Modified:  Tue Oct 05 08:40:01 +0000 2010
>Originator:     Daniel Vergien
>Release:        pkgsrc-current
>Organization:
private
>Environment:
SunOS pkgsrc 5.10 Generic_142910-17 i86pc i386 i86pc
>Description:
cairo-1.10.0 fails to compile with the sun c compiler because of tow issues:

In cairo-xcb-surface.c a void function wants to return a value.
In cairo-gl-private.h there is a anonymous union
>How-To-Repeat:
build graphics/cairo with sun c compiler
>Fix:
Add "-features=extensions" to CFLAGS for the void function

Give the union a name

>Audit-Trail:
From: Daniel Vergien <daniel.vergien@googlemail.com>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: pkg/43944: graphics/cario fails to compile with sun c compiler
Date: Tue, 05 Oct 2010 10:36:51 +0200

 This is a multi-part message in MIME format.
 --------------060504020600020504090303
 Content-Type: text/plain; charset=ISO-8859-1; format=flowed
 Content-Transfer-Encoding: 7bit

 Patches to compile cairo with the sun c compiler. Both issues reported 
 upstream:
 https://bugs.freedesktop.org/show_bug.cgi?id=30610
 https://bugs.freedesktop.org/show_bug.cgi?id=30612

 On 05.10.10 10:35, gnats-admin@netbsd.org wrote:
 > Thank you very much for your problem report.
 > It has the internal identification `pkg/43944'.
 > The individual assigned to look at your
 > report is: pkg-manager.
 >
 >> Category:       pkg
 >> Responsible:    pkg-manager
 >> Synopsis:       graphics/cario fails to compile with sun c compiler
 >> Arrival-Date:   Tue Oct 05 08:35:00 +0000 2010
 >


 --------------060504020600020504090303
 Content-Type: text/x-patch;
  name="Makefile.diff"
 Content-Transfer-Encoding: 7bit
 Content-Disposition: attachment;
  filename="Makefile.diff"

 $NetBSD$

 --- Makefile.orig	2010-10-01 11:32:09.247314394 +0000
 +++ Makefile
 @@ -35,6 +35,9 @@ PLIST.carbon=		yes
  # For snprintf() and ctime_r()
  CPPFLAGS.SunOS+=		-D__EXTENSIONS__ -D_POSIX_PTHREAD_SEMANTICS

 +.if !empty(PKGSRC_COMPILER:Msunpro)
 +CFLAGS+=    -features=extensions
 +.endif
  TEST_TARGET=			check

  .include "../../devel/zlib/buildlink3.mk"

 --------------060504020600020504090303
 Content-Type: text/plain;
  name="patch-ad"
 Content-Transfer-Encoding: 7bit
 Content-Disposition: attachment;
  filename="patch-ad"

 $NetBSD$

 --- src/cairo-gl-composite.c.orig	2010-10-05 08:03:35.934882001 +0000
 +++ src/cairo-gl-composite.c
 @@ -76,7 +76,7 @@ _cairo_gl_pattern_texture_setup (cairo_g
      cairo_matrix_t m;
      cairo_gl_surface_t *surface;
      cairo_surface_attributes_t *attributes;
 -    attributes = &operand->texture.attributes;
 +    attributes = &operand->A.texture.attributes;

      status = _cairo_pattern_acquire_surface (src, &dst->base,
  					     src_x, src_y,
 @@ -102,8 +102,8 @@ _cairo_gl_pattern_texture_setup (cairo_g
      assert (_cairo_gl_surface_is_texture (surface));

      operand->type = CAIRO_GL_OPERAND_TEXTURE;
 -    operand->texture.surface = surface;
 -    operand->texture.tex = surface->tex;
 +    operand->A.texture.surface = surface;
 +    operand->A.texture.tex = surface->tex;
      /* Translate the matrix from
       * (unnormalized src -> unnormalized src) to
       * (unnormalized dst -> unnormalized src)
 @@ -141,10 +141,10 @@ _cairo_gl_solid_operand_init (cairo_gl_o
  	                      const cairo_color_t *color)
  {
      operand->type = CAIRO_GL_OPERAND_CONSTANT;
 -    operand->constant.color[0] = color->red   * color->alpha;
 -    operand->constant.color[1] = color->green * color->alpha;
 -    operand->constant.color[2] = color->blue  * color->alpha;
 -    operand->constant.color[3] = color->alpha;
 +    operand->A.constant.color[0] = color->red   * color->alpha;
 +    operand->A.constant.color[1] = color->green * color->alpha;
 +    operand->A.constant.color[2] = color->blue  * color->alpha;
 +    operand->A.constant.color[3] = color->alpha;
      return CAIRO_STATUS_SUCCESS;
  }

 @@ -170,24 +170,24 @@ _cairo_gl_gradient_operand_init (cairo_g

          status = _cairo_gl_create_gradient_texture (dst,
                                                      gradient,
 -                                                    &operand->linear.gradient);
 +                                                    &operand->A.linear.gradient);
          if (unlikely (status))
              return status;

  	/* Translation matrix from the destination fragment coordinates
  	 * (pixels from lower left = 0,0) to the coordinates in the
  	 */
 -	cairo_matrix_init_translate (&operand->linear.m, -x0, -y0);
 -	cairo_matrix_multiply (&operand->linear.m,
 +	cairo_matrix_init_translate (&operand->A.linear.m, -x0, -y0);
 +	cairo_matrix_multiply (&operand->A.linear.m,
  			       &pattern->matrix,
 -			       &operand->linear.m);
 -	cairo_matrix_translate (&operand->linear.m, 0, dst->height);
 -	cairo_matrix_scale (&operand->linear.m, 1.0, -1.0);
 +			       &operand->A.linear.m);
 +	cairo_matrix_translate (&operand->A.linear.m, 0, dst->height);
 +	cairo_matrix_scale (&operand->A.linear.m, 1.0, -1.0);

 -	operand->linear.segment_x = x1 - x0;
 -	operand->linear.segment_y = y1 - y0;
 +	operand->A.linear.segment_x = x1 - x0;
 +	operand->A.linear.segment_y = y1 - y0;

 -        operand->linear.extend = pattern->extend;
 +        operand->A.linear.extend = pattern->extend;

  	operand->type = CAIRO_GL_OPERAND_LINEAR_GRADIENT;
          return CAIRO_STATUS_SUCCESS;
 @@ -204,26 +204,26 @@ _cairo_gl_gradient_operand_init (cairo_g

          status = _cairo_gl_create_gradient_texture (dst,
                                                      gradient,
 -                                                    &operand->radial.gradient);
 +                                                    &operand->A.radial.gradient);
          if (unlikely (status))
              return status;

  	/* Translation matrix from the destination fragment coordinates
  	 * (pixels from lower left = 0,0) to the coordinates in the
  	 */
 -	cairo_matrix_init_translate (&operand->radial.m, -x0, -y0);
 -	cairo_matrix_multiply (&operand->radial.m,
 +	cairo_matrix_init_translate (&operand->A.radial.m, -x0, -y0);
 +	cairo_matrix_multiply (&operand->A.radial.m,
  			       &pattern->matrix,
 -			       &operand->radial.m);
 -	cairo_matrix_translate (&operand->radial.m, 0, dst->height);
 -	cairo_matrix_scale (&operand->radial.m, 1.0, -1.0);
 -
 -	operand->radial.circle_1_x = x1 - x0;
 -	operand->radial.circle_1_y = y1 - y0;
 -	operand->radial.radius_0 = r0;
 -	operand->radial.radius_1 = r1;
 +			       &operand->A.radial.m);
 +	cairo_matrix_translate (&operand->A.radial.m, 0, dst->height);
 +	cairo_matrix_scale (&operand->A.radial.m, 1.0, -1.0);
 +
 +	operand->A.radial.circle_1_x = x1 - x0;
 +	operand->A.radial.circle_1_y = y1 - y0;
 +	operand->A.radial.radius_0 = r0;
 +	operand->A.radial.radius_1 = r1;

 -        operand->radial.extend = pattern->extend;
 +        operand->A.radial.extend = pattern->extend;

  	operand->type = CAIRO_GL_OPERAND_RADIAL_GRADIENT;
          return CAIRO_STATUS_SUCCESS;
 @@ -239,15 +239,15 @@ _cairo_gl_operand_destroy (cairo_gl_oper
      case CAIRO_GL_OPERAND_CONSTANT:
  	break;
      case CAIRO_GL_OPERAND_LINEAR_GRADIENT:
 -	_cairo_gl_gradient_destroy (operand->linear.gradient);
 +	_cairo_gl_gradient_destroy (operand->A.linear.gradient);
  	break;
      case CAIRO_GL_OPERAND_RADIAL_GRADIENT:
 -	_cairo_gl_gradient_destroy (operand->radial.gradient);
 +	_cairo_gl_gradient_destroy (operand->A.radial.gradient);
  	break;
      case CAIRO_GL_OPERAND_TEXTURE:
          _cairo_pattern_release_surface (NULL, /* XXX */
 -                                        &operand->texture.surface->base,
 -                                        &operand->texture.attributes);
 +                                        &operand->A.texture.surface->base,
 +                                        &operand->A.texture.attributes);
  	break;
      default:
      case CAIRO_GL_OPERAND_COUNT:
 @@ -362,21 +362,21 @@ _cairo_gl_operand_bind_to_shader (cairo_
          strcpy (custom_part, "_constant");
  	_cairo_gl_shader_bind_vec4 (ctx,
                                      uniform_name,
 -                                    operand->constant.color[0],
 -                                    operand->constant.color[1],
 -                                    operand->constant.color[2],
 -                                    operand->constant.color[3]);
 +                                    operand->A.constant.color[0],
 +                                    operand->A.constant.color[1],
 +                                    operand->A.constant.color[2],
 +                                    operand->A.constant.color[3]);
          break;
      case CAIRO_GL_OPERAND_LINEAR_GRADIENT:
          strcpy (custom_part, "_matrix");
  	_cairo_gl_shader_bind_matrix (ctx,
                                        uniform_name,
 -				      &operand->linear.m);
 +				      &operand->A.linear.m);
          strcpy (custom_part, "_segment");
  	_cairo_gl_shader_bind_vec2   (ctx,
                                        uniform_name,
 -				      operand->linear.segment_x,
 -				      operand->linear.segment_y);
 +				      operand->A.linear.segment_x,
 +				      operand->A.linear.segment_y);
          strcpy (custom_part, "_sampler");
  	_cairo_gl_shader_bind_texture(ctx,
                                        uniform_name,
 @@ -386,20 +386,20 @@ _cairo_gl_operand_bind_to_shader (cairo_
          strcpy (custom_part, "_matrix");
          _cairo_gl_shader_bind_matrix (ctx,
                                        uniform_name,
 -                                      &operand->radial.m);
 +                                      &operand->A.radial.m);
          strcpy (custom_part, "_circle_1");
          _cairo_gl_shader_bind_vec2   (ctx,
                                        uniform_name,
 -                                      operand->radial.circle_1_x,
 -                                      operand->radial.circle_1_y);
 +                                      operand->A.radial.circle_1_x,
 +                                      operand->A.radial.circle_1_y);
          strcpy (custom_part, "_radius_0");
          _cairo_gl_shader_bind_float  (ctx,
                                        uniform_name,
 -                                      operand->radial.radius_0);
 +                                      operand->A.radial.radius_0);
          strcpy (custom_part, "_radius_1");
          _cairo_gl_shader_bind_float  (ctx,
                                        uniform_name,
 -                                      operand->radial.radius_1);
 +                                      operand->A.radial.radius_1);
          strcpy (custom_part, "_sampler");
  	_cairo_gl_shader_bind_texture(ctx,
                                        uniform_name,
 @@ -482,7 +482,7 @@ _cairo_gl_operand_setup_fixed (cairo_gl_
  {
      switch (operand->type) {
      case CAIRO_GL_OPERAND_CONSTANT:
 -        glTexEnvfv (GL_TEXTURE_ENV, GL_TEXTURE_ENV_COLOR, operand->constant.color);
 +        glTexEnvfv (GL_TEXTURE_ENV, GL_TEXTURE_ENV_COLOR, operand->A.constant.color);
          glTexEnvi (GL_TEXTURE_ENV, GL_SRC0_RGB, GL_CONSTANT);
          glTexEnvi (GL_TEXTURE_ENV, GL_SRC0_ALPHA, GL_CONSTANT);
          break;
 @@ -527,7 +527,7 @@ _cairo_gl_operand_setup_fixed (cairo_gl_
          glTexEnvi (GL_TEXTURE_ENV, GL_OPERAND1_ALPHA, GL_SRC_ALPHA);

          if (operand->type == CAIRO_GL_OPERAND_TEXTURE &&
 -            operand->texture.attributes.has_component_alpha)
 +            operand->A.texture.attributes.has_component_alpha)
              glTexEnvi (GL_TEXTURE_ENV, GL_OPERAND0_RGB, GL_SRC_COLOR);
          else
              glTexEnvi (GL_TEXTURE_ENV, GL_OPERAND0_RGB, GL_SRC_ALPHA);
 @@ -551,15 +551,15 @@ _cairo_gl_operand_needs_setup (cairo_gl_
      case CAIRO_GL_OPERAND_SPANS:
          return FALSE;
      case CAIRO_GL_OPERAND_CONSTANT:
 -        return dest->constant.color[0] != source->constant.color[0] ||
 -               dest->constant.color[1] != source->constant.color[1] ||
 -               dest->constant.color[2] != source->constant.color[2] ||
 -               dest->constant.color[3] != source->constant.color[3];
 +        return dest->A.constant.color[0] != source->A.constant.color[0] ||
 +               dest->A.constant.color[1] != source->A.constant.color[1] ||
 +               dest->A.constant.color[2] != source->A.constant.color[2] ||
 +               dest->A.constant.color[3] != source->A.constant.color[3];
      case CAIRO_GL_OPERAND_TEXTURE:
 -        return dest->texture.surface != source->texture.surface ||
 -               dest->texture.attributes.extend != source->texture.attributes.extend ||
 -               dest->texture.attributes.filter != source->texture.attributes.filter ||
 -               dest->texture.attributes.has_component_alpha != source->texture.attributes.has_component_alpha;
 +        return dest->A.texture.surface != source->A.texture.surface ||
 +               dest->A.texture.attributes.extend != source->A.texture.attributes.extend ||
 +               dest->A.texture.attributes.filter != source->A.texture.attributes.filter ||
 +               dest->A.texture.attributes.has_component_alpha != source->A.texture.attributes.has_component_alpha;
      case CAIRO_GL_OPERAND_LINEAR_GRADIENT:
      case CAIRO_GL_OPERAND_RADIAL_GRADIENT:
          /* XXX: improve this */
 @@ -621,12 +621,12 @@ _cairo_gl_context_setup_operand (cairo_g
          break;
      case CAIRO_GL_OPERAND_TEXTURE:
          glActiveTexture (GL_TEXTURE0 + tex_unit);
 -        glBindTexture (ctx->tex_target, operand->texture.tex);
 +        glBindTexture (ctx->tex_target, operand->A.texture.tex);
          glEnable (ctx->tex_target);
          _cairo_gl_texture_set_extend (ctx, ctx->tex_target,
 -                                      operand->texture.attributes.extend);
 +                                      operand->A.texture.attributes.extend);
          _cairo_gl_texture_set_filter (ctx, ctx->tex_target,
 -                                      operand->texture.attributes.filter);
 +                                      operand->A.texture.attributes.filter);

  	glClientActiveTexture (GL_TEXTURE0 + tex_unit);
  	glTexCoordPointer (2, GL_FLOAT, vertex_size,
 @@ -634,18 +634,18 @@ _cairo_gl_context_setup_operand (cairo_g
  	glEnableClientState (GL_TEXTURE_COORD_ARRAY);
          break;
      case CAIRO_GL_OPERAND_LINEAR_GRADIENT:
 -        _cairo_gl_gradient_reference (operand->linear.gradient);
 +        _cairo_gl_gradient_reference (operand->A.linear.gradient);
          glActiveTexture (GL_TEXTURE0 + tex_unit);
 -        glBindTexture (GL_TEXTURE_1D, operand->linear.gradient->tex);
 -        _cairo_gl_texture_set_extend (ctx, GL_TEXTURE_1D, operand->linear.extend);
 +        glBindTexture (GL_TEXTURE_1D, operand->A.linear.gradient->tex);
 +        _cairo_gl_texture_set_extend (ctx, GL_TEXTURE_1D, operand->A.linear.extend);
          _cairo_gl_texture_set_filter (ctx, GL_TEXTURE_1D, CAIRO_FILTER_BILINEAR);
          glEnable (GL_TEXTURE_1D);
          break;
      case CAIRO_GL_OPERAND_RADIAL_GRADIENT:
 -        _cairo_gl_gradient_reference (operand->radial.gradient);
 +        _cairo_gl_gradient_reference (operand->A.radial.gradient);
          glActiveTexture (GL_TEXTURE0 + tex_unit);
 -        glBindTexture (GL_TEXTURE_1D, operand->radial.gradient->tex);
 -        _cairo_gl_texture_set_extend (ctx, GL_TEXTURE_1D, operand->radial.extend);
 +        glBindTexture (GL_TEXTURE_1D, operand->A.radial.gradient->tex);
 +        _cairo_gl_texture_set_extend (ctx, GL_TEXTURE_1D, operand->A.radial.extend);
          _cairo_gl_texture_set_filter (ctx, GL_TEXTURE_1D, CAIRO_FILTER_BILINEAR);
          glEnable (GL_TEXTURE_1D);
          break;
 @@ -683,12 +683,12 @@ _cairo_gl_context_destroy_operand (cairo
          glDisableClientState (GL_TEXTURE_COORD_ARRAY);
          break;
      case CAIRO_GL_OPERAND_LINEAR_GRADIENT:
 -        _cairo_gl_gradient_destroy (ctx->operands[tex_unit].linear.gradient);
 +        _cairo_gl_gradient_destroy (ctx->operands[tex_unit].A.linear.gradient);
          glActiveTexture (GL_TEXTURE0 + tex_unit);
          glDisable (GL_TEXTURE_1D);
          break;
      case CAIRO_GL_OPERAND_RADIAL_GRADIENT:
 -        _cairo_gl_gradient_destroy (ctx->operands[tex_unit].radial.gradient);
 +        _cairo_gl_gradient_destroy (ctx->operands[tex_unit].A.radial.gradient);
          glActiveTexture (GL_TEXTURE0 + tex_unit);
          glDisable (GL_TEXTURE_1D);
          break;
 @@ -913,7 +913,7 @@ _cairo_gl_composite_begin (cairo_gl_comp
      glEnable (GL_BLEND);

      component_alpha = ((setup->mask.type == CAIRO_GL_OPERAND_TEXTURE) &&
 -                       setup->mask.texture.attributes.has_component_alpha);
 +                       setup->mask.A.texture.attributes.has_component_alpha);

      /* Do various magic for component alpha */
      if (component_alpha) {
 @@ -1094,7 +1094,7 @@ _cairo_gl_operand_emit (cairo_gl_operand
          break;
      case CAIRO_GL_OPERAND_TEXTURE:
          {
 -            cairo_surface_attributes_t *src_attributes = &operand->texture.attributes;
 +            cairo_surface_attributes_t *src_attributes = &operand->A.texture.attributes;
              double s = x;
              double t = y;


 --------------060504020600020504090303
 Content-Type: text/plain;
  name="patch-ae"
 Content-Transfer-Encoding: 7bit
 Content-Disposition: attachment;
  filename="patch-ae"

 $NetBSD$

 --- src/cairo-gl-private.h.orig	2010-10-05 08:03:11.741805082 +0000
 +++ src/cairo-gl-private.h
 @@ -167,7 +167,7 @@ typedef struct cairo_gl_operand {
  	    float radius_1;
              cairo_extend_t extend;
  	} radial;
 -    };
 +    } A;
      unsigned int vertex_offset;
  } cairo_gl_operand_t;


 --------------060504020600020504090303
 Content-Type: text/plain;
  name="patch-af"
 Content-Transfer-Encoding: 7bit
 Content-Disposition: attachment;
  filename="patch-af"

 $NetBSD$

 --- src/cairo-gl-surface.c.orig	2010-09-02 11:38:55.000000000 +0000
 +++ src/cairo-gl-surface.c
 @@ -776,10 +776,10 @@ _cairo_gl_surface_finish (void *abstract
          return status;

      if (ctx->operands[CAIRO_GL_TEX_SOURCE].type == CAIRO_GL_OPERAND_TEXTURE &&
 -        ctx->operands[CAIRO_GL_TEX_SOURCE].texture.surface == surface)
 +        ctx->operands[CAIRO_GL_TEX_SOURCE].A.texture.surface == surface)
          _cairo_gl_context_destroy_operand (ctx, CAIRO_GL_TEX_SOURCE);
      if (ctx->operands[CAIRO_GL_TEX_MASK].type == CAIRO_GL_OPERAND_TEXTURE &&
 -        ctx->operands[CAIRO_GL_TEX_MASK].texture.surface == surface)
 +        ctx->operands[CAIRO_GL_TEX_MASK].A.texture.surface == surface)
          _cairo_gl_context_destroy_operand (ctx, CAIRO_GL_TEX_MASK);
      if (ctx->current_target == surface)
  	ctx->current_target = NULL;
 @@ -1382,9 +1382,9 @@ _cairo_gl_surface_flush (void *abstract_
          return status;

      if ((ctx->operands[CAIRO_GL_TEX_SOURCE].type == CAIRO_GL_OPERAND_TEXTURE &&
 -         ctx->operands[CAIRO_GL_TEX_SOURCE].texture.surface == surface) ||
 +         ctx->operands[CAIRO_GL_TEX_SOURCE].A.texture.surface == surface) ||
          (ctx->operands[CAIRO_GL_TEX_MASK].type == CAIRO_GL_OPERAND_TEXTURE &&
 -         ctx->operands[CAIRO_GL_TEX_MASK].texture.surface == surface) ||
 +         ctx->operands[CAIRO_GL_TEX_MASK].A.texture.surface == surface) ||
          (ctx->current_target == surface))
        _cairo_gl_composite_flush (ctx);


 --------------060504020600020504090303--

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.