-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
compiler_rt not respecting the CPU features on cross-compile #16957
Labels
Milestone
Comments
aka-mj
added
the
bug
Observed behavior contradicts documented or intended behavior
label
Aug 25, 2023
with #16981 the following output shows compiler_rt uses the same cpu features: stage4/bin/zig build-exe foo.zig -target arm-linux-gnueabihf -mcpu cortex_a5-neon --verbose-llvm-cpu-features
compilation: foo
target: arm-linux.3.16...5.10.81-gnueabihf.2.19
cpu: cortex_a5
features: -32bit,-8msecext,-a76,-aapcs-frame-chain,-aapcs-frame-chain-leaf,+aclass,-acquire-release,-aes,-atomics-32,-avoid-movs-shop,-avoid-partial-cpsr,-bf16,-big-endian-instructions,-cde,-cdecp0,-cdecp1,-cdecp2,-cdecp3,-cdecp4,-cdecp5,-cdecp6,-cdecp7,-cheap-predicable-cpsr,-clrbhb,-crc,-crypto,+d32,+db,-dfb,-disable-postra-scheduler,-dont-widen-vmovs,-dotprod,+dsp,-execute-only,-expand-fp-mlx,-exynos,-fix-cmse-cve-2021-35465,-fix-cortex-a57-aes-1742098,+fp16,-fp16fml,+fp64,-fp-armv8,-fp-armv8d16,-fp-armv8d16sp,-fp-armv8sp,-fpao,+fpregs,-fpregs16,+fpregs64,-fullfp16,-fuse-aes,-fuse-literals,-harden-sls-blr,-harden-sls-nocomdat,-harden-sls-retbr,+v4t,+v5t,+v5te,+v6,+v6k,+v6m,+v6t2,+v7,+v7clrex,-v8,-v8.1a,-v8.1m.main,-v8.2a,-v8.3a,-v8.4a,-v8.5a,-v8.6a,-v8.7a,-v8.8a,-v8.9a,+v8m,-v8m.main,-v9.1a,-v9.2a,-v9.3a,-v9.4a,-v9a,-hwdiv,-hwdiv-arm,-i8mm,-iwmmxt,-iwmmxt2,-lob,-long-calls,-loop-align,-m3,-mclass,+mp,-muxed-units,-mve,-mve1beat,-mve2beat,-mve4beat,-mve.fp,-nacl-trap,-neon,-neon-fpmovs,-neonfp,-no-branch-predictor,-no-bti-at-return-twice,-no-movt,-no-neg-immediates,-noarm,-nonpipelined-vfp,-pacbti,+perfmon,-prefer-ishst,-prefer-vmovsr,-prof-unpr,-r4,-ras,-rclass,-read-tp-hard,-reserve-r9,+ret-addr-stack,-sb,-sha2,+slow-fp-brcc,-slow-load-D-subreg,-slow-odd-reg,-slow-vdup32,-slow-vgetlni32,+slowfpvfmx,+slowfpvmlx,-soft-float,-splat-vfp-neon,-strict-align,-swift,+thumb2,-thumb-mode,+trustzone,-use-mipipeliner,-use-misched,-armv4,-armv4t,-armv5t,-armv5te,-armv5tej,-armv6,-armv6j,-armv6k,-armv6kz,-armv6-m,-armv6s-m,-armv6t2,+armv7-a,-armv7e-m,-armv7k,-armv7-m,-armv7-r,-armv7s,-armv7ve,-armv8.1-a,-armv8.1-m.main,-armv8.2-a,-armv8.3-a,-armv8.4-a,-armv8.5-a,-armv8.6-a,-armv8.7-a,-armv8.8-a,-armv8.9-a,-armv8-a,-armv8-m.base,-armv8-m.main,-armv8-r,-armv9.1-a,-armv9.2-a,-armv9.3-a,-armv9.4-a,-armv9-a,+vfp2,+vfp2sp,+vfp3,+vfp3d16,+vfp3d16sp,+vfp3sp,+vfp4,+vfp4d16,+vfp4d16sp,+vfp4sp,-virtualization,-vldn-align,+vmlx-forwarding,-vmlx-hazards,-wide-stride-vfp,-xscale,-zcz
compilation: c
target: arm-linux.3.16...5.10.81-gnueabihf.2.19
cpu: cortex_a5
features: -32bit,-8msecext,-a76,-aapcs-frame-chain,-aapcs-frame-chain-leaf,+aclass,-acquire-release,-aes,-atomics-32,-avoid-movs-shop,-avoid-partial-cpsr,-bf16,-big-endian-instructions,-cde,-cdecp0,-cdecp1,-cdecp2,-cdecp3,-cdecp4,-cdecp5,-cdecp6,-cdecp7,-cheap-predicable-cpsr,-clrbhb,-crc,-crypto,+d32,+db,-dfb,-disable-postra-scheduler,-dont-widen-vmovs,-dotprod,+dsp,-execute-only,-expand-fp-mlx,-exynos,-fix-cmse-cve-2021-35465,-fix-cortex-a57-aes-1742098,+fp16,-fp16fml,+fp64,-fp-armv8,-fp-armv8d16,-fp-armv8d16sp,-fp-armv8sp,-fpao,+fpregs,-fpregs16,+fpregs64,-fullfp16,-fuse-aes,-fuse-literals,-harden-sls-blr,-harden-sls-nocomdat,-harden-sls-retbr,+v4t,+v5t,+v5te,+v6,+v6k,+v6m,+v6t2,+v7,+v7clrex,-v8,-v8.1a,-v8.1m.main,-v8.2a,-v8.3a,-v8.4a,-v8.5a,-v8.6a,-v8.7a,-v8.8a,-v8.9a,+v8m,-v8m.main,-v9.1a,-v9.2a,-v9.3a,-v9.4a,-v9a,-hwdiv,-hwdiv-arm,-i8mm,-iwmmxt,-iwmmxt2,-lob,-long-calls,-loop-align,-m3,-mclass,+mp,-muxed-units,-mve,-mve1beat,-mve2beat,-mve4beat,-mve.fp,-nacl-trap,-neon,-neon-fpmovs,-neonfp,-no-branch-predictor,-no-bti-at-return-twice,-no-movt,-no-neg-immediates,-noarm,-nonpipelined-vfp,-pacbti,+perfmon,-prefer-ishst,-prefer-vmovsr,-prof-unpr,-r4,-ras,-rclass,-read-tp-hard,-reserve-r9,+ret-addr-stack,-sb,-sha2,+slow-fp-brcc,-slow-load-D-subreg,-slow-odd-reg,-slow-vdup32,-slow-vgetlni32,+slowfpvfmx,+slowfpvmlx,-soft-float,-splat-vfp-neon,-strict-align,-swift,+thumb2,-thumb-mode,+trustzone,-use-mipipeliner,-use-misched,-armv4,-armv4t,-armv5t,-armv5te,-armv5tej,-armv6,-armv6j,-armv6k,-armv6kz,-armv6-m,-armv6s-m,-armv6t2,+armv7-a,-armv7e-m,-armv7k,-armv7-m,-armv7-r,-armv7s,-armv7ve,-armv8.1-a,-armv8.1-m.main,-armv8.2-a,-armv8.3-a,-armv8.4-a,-armv8.5-a,-armv8.6-a,-armv8.7-a,-armv8.8-a,-armv8.9-a,-armv8-a,-armv8-m.base,-armv8-m.main,-armv8-r,-armv9.1-a,-armv9.2-a,-armv9.3-a,-armv9.4-a,-armv9-a,+vfp2,+vfp2sp,+vfp3,+vfp3d16,+vfp3d16sp,+vfp3sp,+vfp4,+vfp4d16,+vfp4d16sp,+vfp4sp,-virtualization,-vldn-align,+vmlx-forwarding,-vmlx-hazards,-wide-stride-vfp,-xscale,-zcz
compilation: compiler_rt
target: arm-linux.3.16...5.10.81-gnueabihf.2.19
cpu: cortex_a5
features: -32bit,-8msecext,-a76,-aapcs-frame-chain,-aapcs-frame-chain-leaf,+aclass,-acquire-release,-aes,-atomics-32,-avoid-movs-shop,-avoid-partial-cpsr,-bf16,-big-endian-instructions,-cde,-cdecp0,-cdecp1,-cdecp2,-cdecp3,-cdecp4,-cdecp5,-cdecp6,-cdecp7,-cheap-predicable-cpsr,-clrbhb,-crc,-crypto,+d32,+db,-dfb,-disable-postra-scheduler,-dont-widen-vmovs,-dotprod,+dsp,-execute-only,-expand-fp-mlx,-exynos,-fix-cmse-cve-2021-35465,-fix-cortex-a57-aes-1742098,+fp16,-fp16fml,+fp64,-fp-armv8,-fp-armv8d16,-fp-armv8d16sp,-fp-armv8sp,-fpao,+fpregs,-fpregs16,+fpregs64,-fullfp16,-fuse-aes,-fuse-literals,-harden-sls-blr,-harden-sls-nocomdat,-harden-sls-retbr,+v4t,+v5t,+v5te,+v6,+v6k,+v6m,+v6t2,+v7,+v7clrex,-v8,-v8.1a,-v8.1m.main,-v8.2a,-v8.3a,-v8.4a,-v8.5a,-v8.6a,-v8.7a,-v8.8a,-v8.9a,+v8m,-v8m.main,-v9.1a,-v9.2a,-v9.3a,-v9.4a,-v9a,-hwdiv,-hwdiv-arm,-i8mm,-iwmmxt,-iwmmxt2,-lob,-long-calls,-loop-align,-m3,-mclass,+mp,-muxed-units,-mve,-mve1beat,-mve2beat,-mve4beat,-mve.fp,-nacl-trap,-neon,-neon-fpmovs,-neonfp,-no-branch-predictor,-no-bti-at-return-twice,-no-movt,-no-neg-immediates,-noarm,-nonpipelined-vfp,-pacbti,+perfmon,-prefer-ishst,-prefer-vmovsr,-prof-unpr,-r4,-ras,-rclass,-read-tp-hard,-reserve-r9,+ret-addr-stack,-sb,-sha2,+slow-fp-brcc,-slow-load-D-subreg,-slow-odd-reg,-slow-vdup32,-slow-vgetlni32,+slowfpvfmx,+slowfpvmlx,-soft-float,-splat-vfp-neon,-strict-align,-swift,+thumb2,-thumb-mode,+trustzone,-use-mipipeliner,-use-misched,-armv4,-armv4t,-armv5t,-armv5te,-armv5tej,-armv6,-armv6j,-armv6k,-armv6kz,-armv6-m,-armv6s-m,-armv6t2,+armv7-a,-armv7e-m,-armv7k,-armv7-m,-armv7-r,-armv7s,-armv7ve,-armv8.1-a,-armv8.1-m.main,-armv8.2-a,-armv8.3-a,-armv8.4-a,-armv8.5-a,-armv8.6-a,-armv8.7-a,-armv8.8-a,-armv8.9-a,-armv8-a,-armv8-m.base,-armv8-m.main,-armv8-r,-armv9.1-a,-armv9.2-a,-armv9.3-a,-armv9.4-a,-armv9-a,+vfp2,+vfp2sp,+vfp3,+vfp3d16,+vfp3d16sp,+vfp3sp,+vfp4,+vfp4d16,+vfp4d16sp,+vfp4sp,-virtualization,-vldn-align,+vmlx-forwarding,-vmlx-hazards,-wide-stride-vfp,-xscale,-zcz |
#13303 aside, the fact that our compiler-rt |
❯ zig4 build-exe main.zig -target arm-linux-gnueabihf -mcpu cortex_a5-neon -fcompiler-rt
❯ objdump main --disassemble=memset | grep vdup
f27b0: eee01b90 vdup.8 q8, r1
❯ zig4 build-obj main.zig -target arm-linux-gnueabihf -mcpu cortex_a5-neon -fcompiler-rt
❯ zig4 build-exe main.o -target arm-linux-gnueabihf -mcpu cortex_a5-neon
❯ objdump main --disassemble=memset | grep vdup
❯ zig4 build-obj main.zig -target arm-linux-gnueabihf -mcpu cortex_a5-neon
❯ zig4 build-exe main.o -target arm-linux-gnueabihf -mcpu cortex_a5-neon -fcompiler-rt
❯ objdump main --disassemble=memset | grep vdup
f27b0: eee01b90 vdup.8 q8, r1 Fairly odd. |
This was fixed by #21501. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Zig Version
0.12.0-dev.47+0461a64a9
Steps to Reproduce and Observed Behavior
Can find initial troubleshooting here:
https://ziggit.dev/t/cross-compile-zig-fails-on-target-with-illegal-instruction/1505
Create project and build for target
… copy to target and run …
Looking at the coredump shows the issue is with memset, that a NEON instruction was included even though it should be excluded.
Andrew mentions this may be related to #13303.
Expected Behavior
Some output to the console from the default initial project.
The text was updated successfully, but these errors were encountered: