Skip to content

Commit

Permalink
Remove -ld_classic from all packages (spack#46608)
Browse files Browse the repository at this point in the history
  • Loading branch information
adamjstewart authored Oct 5, 2024
1 parent 7ad0821 commit b07d1e0
Show file tree
Hide file tree
Showing 7 changed files with 2 additions and 26 deletions.
8 changes: 0 additions & 8 deletions var/spack/repos/builtin/packages/armadillo/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,6 @@ class Armadillo(CMakePackage):
# platform's compiler is adding `#define linux 1`.
patch("undef_linux.patch", when="platform=linux")

def flag_handler(self, name, flags):
spec = self.spec
if name == "ldflags":
if spec.satisfies("%apple-clang@15:"):
flags.append("-Wl,-ld_classic")

return (flags, None, None)

def patch(self):
# Do not include Find{BLAS_type} because we are specifying the
# BLAS/LAPACK libraries explicitly.
Expand Down
1 change: 0 additions & 1 deletion var/spack/repos/builtin/packages/ffmpeg/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,6 @@ def headers(self):

@when("@:6.0 %apple-clang@15:")
def setup_build_environment(self, env):
env.append_flags("LDFLAGS", "-Wl,-ld_classic")
if self.spec.satisfies("@:3"):
env.append_flags("CFLAGS", "-Wno-error=incompatible-function-pointer-types")

Expand Down
4 changes: 0 additions & 4 deletions var/spack/repos/builtin/packages/hdf5/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -315,13 +315,9 @@ def flag_handler(self, name, flags):
cmake_flags.append(self.compiler.cc_pic_flag)
if spec.satisfies("@1.8.21 %[email protected]"):
cmake_flags.append("-Wno-error=int-conversion")
if spec.satisfies("%apple-clang@15:"):
cmake_flags.append("-Wl,-ld_classic")
elif name == "cxxflags":
if spec.satisfies("@:1.8.12+cxx~shared"):
cmake_flags.append(self.compiler.cxx_pic_flag)
if spec.satisfies("%apple-clang@15:"):
cmake_flags.append("-Wl,-ld_classic")
elif name == "fflags":
if spec.satisfies("%cce+fortran"):
# Cray compiler generates module files with uppercase names by
Expand Down
2 changes: 1 addition & 1 deletion var/spack/repos/builtin/packages/openmpi/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -1003,7 +1003,7 @@ def configure_args(self):

# Work around incompatibility with new apple-clang linker
# https://github.com/open-mpi/ompi/issues/12427
if spec.satisfies("@5: %apple-clang@15:"):
if spec.satisfies("@:4.1.6,5.0.0:5.0.3 %apple-clang@15:"):
config_args.append("--with-wrapper-fcflags=-Wl,-ld_classic")

# All rpath flags should be appended with self.compiler.cc_rpath_arg.
Expand Down
5 changes: 1 addition & 4 deletions var/spack/repos/builtin/packages/py-numpy/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -413,10 +413,7 @@ def set_blas_lapack(self):

@when("@1.26:")
def setup_build_environment(self, env):
if self.spec.satisfies("%apple-clang@15:"):
# https://github.com/scipy/scipy/issues/19357
env.append_flags("LDFLAGS", "-Wl,-ld_classic")
elif self.spec.satisfies("%msvc"):
if self.spec.satisfies("%msvc"):
# For meson build system, compiler paths must be in quotes
# to prevent paths from being split by spaces.
env.set("CC", f'"{self.compiler.cc}"')
Expand Down
4 changes: 0 additions & 4 deletions var/spack/repos/builtin/packages/py-scipy/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,10 +218,6 @@ def setup_build_environment(self, env):
if self.spec.satisfies("@:1.8"):
self.spec["py-numpy"].package.setup_build_environment(env)

# https://github.com/scipy/scipy/issues/19357
if self.spec.satisfies("%apple-clang@15:"):
env.append_flags("LDFLAGS", "-Wl,-ld_classic")

@when("@1.9:")
def config_settings(self, spec, prefix):
blas, lapack = self.spec["py-numpy"].package.blas_lapack_pkg_config()
Expand Down
4 changes: 0 additions & 4 deletions var/spack/repos/builtin/packages/py-torch/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -679,10 +679,6 @@ def enable_or_disable(variant, keyword="USE", var=None):
else:
env.set("BUILD_CUSTOM_PROTOBUF", "OFF")

# https://github.com/pytorch/pytorch/issues/111086
if self.spec.satisfies("%apple-clang@15:"):
env.append_flags("LDFLAGS", "-Wl,-ld_classic")

def setup_run_environment(self, env):
self.torch_cuda_arch_list(env)

Expand Down

0 comments on commit b07d1e0

Please sign in to comment.