conan-center-index: autotools builds not working on apple silicon native

Package and Environment Details (include every applicable attribute)

  • Operating System+version: macos 11.0.1
  • Compiler+version: apple clang
  • Conan version: conan 1.32.1
  • Python version: Python 3.8.2

Conan profile (output of conan profile show default or conan profile show <profile> if custom profile is in use)

[settings]
os=Macos
os_build=Macos
arch=armv8
arch_build=armv8
compiler=apple-clang
compiler.version=12.0
compiler.libcxx=libc++
build_type=Release
[options]
[build_requires]
[env]

Steps to reproduce (Include if Applicable)

require any library built with autotools, like libjpeg, yasm, iconv…

Logs (Include/Attach if Applicable)

Click to expand log
yasm/1.3.0: 
yasm/1.3.0: WARN: Package binary is corrupted, removing: 3eb32b976fb0626f3c40a8b87ace72156aa44204
yasm/1.3.0: WARN: Build folder is dirty, removing it: /Users/daniel/.conan/data/yasm/1.3.0/_/_/build/3eb32b976fb0626f3c40a8b87ace72156aa44204
yasm/1.3.0: ERROR: Package '3eb32b976fb0626f3c40a8b87ace72156aa44204' build failed
yasm/1.3.0: WARN: Build folder /Users/daniel/.conan/data/yasm/1.3.0/_/_/build/3eb32b976fb0626f3c40a8b87ace72156aa44204
ERROR: yasm/1.3.0: Error in build() method, line 67
	autotools = self._configure_autotools()
while calling '_configure_autotools', line 60
	self._autotools.configure(args=conf_args, configure_dir=self._source_subfolder)
	ConanException: Error 77 while executing source_subfolder/configure '--enable-debug=no' '--disable-rpath' '--disable-nls' '--prefix=/Users/daniel/.conan/data/yasm/1.3.0/_/_/package/3eb32b976fb0626f3c40a8b87ace72156aa44204' '--bindir=${prefix}/bin' '--sbindir=${prefix}/bin' '--libexecdir=${prefix}/bin' '--libdir=${prefix}/lib' '--includedir=${prefix}/include' '--oldincludedir=${prefix}/include' '--datarootdir=${prefix}/share' --build=x86_64-apple-darwin --host=aarch64-apple-darwin

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 25 (25 by maintainers)

Most upvoted comments

I would say, to spot the problem you need to look into the whole configure part, not just one line

   def _configure_autotools(self):
        if self._autotools:
            return self._autotools
        self._autotools = AutoToolsBuildEnvironment(self, win_bash=tools.os_info.is_windows)
        yes_no = lambda v: "yes" if v else "no"
        config_args = [
            "--enable-debug={}".format(yes_no(self.settings.build_type == "Debug")),
            "--enable-shared={}".format(yes_no(self.options.shared)),
            "--enable-static={}".format(yes_no(not self.options.shared)),
        ]
        self._autotools.defines.append("FFI_BUILDING")
        if self.options.shared:
            self._autotools.defines.append("FFI_BUILDING_DLL")
        if self.settings.compiler == "Visual Studio":
            if "MT" in str(self.settings.compiler.runtime):
                self._autotools.defines.append("USE_STATIC_RTL")
            if "d" in str(self.settings.compiler.runtime):
                self._autotools.defines.append("USE_DEBUG_RTL")
        build = None
        host = None
        if self.settings.compiler == "Visual Studio":
            build = "{}-{}-{}".format(
                "x86_64" if "64" in platform.machine() else "i686",
                "pc" if self.settings.arch == "x86" else "w64",
                "cygwin")
            host = "{}-{}-{}".format(
                "x86_64" if self.settings.arch == "x86_64" else "i686",
                "pc" if self.settings.arch == "x86" else "w64",
                "cygwin")
        else:
            if self._autotools.host and "x86-" in self._autotools.host:
                self._autotools.host = self._autotools.host.replace("x86", "i686")
        self._autotools.configure(args=config_args, configure_dir=self._source_subfolder, build=build, host=host)
        return self._autotools

because there are packages building with autotools on M1 (have libcurl for example)

my guess: the else part from if self.settings.compiler == "Visual Studio": looks a little bit hardcoded to one architecture

so I do not think that the general statement, that autotools builds not working, can be made