Repository: spack/spack

Issue:
Issue while building openspeedshop  (older version of binutils?)
I am trying to build openspeedshop on Ubuntu 16.04 and I see following (while building cbtf-krell) : 

```
.............
  /home/guest/workarena/softwares/sources/spack/opt/spack/linux-ubuntu16-x86_64/gcc-5.4.1/binutils-2.24-dk6wlwesfajvuudbqzutq3fkx5kubp5t/bin/ld:
  final link failed: Bad value

  collect2: error: ld returned 1 exit status

  CMakeFiles/cmTC_91ae1.dir/build.make:97: recipe for target 'cmTC_91ae1'
  failed
  make[1]: *** [cmTC_91ae1] Error 1

  make[1]: Leaving directory
  '/tmp/guest/spack-stage/spack-stage-Wky2l2/cbtf-krell/build_cbtf_krell/CMakeFiles/CMakeTmp'
  Makefile:126: recipe for target 'cmTC_91ae1/fast' failed

  make: *** [cmTC_91ae1/fast] Error 2
  CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
  CMakeLists.txt:21 (project)

-- Configuring incomplete, errors occurred!

```

If I look into `CMakeFiles/CMakeError.log` I see:

```
/home/guest/workarena/softwares/sources/spack/lib/spack/env/gcc/gcc  -O2 -g     CMakeFiles/cmTC_91ae1.dir/testCCompiler.c.o  -o cmTC_91ae1 -rdynamic
/home/guest/workarena/softwares/sources/spack/opt/spack/linux-ubuntu16-x86_64/gcc-5.4.1/binutils-2.24-dk6wlwesfajvuudbqzutq3fkx5kubp5t/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/crti.o: unrecognized relocation (0x2a) in section `.init'
/home/guest/workarena/softwares/sources/spack/opt/spack/linux-ubuntu16-x86_64/gcc-5.4.1/binutils-2.24-dk6wlwesfajvuudbqzutq3fkx5kubp5t/bin/ld: final link failed: Bad value
```

@jgalarowicz : Is this due to old version of binutils that openspeedshop depends on ?

```
depends_on("binutils@2.24+krellpatch", type='build')
```


Discussion:
@pramodskumbhar I'm not sure.  I will take a look.  We should not need to depend on the old version of binutils now.   I recently put a patch into the openspeedshop and cbtf-krell to eliminate that dependency.  You can try changing it by taking off the 2.24 and krellpatch phrases.

Resolving patch:
diff --git a/var/spack/repos/builtin/packages/binutils/package.py b/var/spack/repos/builtin/packages/binutils/package.py
--- a/var/spack/repos/builtin/packages/binutils/package.py
+++ b/var/spack/repos/builtin/packages/binutils/package.py
@@ -39,16 +39,11 @@ class Binutils(AutotoolsPackage):
     version('2.23.2', '4f8fa651e35ef262edc01d60fb45702e')
     version('2.20.1', '2b9dc8f2b7dbd5ec5992c6e29de0b764')
 
-    # Add a patch that creates binutils libiberty_pic.a which is preferred by
-    # OpenSpeedShop and cbtf-krell
-    variant('krellpatch', default=False,
-            description="build with openspeedshop based patch.")
     variant('plugins', default=False,
             description="enable plugins, needed for gold linker")
     variant('gold', default=True, description="build the gold linker")
     variant('libiberty', default=False, description='Also install libiberty.')
 
-    patch('binutilskrell-2.24.patch', when='@2.24+krellpatch')
     patch('cr16.patch')
     patch('update_symbol-2.26.patch', when='@2.26')
 
diff --git a/var/spack/repos/builtin/packages/cbtf-krell/package.py b/var/spack/repos/builtin/packages/cbtf-krell/package.py
--- a/var/spack/repos/builtin/packages/cbtf-krell/package.py
+++ b/var/spack/repos/builtin/packages/cbtf-krell/package.py
@@ -75,7 +75,7 @@ class CbtfKrell(CMakePackage):
     depends_on("cmake@3.0.2:", type='build')
 
     # For binutils service
-    depends_on("binutils@2.24+krellpatch")
+    depends_on("binutils")
 
     # collectionTool
     depends_on("boost@1.50.0:1.59.0")
diff --git a/var/spack/repos/builtin/packages/openspeedshop/package.py b/var/spack/repos/builtin/packages/openspeedshop/package.py
--- a/var/spack/repos/builtin/packages/openspeedshop/package.py
+++ b/var/spack/repos/builtin/packages/openspeedshop/package.py
@@ -78,7 +78,7 @@ class Openspeedshop(CMakePackage):
     variant('cuda', default=False,
             description="build with cuda packages included.")
 
-    variant('gui', default='qt3', values=('none', 'qt3', 'qt4'), 
+    variant('gui', default='qt3', values=('none', 'qt3', 'qt4'),
             description='Build or not build a GUI of choice'
     )
 
@@ -111,7 +111,7 @@ class Openspeedshop(CMakePackage):
     depends_on("libtool", type='build')
     depends_on("bison", type='build')
     depends_on("flex", type='build')
-    depends_on("binutils@2.24+krellpatch", type='build')
+    depends_on("binutils", type='build')
     depends_on("elf", type="link")
     depends_on("libdwarf")
     depends_on("sqlite")


Test patch: