Subject: pkg/7453: mit-pthreads pgcc script complains about -E, -M, -S options
To: None <gnats-bugs@gnats.netbsd.org>
From: Andreas Gustafsson <gson@araneus.fi>
List: netbsd-bugs
Date: 04/23/1999 02:20:54
>Number:         7453
>Category:       pkg
>Synopsis:       Subject: mit-pthreads pgcc script complains about -E, -M, -S options
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    pkg-manager (NetBSD software packages system bug manager)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Apr 23 02:20:00 1999
>Last-Modified:
>Originator:     Andreas Gustafsson
>Organization:
Araneus Information Systems Oy
>Release:        1.3.2
>Environment:

System: NetBSD guava.araneus.fi 1.3.2 NetBSD 1.3.2 (GUAVA) #0: Wed Feb 17 10:21:50 EET 1999 gson@guava.araneus.fi:/z/src-1.3/sys/arch/i386/compile/GUAVA i386


>Description:

The pgcc and pg++ scripts installed as part of the devel/mit-pthreads
package print inappropriate warning messages when invoked with any
command line option that suppresses the linking stage of compilation,
except for the "-c" option which does work correctly.  Options triggering
the undesired behaviour include -E, -M, and -S.

The warning messages are more than just a cosmetic problem, because
they cause certain configure scripts generated by GNU Autoconf to
fail.  These scripts attempt to find a working C preprocessor by
running "$CC -E", and consider any output on stderr an indication of
failure.  Hence, "configure CC=/usr/pkgsrc/pthreads/bin/pgcc" may fail
to find any working C preprocessor at all.

>How-To-Repeat:

    $ touch test.c
    $ /usr/pkg/pthreads/bin/pgcc -E test.c
    # 1 "test.c"
    gcc: -lpthread: linker input file unused since linking not done
    gcc: -lm: linker input file unused since linking not done
    gcc: -lgcc: linker input file unused since linking not done
    gcc: -lpthread: linker input file unused since linking not done

>Fix:

Add the following patch to the the
/usr/pkgsrc/devel/mit-pthreads/patches directory.
This patch is for the 1.3.2 pkgsrc:

--- scripts/pgcc.sh.orig	Fri Sep  1 01:43:39 1995
+++ scripts/pgcc.sh	Fri Apr 23 11:37:50 1999
@@ -23,7 +23,7 @@
 for arg in "$@" ; do
     case $arg in
 	-nostdinc)	include_dir= ;;
-	-nostdlib | -c)	libs= ;;
+	-nostdlib | -c | -E | -M | -S)	libs= ;;
     esac
 done
 
For the -current pkgsrc, use this patch instead:

--- scripts/pgcc.sh.orig	Fri Apr 23 12:06:45 1999
+++ scripts/pgcc.sh	Fri Apr 23 12:07:24 1999
@@ -24,7 +24,7 @@
 for arg in "$@" ; do
     case $arg in
 	-nostdinc)	include_dir= ;;
-	-nostdlib | -c)	libs= ldrun= ;;
+	-nostdlib | -c | -E | -M | -S)	libs= ldrun= ;;
     esac
 done
 
>Audit-Trail:
>Unformatted: