Bug #73062 [NEW]: Test for -fvisibility=hidden support fails with certain $CC

From: Date: Sat, 10 Sep 2016 14:57:40 +0000
Subject: Bug #73062 [NEW]: Test for -fvisibility=hidden support fails with certain $CC
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-203945@lists.php.net to get a copy of this message
From:             michael at orlitzky dot com
Operating system: 
PHP version:      7.1Git-2016-09-10 (Git)
Package:          *Compile Issues
Bug Type:         Bug
Bug description:Test for -fvisibility=hidden support fails with certain $CC

Description:
------------
There is a check in configure.in that looks for -fvisibility=hidden
support when the user is building with GCC:

  dnl activate some gcc specific optimizations for gcc >= 4
  if test "$GCC" = "yes"; then
    case $host_alias in
    *darwin*)
      GCC_MAJOR_VERSION=`$CC -dumpversion | /usr/bin/sed -nE
'1s/([[0-9]]+)\.[[0-$
      ;;
    *)
      GCC_MAJOR_VERSION=`$CC --version | $SED -n
'1s/[[^0-9]]*//;1s/\..*//;1p'`
      ;;
    esac
    if test $GCC_MAJOR_VERSION -ge 4; then
      CFLAGS="$CFLAGS -fvisibility=hidden"
    fi
  fi

The idea is to parse off the major version number from the end of the
"gcc --version" output, and see if it's 4 or more. However, the regular
expression in question doesn't work when $CC is a little weird. This is
the expected result, with a vanilla GCC:

  $CC --version | sed -n '1s/[[^0-9]]*//;1s/\..*//;1p'
  4

But this is what happens when my CC is set:

  CC=x86_64-pc-linux-gnu-gcc
  $ $CC --version | sed -n '1s/[[^0-9]]*//;1s/\..*//;1p'
  x6_64-pc-linux-gnu-gcc (Gentoo Hardened 4



-- 
Edit bug report at https://bugs.php.net/bug.php?id=73062&edit=1
-- 
Try a snapshot (PHP 5.4):   https://bugs.php.net/fix.php?id=73062&r=trysnapshot54
Try a snapshot (PHP 5.5):   https://bugs.php.net/fix.php?id=73062&r=trysnapshot55
Try a snapshot (trunk):     https://bugs.php.net/fix.php?id=73062&r=trysnapshottrunk
Fixed in SVN:               https://bugs.php.net/fix.php?id=73062&r=fixed
Fixed in release:           https://bugs.php.net/fix.php?id=73062&r=alreadyfixed
Need backtrace:             https://bugs.php.net/fix.php?id=73062&r=needtrace
Need Reproduce Script:      https://bugs.php.net/fix.php?id=73062&r=needscript
Try newer version:          https://bugs.php.net/fix.php?id=73062&r=oldversion
Not developer issue:        https://bugs.php.net/fix.php?id=73062&r=support
Expected behavior:          https://bugs.php.net/fix.php?id=73062&r=notwrong
Not enough info:            https://bugs.php.net/fix.php?id=73062&r=notenoughinfo
Submitted twice:            https://bugs.php.net/fix.php?id=73062&r=submittedtwice
register_globals:           https://bugs.php.net/fix.php?id=73062&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=73062&r=php4
Daylight Savings:           https://bugs.php.net/fix.php?id=73062&r=dst
IIS Stability:              https://bugs.php.net/fix.php?id=73062&r=isapi
Install GNU Sed:            https://bugs.php.net/fix.php?id=73062&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=73062&r=float
No Zend Extensions:         https://bugs.php.net/fix.php?id=73062&r=nozend
MySQL Configuration Error:  https://bugs.php.net/fix.php?id=73062&r=mysqlcfg



Thread (8 messages)

« previous php.bugs (#203945) next »