[MacPorts] #54242: clang-3.8 build fails on 10.5 PPC due to fatal error: lipo: specifed architecture in libclang_rt.10.4.a does not match its cputype -- and workaround that allows build to succeed
MacPorts
noreply at macports.org
Sat May 27 18:06:00 UTC 2017
#54242: clang-3.8 build fails on 10.5 PPC due to fatal error: lipo: specifed
architecture in libclang_rt.10.4.a does not match its cputype -- and
workaround that allows build to succeed
------------------------+----------------------
Reporter: kencu | Owner: jeremyhu
Type: defect | Status: assigned
Priority: Normal | Milestone:
Component: ports | Version:
Resolution: | Keywords: powerpc
Port: clang-3.8 |
------------------------+----------------------
Comment (by kencu):
The cmake logic in this file appears to contain the relevant code:
{{{
work/llvm-3.8.1.src/projects/compiler-rt/cmake/config-ix.cmake
}}}
and checks for the 10.4 RT arches like this:
{{{
# Figure out which arches to use for each OS
darwin_get_toolchain_supported_archs(toolchain_arches)
message(STATUS "Toolchain supported arches: ${toolchain_arches}")
# Need to build a 10.4 compatible libclang_rt
set(DARWIN_10.4_SYSROOT ${DARWIN_osx_SYSROOT})
set(DARWIN_10.4_BUILTIN_MIN_VER 10.4)
set(DARWIN_10.4_BUILTIN_MIN_VER_FLAG
-mmacosx-version-min=${DARWIN_10.4_BUILTIN_MIN_VER})
set(DARWIN_10.4_SKIP_CC_KEXT On)
darwin_test_archs(10.4
DARWIN_10.4_ARCHS
${toolchain_arches})
message(STATUS "OSX 10.4 supported arches: ${DARWIN_10.4_ARCHS}")
if(DARWIN_10.4_ARCHS)
# don't include the Haswell slice in the 10.4 compatibility library
list(REMOVE_ITEM DARWIN_10.4_ARCHS x86_64h)
list(APPEND BUILTIN_SUPPORTED_OS 10.4)
endif()
}}}
which calls darwin_get_toolchain_supported_archs which is in this file
{{{
work/llvm-3.8.1.src/projects/compiler-
rt/cmake/Modules/CompilerRTDarwinUtils.cmake
}}}
{{{
function(darwin_get_toolchain_supported_archs output_var)
execute_process(
COMMAND ld -v
ERROR_VARIABLE LINKER_VERSION)
string(REGEX MATCH "configured to support archs: ([^\n]+)"
ARCHES_MATCHED "${LINKER_VERSION}")
if(ARCHES_MATCHED)
set(ARCHES "${CMAKE_MATCH_1}")
message(STATUS "Got ld supported ARCHES: ${ARCHES}")
string(REPLACE " " ";" ARCHES ${ARCHES})
else()
# If auto-detecting fails, fall back to a default set
message(WARNING "Detecting supported architectures from 'ld -v'
failed. Returning default set.")
set(ARCHES "i386;x86_64;armv7;armv7s;arm64")
endif()
set(${output_var} ${ARCHES} PARENT_SCOPE)
endfunction()
}}}
on 10.5 INTEL the `ld` test gives you proper archs:
{{{
ld -v
@(#)PROGRAM:ld PROJECT:ld64-127.2
configured to support archs: i386 x86_64 ppc ppc64 armv6 armv7
LTO support using: LLVM version 3.3
}}}
but on on 10.5 PPC you get this:
{{{
$ ld -v
@(#)PROGRAM:ld PROJECT:ld64-127.2
LLVM version 3.3
}}}
so it goes to the defaults instead
{{{
set(ARCHES "i386;x86_64;armv7;armv7s;arm64")
}}}
which are wrong for ppc. I generated a simple patch to allowed that test
to return:
{{{
set(ARCHES "i386;x86_64;ppc;ppc64;armv7;armv7s;arm64")
}}}
and I had hoped that might solve this error, but as you can see from the
configuration listing above, even though it now returns the proper ARCHES
from the `ld` test, the error still occurs, so the incorrect arch setting
must be elsewhere.
--
Ticket URL: <https://trac.macports.org/ticket/54242#comment:3>
MacPorts <https://www.macports.org/>
Ports system for macOS
More information about the macports-tickets
mailing list