Remove -ld_classic from all packages (#46608)

This commit is contained in:
Adam J. Stewart 2024-10-05 23:16:16 +02:00 committed by GitHub
parent 7ad08213dc
commit b07d1e0194
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
7 changed files with 2 additions and 26 deletions

View File

@ -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.

View File

@ -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")

View File

@ -315,13 +315,9 @@ def flag_handler(self, name, flags):
cmake_flags.append(self.compiler.cc_pic_flag)
if spec.satisfies("@1.8.21 %oneapi@2023.0.0"):
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

View File

@ -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.

View File

@ -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}"')

View File

@ -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()

View File

@ -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)