summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbecker33 <becker33@llnl.gov>2016-08-25 16:00:00 -0700
committerGitHub <noreply@github.com>2016-08-25 16:00:00 -0700
commite73a1a4ec3af54a4efcf0cc6453869f6f99139cd (patch)
tree6e5ee2aa7c2a0f032fac59a80dab81735875f6a3
parent77c24d4127f29f88eed6edc99c3a71d2ac56f6a5 (diff)
parentf4ec99ecb491560336242081142d1753afa94dd7 (diff)
downloadspack-e73a1a4ec3af54a4efcf0cc6453869f6f99139cd.tar.gz
spack-e73a1a4ec3af54a4efcf0cc6453869f6f99139cd.tar.bz2
spack-e73a1a4ec3af54a4efcf0cc6453869f6f99139cd.tar.xz
spack-e73a1a4ec3af54a4efcf0cc6453869f6f99139cd.zip
Merge pull request #1558 from mcfadden8/mmcfadden-features/gcc-pic-libraries
Added variant to gcc package to install PIC versions of libgfortran and libstdc++
-rw-r--r--var/spack/repos/builtin/packages/gcc/package.py5
-rw-r--r--var/spack/repos/builtin/packages/gcc/piclibs.patch62
2 files changed, 67 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/gcc/package.py b/var/spack/repos/builtin/packages/gcc/package.py
index 915a0a1881..3be3948b59 100644
--- a/var/spack/repos/builtin/packages/gcc/package.py
+++ b/var/spack/repos/builtin/packages/gcc/package.py
@@ -36,6 +36,9 @@ class Gcc(Package):
variant('gold',
default=sys.platform != 'darwin',
description="Build the gold linker plugin for ld-based LTO")
+ variant('piclibs',
+ default=False,
+ description="Build PIC versions of libgfortran.a and libstdc++.a")
depends_on("mpfr")
depends_on("gmp")
@@ -53,6 +56,8 @@ class Gcc(Package):
else:
provides('golang', when='@4.7.1:')
+ patch('piclibs.patch', when='+piclibs')
+
def install(self, spec, prefix):
# libjava/configure needs a minor fix to install into spack paths.
filter_file(r"'@.*@'", "'@[[:alnum:]]*@'", 'libjava/configure',
diff --git a/var/spack/repos/builtin/packages/gcc/piclibs.patch b/var/spack/repos/builtin/packages/gcc/piclibs.patch
new file mode 100644
index 0000000000..0ecb793067
--- /dev/null
+++ b/var/spack/repos/builtin/packages/gcc/piclibs.patch
@@ -0,0 +1,62 @@
+diff --git a/libgfortran/Makefile.in b/libgfortran/Makefile.in
+index 62b9f7a..7666fdb 100644
+--- a/libgfortran/Makefile.in
++++ b/libgfortran/Makefile.in
+@@ -357,11 +357,11 @@ AUTOMAKE = @AUTOMAKE@
+ AWK = @AWK@
+ CC = @CC@
+ CCDEPMODE = @CCDEPMODE@
+-CFLAGS = @CFLAGS@
++CFLAGS = @CFLAGS@ -fPIC
+ CPP = @CPP@
+-CPPFLAGS = @CPPFLAGS@
++CPPFLAGS = @CPPFLAGS@ -fPIC
+ CYGPATH_W = @CYGPATH_W@
+-DEFS = @DEFS@
++DEFS = @DEFS@ -fPIC
+ DEPDIR = @DEPDIR@
+ DSYMUTIL = @DSYMUTIL@
+ DUMPBIN = @DUMPBIN@
+@@ -371,7 +371,7 @@ ECHO_T = @ECHO_T@
+ EGREP = @EGREP@
+ EXEEXT = @EXEEXT@
+ FC = @FC@
+-FCFLAGS = @FCFLAGS@
++FCFLAGS = @FCFLAGS@ -fPIC
+ FGREP = @FGREP@
+ FPU_HOST_HEADER = @FPU_HOST_HEADER@
+ GREP = @GREP@
+diff --git a/libstdc++-v3/Makefile.in b/libstdc++-v3/Makefile.in
+index bede542..9b3e442 100644
+--- a/libstdc++-v3/Makefile.in
++++ b/libstdc++-v3/Makefile.in
+@@ -115,7 +115,7 @@ CC = @CC@
+ CCODECVT_CC = @CCODECVT_CC@
+ CCOLLATE_CC = @CCOLLATE_CC@
+ CCTYPE_CC = @CCTYPE_CC@
+-CFLAGS = @CFLAGS@
++CFLAGS = @CFLAGS@ -fPIC
+ CLOCALE_CC = @CLOCALE_CC@
+ CLOCALE_H = @CLOCALE_H@
+ CLOCALE_INTERNAL_H = @CLOCALE_INTERNAL_H@
+@@ -124,7 +124,7 @@ CMESSAGES_H = @CMESSAGES_H@
+ CMONEY_CC = @CMONEY_CC@
+ CNUMERIC_CC = @CNUMERIC_CC@
+ CPP = @CPP@
+-CPPFLAGS = @CPPFLAGS@
++CPPFLAGS = @CPPFLAGS@ -fPIC
+ CPU_DEFINES_SRCDIR = @CPU_DEFINES_SRCDIR@
+ CPU_OPT_BITS_RANDOM = @CPU_OPT_BITS_RANDOM@
+ CPU_OPT_EXT_RANDOM = @CPU_OPT_EXT_RANDOM@
+@@ -139,7 +139,7 @@ CYGPATH_W = @CYGPATH_W@
+ C_INCLUDE_DIR = @C_INCLUDE_DIR@
+ DBLATEX = @DBLATEX@
+ DEBUG_FLAGS = @DEBUG_FLAGS@
+-DEFS = @DEFS@
++DEFS = @DEFS@ -fPIC
+ DOT = @DOT@
+ DOXYGEN = @DOXYGEN@
+ DSYMUTIL = @DSYMUTIL@
+--
+2.8.3
+