Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 30 Jan 2003 12:02:02 -0600 (CST)
From:      Quincey Koziol <koziol@ncsa.uiuc.edu>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   ports/47684: ports/lang/gcc32 inlines varargs function incorrectly
Message-ID:  <200301301802.h0UI22tL044971@sleipnir.ncsa.uiuc.edu>

next in thread | raw e-mail | index | archive | help

>Number:         47684
>Category:       ports
>Synopsis:       ports/lang/gcc32 inlines varargs function incorrectly
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Jan 30 10:10:01 PST 2003
>Closed-Date:
>Last-Modified:
>Originator:     Quincey Koziol
>Release:        FreeBSD 4.7-STABLE i386
>Organization:
NCSA at University of Illinois
>Environment:
>Description:
    The current gcc32 in ports isn't _quite_ integrated properly with the
latest stable sources, apparently.  Here's the e-mail from the gcc folks:

> ----- Forwarded message from Loren James Rittle <rittle@latour.rsch.comm.mot.com> -----
> 
> Date: Wed, 29 Jan 2003 21:52:46 -0600 (CST)
> From: Loren James Rittle <rittle@latour.rsch.comm.mot.com>
> To: gcc@gcc.gnu.org
> Subject: Re: Bug with -finline-functions and va_start on FreeBSD
> Cc: wendling@ncsa.uiuc.edu
> 
> In article <20030129183055.GA29947@ncsa.uiuc.edu> you write:
> 
> > I'm having a problem with gcc 3.2.1 on FreeBSD 4.7-STABLE for this piece
> > of code:
> >
> > #include <stdio.h>
> > #include <stdarg.h>
> [...]
> > When compiling with the following options:
> >
> >    % gcc32 -o t t.c -finline-functions -fomit-frame-pointer -O2
> >
> > I get this error:
> 
> Your example works fine with gcc 3.2.1 and gcc 3.2.2 (prerelease)
> built from FSF sources on i386-unknown-freebsd4.7.  Based solely upon
> the name you used to invoke the compiler, I suspect that you are
> reporting a bug with a "FreeBSD ports" version of gcc.  If I'm
> correct, then please file it with freebsd.org not gcc.gnu.org.
> 
> To help yourself, please run this command on your machine:
> 
> % gcc32 -E t.c | grep /usr/local | nawk '{print $3}' | sort | uniq 
> 
> If you don't see:
> 
> "/usr/local/lib/gcc-lib/i386-unknown-freebsd4.7/3.2.1/include/machine/ansi.h"
> "/usr/local/lib/gcc-lib/i386-unknown-freebsd4.7/3.2.1/include/stdarg.h"
> 
> Then the bug to report to FreeBSD is this (or figure out yourself how
> to fix the port ;-): "stdarg.h not installed when gcc built from
> ports" & "fixincludes not run when gcc built from ports".
> 
> If you see the 2 lines, then, sorry, I have no idea what your problem
> is.
> 
> > Is this a known problem? Is there a fix for this in the next release of
> > gcc? :-)
> 
> The current FSF release does not have this problem.  There has been a
> bit of a "discussion" over this issue over the years (i.e. it is known
> in my mind).  The various BSD distros prefer to fix their system
> headers as they break.  The FSF side prefers to assume that all system
> headers, from time to time, actually contain minor nits to be
> addressed.  Both positions have merit, but you just happened to be hit
> by a case when the system header could not predict a change in gcc.
> 
> Regards,
> Loren
> 
> ----- End forwarded message -----

>How-To-Repeat:
	
        Use gcc32 with the following flags:
            "gcc32 -O -finline-functions test.c -o test"

        to compile the following test.c code:

#include <stdio.h>
#include <stdarg.h>

static int foo(const char *fmt, ...)
{
    va_list ap;

    va_start(ap, fmt);
    vprintf(fmt, ap);
    va_end(ap);
}

int main(int argc, char **argv)
{
    foo("hello %s\n", "world");
    return 0;
}



>Fix:
    I'm not certain, but I believe that the gcc folks are implying that we
need to install stdarg.h and run "fixincludes" when installing the port.
>Release-Note:
>Audit-Trail:
>Unformatted:
 >System: FreeBSD sleipnir.ncsa.uiuc.edu 4.7-STABLE FreeBSD 4.7-STABLE #0: Fri Jan 3 06:08:54 CST 2003 sukoziol@sleipnir.ncsa.uiuc.edu:/usr/obj/usr/src/sys/SLEIPNIR i386
 
 

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-ports-bugs" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200301301802.h0UI22tL044971>