NetBSD Problem Report #36974

From is@beverly.kleinbus.org  Wed Sep 12 16:05:42 2007
Return-Path: <is@beverly.kleinbus.org>
Received: from mail.netbsd.org (mail.netbsd.org [204.152.190.11])
	by narn.NetBSD.org (Postfix) with ESMTP id EBA4963B89F
	for <gnats-bugs@gnats.NetBSD.org>; Wed, 12 Sep 2007 16:05:41 +0000 (UTC)
Message-Id: <20070912160539.7B3C8210D6@beverly.kleinbus.org>
Date: Wed, 12 Sep 2007 18:05:39 +0200 (CEST)
From: is@netbsd.org
Reply-To: is@netbsd.org
To: gnats-bugs@NetBSD.org
Subject: xorp doesn't compile targeted at arm
X-Send-Pr-Version: 3.95

>Number:         36974
>Category:       pkg
>Synopsis:       xorp doesn't compile targeted at arm
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    pkg-manager
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Sep 12 16:10:00 +0000 2007
>Closed-Date:    Mon Aug 10 07:01:14 +0000 2015
>Last-Modified:  Mon Aug 10 07:01:14 +0000 2015
>Originator:     Ignatios Souvatzis
>Release:        NetBSD 3.0
>Organization:
seal your e-mail: http://www.gnupg.org/
>Environment:


System: NetBSD marie 3.0 NetBSD 3.0 (MARIE) #0: Mon Jan 9 23:07:11 CET 2006 ignatios@tangens:/usr/local/sources/3.0/oa/sys/arch/shark/compile/MARIE shark
Architecture: arm
Machine: shark
>Description:
	When compiling net/xorp on a Shark (see above), I get this:

	[...]
ea_proto_comm.lo -MD -MP -MF .deps/mfea_proto_comm.TPlo -o mfea_proto_comm.o
mfea_proto_comm.cc: In member function `void
   ProtoComm::proto_socket_read(XorpFd, IoEventType)':
mfea_proto_comm.cc:1252: warning: cast from `char*' to `cmsghdr*' increases
   required alignment of target type
mfea_proto_comm.cc:1342: warning: cast from `char*' to `cmsghdr*' increases
   required alignment of target type
mfea_proto_comm.cc:1356: warning: cast from `u_char*' to `int*' increases
   required alignment of target type
mfea_proto_comm.cc: In member function `int
   ProtoComm::proto_socket_write(unsigned int, const IPvX&, const IPvX&, int,
   int, bool, const __uint8_t*, long unsigned int, std::string&)':
mfea_proto_comm.cc:1647: warning: cast from `ip*' to `__uint32_t*' increases
   required alignment of target type
mfea_proto_comm.cc:1801: warning: cast from `char*' to `cmsghdr*' increases
   required alignment of target type
mfea_proto_comm.cc:1860: warning: cast from `char*' to `cmsghdr*' increases
   required alignment of target type
mfea_proto_comm.cc:1869: warning: cast from `u_char*' to `int*' increases
   required alignment of target type
mfea_proto_comm.cc:1870: warning: cast from `char*' to `cmsghdr*' increases
   required alignment of target type

[wrapper.sh] note: The real command line, after the pkgsrc wrapper, was:
/home/sources/pkgsrc/net/xorp/work/.gcc/bin/g++ -DHAVE_CONFIG_H -I. -I.. -g -W -
[...]
** Error code 1

>How-To-Repeat:
	cd .../net/xorp; make
>Fix:
	Workaround: Compile targeted at i386.
	Fix: don't know. I'll try to upgrade the package to xorp-1.5 
	some time, if nobody beats me to it, and try again.


>Release-Note:

>Audit-Trail:

State-Changed-From-To: open->feedback
State-Changed-By: obache@netbsd.org
State-Changed-When: Sat, 13 Oct 2007 15:26:54 +0000
State-Changed-Why:
Updated to version 1.4.  Would you be able to try again?


From: Ignatios Souvatzis <is@netbsd.org>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: pkg/36974 (xorp doesn't compile targeted at arm)
Date: Mon, 15 Oct 2007 06:38:51 +0200

 On Sat, Oct 13, 2007 at 03:26:55PM +0000, obache@netbsd.org wrote:

 > Updated to version 1.4.  Would you be able to try again?

 Alas, I wasn't succesful. At least the warnings about "_u_int32_t
 *" are gone.  Here's the last part of the log - full log (about
 400 kBytes) available on request:


 + -DHAVE_CONFIG_H -I. -I. -I.. -I.. -I/usr/include -I/usr/include -g -W -Wall 
 -Wwrite-strings -Wcast-qual -Werror -Wpointer-arith -Wcast-align -Wstrict-protot
 ypes -Woverloaded-virtual -ftemplate-depth-25 -pipe -c mfea_proto_comm.cc -MT mf
 ea_proto_comm.lo -MD -MP -MF .deps/mfea_proto_comm.TPlo -o mfea_proto_comm.o
 mfea_proto_comm.cc: In member function `void 
    ProtoComm::proto_socket_read(XorpFd, IoEventType)':
 mfea_proto_comm.cc:1490: warning: cast from `char*' to `cmsghdr*' increases 
    required alignment of target type
 mfea_proto_comm.cc:1585: warning: cast from `char*' to `cmsghdr*' increases 
    required alignment of target type
 mfea_proto_comm.cc: In member function `int 
    ProtoComm::proto_socket_write(unsigned int, const IPvX&, const IPvX&, int, 
    int, bool, const __uint8_t*, long unsigned int, std::string&)':
 mfea_proto_comm.cc:2184: warning: cast from `char*' to `cmsghdr*' increases 
    required alignment of target type
 mfea_proto_comm.cc:2243: warning: cast from `char*' to `cmsghdr*' increases 
    required alignment of target type
 mfea_proto_comm.cc:2254: warning: cast from `char*' to `cmsghdr*' increases 
    required alignment of target type
 gmake[3]: *** [mfea_proto_comm.lo] Error 1
 gmake[3]: Leaving directory `/home/sources/pkgsrc/net/xorp/work/xorp-1.4/fea'
 gmake[2]: *** [all-recursive] Error 1
 gmake[2]: Leaving directory `/home/sources/pkgsrc/net/xorp/work/xorp-1.4/fea'
 gmake[1]: *** [all-recursive] Error 1
 gmake[1]: Leaving directory `/home/sources/pkgsrc/net/xorp/work/xorp-1.4'
 gmake: *** [all] Error 2
 *** Error code 2

State-Changed-From-To: feedback->open
State-Changed-By: obache@netbsd.org
State-Changed-When: Mon, 15 Oct 2007 04:58:32 +0000
State-Changed-Why:
Problem still exists.


State-Changed-From-To: open->feedback
State-Changed-By: obache@NetBSD.org
State-Changed-When: Thu, 11 Sep 2008 11:01:56 +0000
State-Changed-Why:
Updated to version 1.5.  Would you be able to try again?


From: Ignatios Souvatzis <is@netbsd.org>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: pkg/36974 (xorp doesn't compile targeted at arm)
Date: Thu, 11 Sep 2008 14:41:47 +0200

 On Thu, Sep 11, 2008 at 11:01:56AM +0000, obache@NetBSD.org wrote:
 > Synopsis: xorp doesn't compile targeted at arm
 > 
 > State-Changed-From-To: open->feedback
 > State-Changed-By: obache@NetBSD.org
 > State-Changed-When: Thu, 11 Sep 2008 11:01:56 +0000
 > State-Changed-Why:
 > Updated to version 1.5.  Would you be able to try again?

 Still a fatal alignment warning. Compiling on 4.0


 /bin/sh ../libtool --tag=CXX   --mode=compile c++ -DHAVE_CONFIG_H -I. -I.. -I..  -I/usr/include  -I/usr/include -g -Werror -W -Wall -Wwrite-strings -Wcast-qual -Wpointer-arith -Wcast-align -Woverloaded-virtual -ftemplate-depth-25 -pipe -MT ipvx.lo -MD -MP -MF .deps/ipvx.Tpo -c -o ipvx.lo ipvx.cc
  c++ -DHAVE_CONFIG_H -I. -I.. -I.. -I/usr/include -I/usr/include -g -Werror -W -Wall -Wwrite-strings -Wcast-qual -Wpointer-arith -Wcast-align -Woverloaded-virtual -ftemplate-depth-25 -pipe -MT ipvx.lo -MD -MP -MF .deps/ipvx.Tpo -c ipvx.cc -o ipvx.o
  cc1plus: warnings being treated as errors
  ipvx.cc: In member function 'size_t IPvX::copy_out(sockaddr_in&) const':
  ipvx.cc:364: warning: cast from 'sockaddr_in*' to 'sockaddr_in6*' increases required alignment of target type
  ipvx.cc: In member function 'size_t IPvX::copy_in(const sockaddr_in&)':
  ipvx.cc:495: warning: cast from 'const sockaddr_in*' to 'const sockaddr_in6*' increases required alignment of target type
  gmake[3]: *** [ipvx.lo] Error 1
  gmake[3]: Leaving directory `/pkg_comp/obj/pkgsrc/net/xorp/default/xorp-1.5/libxorp'
  gmake[2]: *** [all] Error 2
  gmake[2]: Leaving directory `/pkg_comp/obj/pkgsrc/net/xorp/default/xorp-1.5/libxorp'
  gmake[1]: *** [all-recursive] Error 1
  gmake[1]: Leaving directory `/pkg_comp/obj/pkgsrc/net/xorp/default/xorp-1.5'
  gmake: *** [all] Error 2
  *** Error code 2



 -- 
 seal your e-mail: http://www.gnupg.org/

State-Changed-From-To: feedback->open
State-Changed-By: obache@NetBSD.org
State-Changed-When: Thu, 11 Sep 2008 13:11:11 +0000
State-Changed-Why:
Problem still exists.


From: "OBATA Akio" <obache@netbsd.org>
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: pkg/36974 (xorp doesn't compile targeted at arm)
Date: Thu, 11 Sep 2008 22:10:31 +0900

 On Thu, 11 Sep 2008 21:45:02 +0900, Ignatios Souvatzis <is@netbsd.org> wrote:

 >  > Updated to version 1.5.  Would you be able to try again?
 > 
 >  Still a fatal alignment warning. Compiling on 4.0

 Hmm... would you like to post the warning to upstream Bugzilla?

State-Changed-From-To: open->feedback
State-Changed-By: obache@NetBSD.org
State-Changed-When: Tue, 12 May 2009 14:02:32 +0000
State-Changed-Why:
Updated to 1.6.  Would you try to build the version?


From: Ignatios Souvatzis <is@netbsd.org>
To: gnats-bugs@NetBSD.org
Cc: pkg-manager@netbsd.org, pkgsrc-bugs@netbsd.org, gnats-admin@netbsd.org,
	obache@NetBSD.org, is@netbsd.org
Subject: Re: pkg/36974 (xorp doesn't compile targeted at arm)
Date: Mon, 18 May 2009 06:54:36 +0200

 On Tue, May 12, 2009 at 02:02:33PM +0000, obache@NetBSD.org wrote:
 > Synopsis: xorp doesn't compile targeted at arm
 > 
 > State-Changed-From-To: open->feedback
 > State-Changed-By: obache@NetBSD.org
 > State-Changed-When: Tue, 12 May 2009 14:02:32 +0000
 > State-Changed-Why:
 > Updated to 1.6.  Would you try to build the version?

 Same as 1.5: 

 cc1plus: warnings being treated as errors
 ipvx.cc: In member function 'size_t IPvX::copy_out(sockaddr_in&) const':
 ipvx.cc:370: warning: cast from 'sockaddr_in*' to 'sockaddr_in6*' increases requ
 ired alignment of target type
 ipvx.cc: In member function 'size_t IPvX::copy_in(const sockaddr_in&)':
 ipvx.cc:501: warning: cast from 'const sockaddr_in*' to 'const sockaddr_in6*' in
 creases required alignment of target type
 gmake[3]: *** [ipvx.lo] Error 1

 OK, I was brave and looked at the code.

 What they do is simply wrong... IPv6 cases bolted on IPv4-code as an
 afterthought. So they assume they could add a few AF_INET6 cases even 
 when sockaddr_in is used, in case parts of the code are still wrong.

 Only this doesn't work, because of different size in addition to
 different alignment restrictions.

 They should have used struct sockaddr in the old days, with casting
 it to sockaddr_in where necessary; then they could have globally
 s/struct sockaddr/struct sockaddr_storage/ for the modern days.

 Lukem@ pointed out, that in Stevens, Unix Network Programming, Volume 1
 page 72/73 all this stuff is explained (e.g. fig 3.6).

 <lukem> `` If any socket address structures that the systems upports have
 +alignment requirements, the sockaddr_storage proivides the strictest
 +alignment requirement. ''

 Regards,
 	-is

State-Changed-From-To: feedback->open
State-Changed-By: obache@NetBSD.org
State-Changed-When: Mon, 18 May 2009 05:04:39 +0000
State-Changed-Why:
Problem still exists.


From: Ignatios Souvatzis <is@netbsd.org>
To: gnats-bugs@NetBSD.org
Cc: pkg-manager@netbsd.org, gnats-admin@netbsd.org, pkgsrc-bugs@netbsd.org,
	is@netbsd.org
Subject: Re: pkg/36974 (xorp doesn't compile targeted at arm)
Date: Mon, 18 May 2009 12:02:17 +0200

 On Thu, Sep 11, 2008 at 01:15:06PM +0000, OBATA Akio wrote:
 > The following reply was made to PR pkg/36974; it has been noted by GNATS.
 > 
 > From: "OBATA Akio" <obache@netbsd.org>
 > To: gnats-bugs@netbsd.org
 > Cc: 
 > Subject: Re: pkg/36974 (xorp doesn't compile targeted at arm)
 > Date: Thu, 11 Sep 2008 22:10:31 +0900
 > 
 >  On Thu, 11 Sep 2008 21:45:02 +0900, Ignatios Souvatzis <is@netbsd.org> wrote:
 >  
 >  >  > Updated to version 1.5.  Would you be able to try again?
 >  > 
 >  >  Still a fatal alignment warning. Compiling on 4.0
 >  
 >  Hmm... would you like to post the warning to upstream Bugzilla?

 After getting yet another password to remember, I've done this.

 Bug # 1076 @ bugzilla.xorp.org

 	-is
 -- 
 seal your e-mail: http://www.gnupg.org/

From: David Holland <dholland-pbugs@netbsd.org>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: pkg/36974 (xorp doesn't compile targeted at arm)
Date: Sun, 1 Aug 2010 00:09:06 +0000

 On Mon, May 18, 2009 at 10:05:03AM +0000, Ignatios Souvatzis wrote:
  >>>  Still a fatal alignment warning. Compiling on 4.0
  >>  
  >>  Hmm... would you like to post the warning to upstream Bugzilla?
  >  
  >  After getting yet another password to remember, I've done this.
  >  
  >  Bug # 1076 @ bugzilla.xorp.org

 Upstream seems to have dumped bugzilla and switched to trac, and in
 the process either lost or closed this report -- there are some bug
 reports in their trac that have bugzilla numbers attached to them, but
 none are 1076.

 One might think this means that the problem's been fixed upstream, but
 as far as I can tell from looking at the source it hasn't. (But if you
 want to try building 1.6, I suppose there's some chance I might be
 wrong.)

 Maybe we should just disable the warning... if they think casting from
 sockaddr_in* to sockaddr_in6* is going to be valid, presumably it's
 because the thing was originally allocated as a sockaddr_storage and
 it therefore should (one would hope) be properly aligned.

 -- 
 David A. Holland
 dholland@netbsd.org

From: David Holland <dholland-pbugs@netbsd.org>
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: pkg/36974 (xorp doesn't compile targeted at arm)
Date: Mon, 29 Dec 2014 06:55:40 +0000

 On Sun, Aug 01, 2010 at 12:10:05AM +0000, David Holland wrote:
  >  Maybe we should just disable the warning... if they think casting from
  >  sockaddr_in* to sockaddr_in6* is going to be valid, presumably it's
  >  because the thing was originally allocated as a sockaddr_storage and
  >  it therefore should (one would hope) be properly aligned.

 So, in the current code, they proclaim in utility.h where the casts
 are that it shouldn't cause problems, and launder the pointers through
 void * to try to fool the compiler, which I expect probably doesn't
 work.

 I think we're better off pretending that they're correct, as reworking
 the code (especially since it depends heavily on C++ overload
 resolution) is an upstream-level problem... given that nobody here has
 done it in the past four years, probably nobody will.

 There's already a transform for disabling -Werror on clang; I'm going
 to make that unconditional.

 (Especially since without that the package doesn't build at all with
 gcc 4.8 for unrelated reasons.)

 -- 
 David A. Holland
 dholland@netbsd.org

From: "David A. Holland" <dholland@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/36974 CVS commit: pkgsrc/net/xorp
Date: Mon, 29 Dec 2014 07:03:46 +0000

 Module Name:	pkgsrc
 Committed By:	dholland
 Date:		Mon Dec 29 07:03:46 UTC 2014

 Modified Files:
 	pkgsrc/net/xorp: Makefile

 Log Message:
 Extend removing -Werror to all compilers, not just clang. Fixes build
 with gcc48 on amd64; also closes PR 36974 relating to -Wcast-align on
 arm and other non-x86 platforms.

 Whether the offending code *works* on non-x86 platforms isn't clear,
 but it might and someone will eventually have to try it out. If it
 doesn't, please try to get upstream to fix it as the code probably
 needs fundamental restructuring.


 To generate a diff of this commit:
 cvs rdiff -u -r1.29 -r1.30 pkgsrc/net/xorp/Makefile

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

State-Changed-From-To: open->feedback
State-Changed-By: dholland@NetBSD.org
State-Changed-When: Mon, 29 Dec 2014 07:07:54 +0000
State-Changed-Why:
Build problem should be fixed. If you can test the code that would probably
be helpful, at least if you care about this package at all any more.


State-Changed-From-To: feedback->closed
State-Changed-By: dholland@NetBSD.org
State-Changed-When: Mon, 10 Aug 2015 07:01:14 +0000
State-Changed-Why:
Feedback timeout.


>Unformatted:

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.