Front page | perl.perl5.porters |
Postings from May 2004
[PATCH] Configure shouldn't unconditionally add in -pipe
Thread Next
From:
Andy Dougherty
Date:
May 11, 2004 10:13
Subject:
[PATCH] Configure shouldn't unconditionally add in -pipe
Message ID:
Pine.SOL.4.58.0405111313210.14279@maxwell.phys.lafayette.edu
Configure shouldn't unconditionally add in -pipe to ccflags when the
user is using gcc, unless we can guarantee that all assemblers
will accept input from stdin. (The gcc man page mentions this
possibility, but doesn't give any specific examples.) It's not a big
deal, however, because it's easy to simply test whether -pipe works.
This patch tests whether -pipe works. If it does, and if it's not
already present in ccflags, then it adds it in to the default ccflags
suggested by Configure.
As a side effect, I changed the two hints files that previously
unconditionally set -pipe to fall back on Configure's setting instead.
The end result is they should still get -pipe.
As an unrelated side effect, because I was editing anyway,
I added a comment about Interactive's -posix mode.
diff -r -u perl-current/Configure perl-andy/Configure
--- perl-current/Configure Thu May 6 07:59:58 2004
+++ perl-andy/Configure Tue May 11 11:31:43 2004
@@ -3891,7 +3891,6 @@
*) gccshortvers=`echo "$gccversion"|sed 's/ .*//'`
gccosandvers=`$cc -v 2>&1|grep '/specs$'|sed "s!.*/[^-/]*-[^-/]*-\([^-/]*\)/$gccshortvers/specs!\1!"`
gccshortvers=''
- ccflags="$ccflags -pipe"
case "$gccosandvers" in
$osname) gccosandvers='' ;; # linux gccs seem to have no linux osvers, grr
$osname$osvers) ;; # looking good
@@ -4709,6 +4708,7 @@
2*) if test -d /etc/conf/kconfig.d &&
$contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
then
+ # Interactive Systems (ISC) POSIX mode.
dflt="$dflt -posix"
fi
;;
@@ -4726,6 +4726,26 @@
echo "Leaving current flags $ccflags alone." 2>&1
;;
*) dflt="$dflt -fno-strict-aliasing" ;;
+ esac
+ else
+ echo "Nope, it doesn't, but that's ok." 2>&1
+ fi
+ ;;
+ esac
+ # For gcc, adding -pipe speeds up compilations for some, but apparently
+ # some assemblers can't read from stdin. (It also slows down compilations
+ # in other cases, but those are apparently rarer these days.) AD 5/2004.
+ case "$gccversion" in
+ ?*) echo " "
+ echo "Checking if your compiler accepts -pipe" 2>&1
+ echo 'int main(void) { return 0; }' > gcctest.c
+ if $cc -O2 -pipe -o gcctest gcctest.c; then
+ echo "Yes, it does." 2>&1
+ case "$ccflags" in
+ *-pipe*)
+ echo "Leaving current flags $ccflags alone." 2>&1
+ ;;
+ *) dflt="$dflt -pipe" ;;
esac
else
echo "Nope, it doesn't, but that's ok." 2>&1
diff -r -u perl-current/hints/darwin.sh perl-andy/hints/darwin.sh
--- perl-current/hints/darwin.sh Tue Mar 23 17:57:33 2004
+++ perl-andy/hints/darwin.sh Tue May 11 11:32:36 2004
@@ -89,12 +89,11 @@
;;
esac
-# -pipe: makes compilation go faster.
# -fno-common because common symbols are not allowed in MH_DYLIB
# -DPERL_DARWIN: apparently the __APPLE__ is not sanctioned by Apple
# as the way to differentiate Mac OS X. (The official line is that
# *no* cpp symbol does differentiate Mac OS X.)
-ccflags="${ccflags} -pipe -fno-common -DPERL_DARWIN"
+ccflags="${ccflags} -fno-common -DPERL_DARWIN"
# At least on Darwin 1.3.x:
#
diff -r -u perl-current/hints/rhapsody.sh perl-andy/hints/rhapsody.sh
--- perl-current/hints/rhapsody.sh Mon Aug 4 05:59:25 2003
+++ perl-andy/hints/rhapsody.sh Tue May 11 11:33:03 2004
@@ -53,9 +53,8 @@
# Optimize.
optimize='-O3';
-# -pipe: makes compilation go faster.
# -fno-common because common symbols are not allowed in MH_DYLIB
-ccflags="${ccflags} -pipe -fno-common"
+ccflags="${ccflags} -fno-common"
# Unverified whether this is necessary on Rhapsody, but the test shouldn't hurt.
# At least on Darwin 1.3.x:
--
Andy Dougherty doughera@lafayette.edu
Thread Next
-
[PATCH] Configure shouldn't unconditionally add in -pipe
by Andy Dougherty