[PATCH] D16043: Ensure -mcpu=xscale works for arm targets

Dimitry Andric via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 11 08:06:29 PST 2016


dim added a comment.

In http://reviews.llvm.org/D16043#323549, @rengolin wrote:

> Sorry, can you describe the problem and how does this fix?


I think this is fallout from either http://reviews.llvm.org/D14577 or http://reviews.llvm.org/D14578.  The problem is that with `-target arm-freebsd` (or `arm-linux`, for that matter), the `-mcpu=xscale` option is no longer accepted.  E.g. with clang 3.7.1:

  $ ~/obj/llvm-255217M-fin371-freebsd11-i386-aconf-rel-1/Release+Asserts/bin/clang -target arm-freebsd -mcpu=xscale -c -x c /dev/null -###
  clang version 3.7.1 (tags/RELEASE_371/final 255217)
  Target: arm--freebsd
  Thread model: posix
   "/home/dim/obj/llvm-255217M-fin371-freebsd11-i386-aconf-rel-1/Release+Asserts/bin/clang" "-cc1" "-triple" "armv5e--freebsd" "-emit-obj" "-mrelax-all" "-disable-free" "-main-file-name" "null" "-mrelocation-model" "static" "-mthread-model" "posix" "-mdisable-fp-elim" "-masm-verbose" "-mconstructor-aliases" "-target-cpu" "xscale" "-target-feature" "+soft-float" "-target-feature" "+soft-float-abi" "-target-feature" "-neon" "-target-feature" "-crypto" "-target-abi" "aapcs" "-msoft-float" "-mfloat-abi" "soft" "-target-linker-version" "2.25.1" "-dwarf-column-info" "-coverage-file" "/home/dim/null" "-resource-dir" "/home/dim/obj/llvm-255217M-fin371-freebsd11-i386-aconf-rel-1/Release+Asserts/bin/../lib/clang/3.7.1" "-fdebug-compilation-dir" "/home/dim" "-ferror-limit" "19" "-fmessage-length" "114" "-mstackrealign" "-fno-signed-char" "-fobjc-runtime=gnustep" "-fsjlj-exceptions" "-fdiagnostics-show-option" "-fcolor-diagnostics" "-o" "null.o" "-x" "c" "/dev/null"

and with clang 3.8.0:

  $ ~/obj/llvm-256945-trunk-freebsd11-i386-ninja-rel-1/bin/clang -target arm-freebsd -mcpu=xscale -c -x c /dev/null -###
  clang version 3.8.0 (trunk 256945)
  Target: arm--freebsd
  Thread model: posix
  InstalledDir: /home/dim/obj/llvm-256945-trunk-freebsd11-i386-ninja-rel-1/bin
  clang-3.8: error: the clang compiler does not support '-mcpu=xscale'
   "/home/dim/obj/llvm-256945-trunk-freebsd11-i386-ninja-rel-1/bin/clang-3.8" "-cc1" "-triple" "arm--freebsd" "-emit-obj" "-mrelax-all" "-disable-free" "-main-file-name" "null" "-mrelocation-model" "static" "-mthread-model" "posix" "-mdisable-fp-elim" "-masm-verbose" "-mconstructor-aliases" "-target-cpu" "xscale" "-target-feature" "+soft-float" "-target-feature" "+soft-float-abi" "-target-feature" "-neon" "-target-feature" "-crypto" "-target-feature" "+strict-align" "-target-abi" "aapcs" "-msoft-float" "-mfloat-abi" "soft" "-dwarf-column-info" "-debugger-tuning=gdb" "-coverage-file" "/home/dim/null" "-resource-dir" "/home/dim/obj/llvm-256945-trunk-freebsd11-i386-ninja-rel-1/bin/../lib/clang/3.8.0" "-fdebug-compilation-dir" "/home/dim" "-ferror-limit" "19" "-fmessage-length" "114" "-fallow-half-arguments-and-returns" "-fno-signed-char" "-fobjc-runtime=gnustep" "-fsjlj-exceptions" "-fdiagnostics-show-option" "-fcolor-diagnostics" "-o" "null.o" "-x" "c" "/dev/null"

> This seems like a Clang bug too (not parsing the correct cpu flag?), so a test in Clang would also be necessary to show that it's now passing.


Yes, I'll add a test.  The problem is that clang still returns 0 in the second case above, so it'll have to be tested by grepping for the `the clang compiler does not support` output line...


http://reviews.llvm.org/D16043





More information about the llvm-commits mailing list