diff --git a/var/spack/repos/builtin/packages/gcc/package.py b/var/spack/repos/builtin/packages/gcc/package.py index 431fcaa9da5..2f6d12144aa 100644 --- a/var/spack/repos/builtin/packages/gcc/package.py +++ b/var/spack/repos/builtin/packages/gcc/package.py @@ -303,15 +303,9 @@ def configure_args(self): # Binutils if spec.satisfies('+binutils'): - stage1_ldflags = str(self.rpath_args) - boot_ldflags = stage1_ldflags + ' -static-libstdc++ -static-libgcc' - if '%gcc' in spec: - stage1_ldflags = boot_ldflags binutils = spec['binutils'].prefix.bin options.extend([ '--with-sysroot=/', - '--with-stage1-ldflags=' + stage1_ldflags, - '--with-boot-ldflags=' + boot_ldflags, '--with-gnu-ld', '--with-ld=' + binutils.ld, '--with-gnu-as', @@ -344,6 +338,14 @@ def configure_args(self): '--with-libiconv-prefix={0}'.format(spec['libiconv'].prefix) ]) + # enable appropriate bootstrapping flags + stage1_ldflags = str(self.rpath_args) + boot_ldflags = stage1_ldflags + ' -static-libstdc++ -static-libgcc' + if '%gcc' in spec: + stage1_ldflags = boot_ldflags + options.append('--with-stage1-ldflags=' + stage1_ldflags) + options.append('--with-boot-ldflags=' + boot_ldflags) + return options # run configure/make/make(install) for the nvptx-none target