Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 318661 | Differences between
and this patch

Collapse All | Expand All

(-)bigloo3.4a-3.orig/autoconf/ccfortify (+65 lines)
Line 0 Link Here
1
#!/bin/sh
2
#*    Checking the C compiler fortify default value (only affects >= gcc-4.5) */
3
4
cflags=
5
6
#*---------------------------------------------------------------------*/
7
#*    We parse the arguments                                           */
8
#*---------------------------------------------------------------------*/
9
while : ; do
10
  case $1 in
11
    "")
12
      break;;
13
14
    --cflags=*|-cflags=*)
15
      cflags="`echo $1 | sed 's/^[-a-z]*=//'`";;
16
17
    -*)
18
      echo "Unknown option \"$1\", ignored" >&2;;
19
  esac
20
  shift
21
done
22
23
file=$TMP/actest$USER
24
aout=$TMP/Xactest$USER
25
26
#*---------------------------------------------------------------------*/
27
#*    compile                                                          */
28
#*---------------------------------------------------------------------*/
29
compile="$CC $cflags $file.c -o $aout >/dev/null"
30
31
#*---------------------------------------------------------------------*/
32
#*    The test C file                                                  */
33
#*---------------------------------------------------------------------*/
34
if( test -f $file.c ); then
35
   rm -f $file.c || exit $?
36
fi
37
38
#*---------------------------------------------------------------------*/
39
#*    Test                                                             */
40
#*---------------------------------------------------------------------*/
41
cat > $file.c <<EOF
42
#include <stdlib.h>
43
#include <stdio.h>
44
45
#ifndef _FORTIFY_SOURCE
46
#define _FORTIFY_SOURCE 0
47
#endif
48
49
int main (void)
50
{
51
  printf( "%d\n", _FORTIFY_SOURCE);
52
  return EXIT_SUCCESS;
53
}
54
EOF
55
56
if eval "$BUILDSH $compile"; then
57
    \rm -f $file.*
58
    eval "$HOSTSH $aout"
59
    ret_code=$?
60
    \rm -f $aout
61
    exit $ret_code
62
fi
63
64
echo "0"
65
exit 0
(-)bigloo3.4a-3.orig/configure (+18 lines)
Lines 1315-1320 Link Here
1315
  strip=`$autoconf strip --strip=$strip` || exit 1
1315
  strip=`$autoconf strip --strip=$strip` || exit 1
1316
fi
1316
fi
1317
1317
1318
1319
#*---------------------------------------------------------------------*/
1320
#*    Test for fortify/abort                                           */
1321
#*    gcc-4.5 -D_FORTIFY_SOURCE=2 makes bigloo to fail at runtime      */
1322
#*---------------------------------------------------------------------*/
1323
fortify=`$autoconf ccfortify --cflags="$cflags"`
1324
if [ $fortify = "2" ]; then
1325
    # We first filter out -D_FORTIFY_SOURCE=2 if it is in cflags
1326
    tmp_new_cflags="";
1327
    for flag in $cflags; do
1328
	if [ "$flag " != "-D_FORTIFY_SOURCE=2 " ]; then
1329
	    tmp_new_cflags="$tmp_new_cflags $flag"
1330
	fi
1331
    done
1332
    # Then add the new flag at the end
1333
    cflags="$tmp_new_cflags -D_FORTIFY_SOURCE=1"
1334
fi
1335
1318
#*---------------------------------------------------------------------*/
1336
#*---------------------------------------------------------------------*/
1319
#*    charset                                                          */
1337
#*    charset                                                          */
1320
#*---------------------------------------------------------------------*/
1338
#*---------------------------------------------------------------------*/

Return to bug 318661