[MacPorts] #65153: nss fails to build for x86_64 on 10.6.8 when forcing the build to use gcc11 instead of the default clang compiler: no such instruction: `pclmulqdq $16, %xmm2, %xmm0'
MacPorts
noreply at macports.org
Tue May 10 16:57:33 UTC 2022
#65153: nss fails to build for x86_64 on 10.6.8 when forcing the build to use gcc11
instead of the default clang compiler: no such instruction: `pclmulqdq $16,
%xmm2,%xmm0'
-------------------------+-------------------------------------------------
Reporter: | Owner: (none)
barracuda156 |
Type: defect | Status: new
Priority: Normal | Milestone:
Component: ports | Version: 2.7.2
Resolution: | Keywords: x86_64, snowleopard,
Port: nss | nonstandard_build
-------------------------+-------------------------------------------------
Comment (by kencu):
Replying to [comment:14 mouse07410]:
> In my experience, Clang requires flags {{{-maesni -mpcmul}}} for code
like this.
I haven't needed that, but we can explore some examples to prove or
disprove the point on godbolt.org if you like.
> GCC, in addition to that, requires a different assembler, like env
variable {{{AS_INTEGRATED_ASSEMBLER=1}}} and {{{CFLAGS += -Wa,-q
-Wa,-march=native}}}
Those things used to be needed to force the standard cctools assembler to
send the code to clang to assemble, but those are no longer needed for the
past several years in MacPorts when our MacPorts cctools assembler was
changed to "do the right thing" by default.
See this port of the cctools Portfile for our modifications that makes
this not needed for MacPorts:
{{{
# List of clang versions to search for at runtime internally by 'as'
# Build list from llvm variants, excluding clang < 5 and
devel version
# (unless devel variant is used in which case it is
included first)
set as_comps ""
foreach variantname ${all_llvm_variants} {
set ver $llvm_variant_version($variantname)
# Use all non-devel and clang > 4 versions
if { ${ver} ne "devel" && ${ver} > 4.999 } {
if { ${as_comps} ne "" } {
set as_comps ",${as_comps}"
}
set as_comps "\"clang-mp-${ver}\"${as_comps}"
}
}
# If llvmdev variant is active, include at start of list
if {[variant_isset llvmdev]} {
set as_comps "\"clang-mp-devel\",${as_comps}"
}
ui_debug "as compiler list ${as_comps}"
reinplace "s:__MP_CLANG_NAMES__:${as_comps}:"
${worksrcpath}/as/driver.c
if {${os.major} >= 11} {
set try_system_clang 1
} else {
# clang's integrated assembler may not work well on
10.6 and doesn't
# exist on older OS versions.
set try_system_clang 0
}
reinplace "s:__TRY_SYSTEM_CLANG__:${try_system_clang}:"
${worksrcpath}/as/driver.c
}}}
--
Ticket URL: <https://trac.macports.org/ticket/65153#comment:15>
MacPorts <https://www.macports.org/>
Ports system for macOS
More information about the macports-tickets
mailing list