From nobody@FreeBSD.org  Fri Oct 19 13:32:07 2007
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 73D4216A41A
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 19 Oct 2007 13:32:07 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21])
	by mx1.freebsd.org (Postfix) with ESMTP id 6F3B613C447
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 19 Oct 2007 13:32:07 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.14.1/8.14.1) with ESMTP id l9JDVpKg075556
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 19 Oct 2007 13:31:51 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.14.1/8.14.1/Submit) id l9JDVp0v075554;
	Fri, 19 Oct 2007 13:31:51 GMT
	(envelope-from nobody)
Message-Id: <200710191331.l9JDVp0v075554@www.freebsd.org>
Date: Fri, 19 Oct 2007 13:31:51 GMT
From: Pietro Cerutti <gahr@gahr.ch>
To: freebsd-gnats-submit@FreeBSD.org
Subject: [patch] devel/arm-elf-gcc-295 lvalue required
X-Send-Pr-Version: www-3.1
X-GNATS-Notify: jflemer@alum.rpi.edu

>Number:         117322
>Category:       ports
>Synopsis:       [patch] devel/arm-elf-gcc295 lvalue required
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    miwi
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Oct 19 13:40:00 UTC 2007
>Closed-Date:    Tue Nov 06 10:23:21 UTC 2007
>Last-Modified:  Tue Nov 06 10:23:21 UTC 2007
>Originator:     Pietro Cerutti
>Release:        6.2-STABLE
>Organization:
Bern University of Applied Sciences
>Environment:
FreeBSD gahrtop.localhost 6.2-STABLE FreeBSD 6.2-STABLE #36: Mon Oct  8 14:09:32 CEST 2007     root@gahrtop.localhost:/usr/obj/usr/src/sys/MSI1034  i386
>Description:
In gcc/config/arm/arm.c:530 the following instruction

arm_prog_mode = TARGET_APCS_32 ? PROG_MODE_PROG32 : PROG_MODE_PROG26;

fails to compile because arm_prog_mode is defined as

#define arm_prog_mode ((enum attr_prog_mode) arm_prgmode)

in gcc/config/arm/arm.h:426

This patch, together with ports/117320, brings back the port to a compilable state.
>How-To-Repeat:
cd  /usr/ports/devel/arm-elf-gcc295 && make
>Fix:
*****************************
* Patch to Makefile:
*****************************
--- Makefile.orig       2007-10-19 15:21:21.000000000 +0200
+++ Makefile    2007-10-19 15:24:50.000000000 +0200
@@ -55,7 +55,9 @@

 post-patch:
        @(cd ${PATCH_WRKSRC} && ${PATCH} < ${PATCHDIR}/libiberty-strerror.c && \
-       ${PATCH} < ${PATCHDIR}/libiberty-strsignal.c)
+       ${PATCH} < ${PATCHDIR}/libiberty-strsignal.c && \
+       ${PATCH} < ${PATCHDIR}/gcc-config-arm-arm.h && \
+       ${PATCH} < ${PATCHDIR}/gcc-config-arm-arm.c)

 post-configure:
        ${REINPLACE_CMD} -Ee 's,^(TARGET_CONFIGDIRS\s*=),\1#,' \


*****************************
* files/gcc-config-arm-arm.h:
*****************************
--- gcc/config/arm/arm.h.orig   2007-10-19 15:18:18.000000000 +0200
+++ gcc/config/arm/arm.h        2007-10-19 15:18:35.000000000 +0200
@@ -423,7 +423,7 @@
 };

 /* Recast the program mode class to be the prog_mode attribute */
-#define arm_prog_mode ((enum attr_prog_mode) arm_prgmode)
+#define arm_prog_mode arm_prgmode

 extern enum prog_mode_type arm_prgmode;

*****************************
* files/gcc-config-arm-arm.c:
*****************************
--- gcc/config/arm/arm.c.orig   2007-10-19 15:15:52.000000000 +0200
+++ gcc/config/arm/arm.c        2007-10-19 15:18:48.000000000 +0200
@@ -527,7 +527,7 @@
   if ((TARGET_SOFT_FLOAT || arm_fpu != FP_HARD) && (tune_flags & FL_MODE32) == 0)
     flag_schedule_insns = flag_schedule_insns_after_reload = 0;

-  arm_prog_mode = TARGET_APCS_32 ? PROG_MODE_PROG32 : PROG_MODE_PROG26;
+  arm_prog_mode = (enum attr_prog_mode) (TARGET_APCS_32 ? PROG_MODE_PROG32 : PROG_MODE_PROG26);

   if (structure_size_string != NULL)
     {



>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->feedback 
State-Changed-By: edwin 
State-Changed-When: Fri Oct 19 22:04:08 UTC 2007 
State-Changed-Why:  
Awaiting maintainers feedback (via the GNATS Auto Assign Tool) 

http://www.freebsd.org/cgi/query-pr.cgi?pr=117322 

From: Pietro Cerutti <gahr@gahr.ch>
To: bug-followup@FreeBSD.org,  gahr@gahr.ch,  jflemer@alum.rpi.edu
Cc:  
Subject: Re: ports/117322: [patch] devel/arm-elf-gcc295 lvalue required
Date: Tue, 30 Oct 2007 14:24:01 +0100

 Note: this issue is only present with GCC > 4.1.
 
 Maintainer feedback should arrive later this week.
 
 -- 
 Pietro Cerutti
 
 PGP Public Key:
 http://gahr.ch/pgp
Responsible-Changed-From-To: freebsd-ports-bugs->miwi 
Responsible-Changed-By: miwi 
Responsible-Changed-When: Sun Nov 4 22:43:21 UTC 2007 
Responsible-Changed-Why:  
I'll take it. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=117322 
State-Changed-From-To: feedback->closed 
State-Changed-By: miwi 
State-Changed-When: Tue Nov 6 10:23:20 UTC 2007 
State-Changed-Why:  
Committed. Thanks! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=117322 
>Unformatted:
