pkgsrc-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

pkg/41600: mk/compiler/gcc.mk fails to detect GCC's version under some condition.



>Number:         41600
>Category:       pkg
>Synopsis:       mk/compiler/gcc.mk fails to detect GCC's version under some 
>condition.
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Jun 15 22:50:00 +0000 2009
>Originator:     Hiroyuki Bessho
>Release:        Interix on Windows XP
>Organization:
        Not so organized.
>Environment:
System: Interix takanohaxp 3.5 SP-8.0.1969.38 x86 
Intel_x86_Family15_Model3_Stepping3
pkgsrc: as of 2009-Jun-1
Architecture: i386
Machine: i386
>Description:
  I tried to build archivers/bzip2 on Interix, and got an error:
----------------------------------------------------------------
$ bmake
===> Skipping vulnerability checks.
WARNING: No /var/db/pkg/pkg-vulnerabilities file found.
WARNING: To fix run: `/usr/pkg/sbin/pkg_admin -K /var/db/pkg
fetch-pkg-vulnerabilities'.
===> Installing dependencies for bzip2-1.0.5nb1
=> Build dependency libtool-base>=1.5.18nb6: found
libtool-base-1.5.26nb1
=> Build dependency gcc>=2.95.3nb7: NOT found
=> Verifying reinstall for ../../lang/gcc
ERROR: This package is not available for these platforms: Darwin-*-*
Interix-*-* *-*-x86_64 DragonFly-*-*.
ERROR: This package has set PKG_FAIL_REASON:
ERROR: gcc-2.95.3nb7 is not available for Interix-3.5-i386
*** Error code 1

Stop.
bmake: stopped in /dev/fs/E/pkgsrc/lang/gcc
*** Error code 1

Stop.
bmake: stopped in /dev/fs/E/pkgsrc/archivers/bzip2
----------------------------------------------------------------
  This was because mk/compiler/gcc.mk failed to detect the version of
SFU's gcc correctly.  You can confirm that with "make show-all"
----------------------------------------------------------------
$ bmake show-all | grep GCC_VERSION
  def   _GCC_VERSION = 0
  def   _GCC_VERSION_STRING = 0
  def   _PKGSRC_GCC_VERSION = gcc-3.4.6
----------------------------------------------------------------

  This can happen under following conditions:

* compiler.mk is included explicitly from the package's Makefile
  before bsd.pkg.mk
* GCC is version 3.4 or earlier (at least, this doesn't happen with GCC 4.1)
* LANG is set to something other than C or en.

  The source of the problem is that output from "gcc -v" is localized.
----------------------------------------------------------------
$ uname -a
Interix takanohaxp 3.5 SP-8.0.1969.38 x86 Intel_x86_Family15_Model3_Stepping3
$
$ LANG=C gcc -v
Reading specs from /opt/gcc.3.3/lib/gcc-lib/i586-pc-interix3/3.3/specs
Configured with:  : (reconfigured)  : (reconfigured) 
/dev/fs/C/gnu2.intel/egcs.source//configure --verbose --prefix=/opt/gcc.3.3 
--disable-shared --with-stabs --enable-nls --with-local-prefix=/opt/gcc.3.3 
--with-gnu-as --with-gnu-ld --enable-targets=i586-pc-interix3 
--enable-threads=posix
Thread model: posix
gcc version 3.3
$
$ LANG=fr gcc -v
Lecture des spécification à partir de 
/opt/gcc.3.3/lib/gcc-lib/i586-pc-interix3/3.3/specs
Configuré avec:  : (reconfigured)  : (reconfigured) 
/dev/fs/C/gnu2.intel/egcs.source//configure --verbose --prefix=/opt/gcc.3.3 
--disable-shared --with-stabs --enable-nls --with-local-prefix=/opt/gcc.3.3 
--with-gnu-as --with-gnu-ld --enable-targets=i586-pc-interix3 
--enable-threads=posix
Modèle de thread: posix
version gcc 3.3
$
$ echo $LANG
ja
$ gcc -v
/opt/gcc.3.3/lib/gcc-lib/i586-pc-interix3/3.3/specs __ spec ______
__________:  : (reconfigured)  : (reconfigured) 
/dev/fs/C/gnu2.intel/egcs.source//configure --verbose --prefix=/opt/gcc.3.3 
--disable-shared --with-stabs --enable-nls --with-local-prefix=/opt/gcc.3.3 
--with-gnu-as --with-gnu-ld --enable-targets=i586-pc-interix3 
--enable-threads=posix
_______: posix
gcc _____ 3.3
----------------------------------------------------------------

>How-To-Repeat:
        run make for a package whose Makefile includes compiler.mk.
>Fix:
  Here is a quick fix.

diff -r f17e495c0ea9 mk/compiler/gcc.mk
--- a/mk/compiler/gcc.mk        Sat Jun 13 04:39:09 2009 +0900
+++ b/mk/compiler/gcc.mk        Tue Jun 16 06:17:46 2009 +0900
@@ -101,7 +101,7 @@
 
 .if !defined(_GCC_VERSION)
 _GCC_VERSION_STRING!=  \
-       ( ${SETENV} ${ALL_ENV} ${_CC} -v 2>&1 | ${GREP} 'gcc version' ) 
2>/dev/null || ${ECHO} 0
+       ( ${SETENV} ${ALL_ENV} LANG=C ${_CC} -v 2>&1 | ${GREP} 'gcc version' ) 
2>/dev/null || ${ECHO} 0
 .  if !empty(_GCC_VERSION_STRING:Megcs*)
 _GCC_VERSION=  2.8.1           # egcs is considered to be gcc-2.8.1.
 .  elif !empty(_GCC_VERSION_STRING:Mgcc*)



Home | Main Index | Thread Index | Old Index