aganea added a comment.

When using `clang-cl`, this code should set it to the right format, on any 
platform: 
https://github.com/llvm/llvm-project/blob/master/clang/lib/Driver/Driver.cpp#L1071
However maybe something else happens on big endian architectures?

@uweigand Would you mind running the first `clang-cl` command with -### see 
what target is being used? This is what I'm seeing on my Ubuntu machine. Note 
the `x86_64-pc-windows-msvc19.11.0` triple. If using plain `clang -c b.cpp` 
then `x86_64-unknown-linux-gnu` is used instead.

  aganea@PC:/mnt/f/llvm-project$ cat b.cpp
  int A;
  int foo() {
    return A * 20;
  }
  int main() {
    return foo();
  }
  aganea@PC:/mnt/f/llvm-project$ ./buildclang9/bin/clang-cl /c b.cpp -###
  clang version 11.0.0 (https://github.com/llvm/llvm-project.git 
bfdb834bc3d5e948002e5061a4c50d5c9a97de59)
  Target: x86_64-pc-windows-msvc
  Thread model: posix
  InstalledDir: /mnt/f/llvm-project/./buildclang9/bin
   (in-process)
   "/mnt/f/llvm-project/buildclang9/bin/clang-11" "-cc1" "-triple" 
"x86_64-pc-windows-msvc19.11.0" "-emit-obj" "-mrelax-all" 
"-mincremental-linker-compatible" "-disable-free" "-main-file-name" "b.cpp" 
"-mrelocation-model" "pic" "-pic-level" "2" "-mthread-model" "posix" 
"-mframe-pointer=none" "-relaxed-aliasing" "-fmath-errno" "-fno-rounding-math" 
"-masm-verbose" "-mconstructor-aliases" "-munwind-tables" "-target-cpu" 
"x86-64" "-mllvm" "-x86-asm-syntax=intel" "-D_MT" "-flto-visibility-public-std" 
"--dependent-lib=libcmt" "--dependent-lib=oldnames" "-stack-protector" "2" 
"-fms-volatile" "-fdiagnostics-format" "msvc" "-dwarf-column-info" 
"-resource-dir" "/mnt/f/llvm-project/buildclang9/lib/clang/11.0.0" 
"-internal-isystem" "/mnt/f/llvm-project/buildclang9/lib/clang/11.0.0/include" 
"-fdeprecated-macro" "-fdebug-compilation-dir" "/mnt/f/llvm-project" 
"-ferror-limit" "19" "-fmessage-length" "0" "-fno-use-cxa-atexit" 
"-fms-extensions" "-fms-compatibility" "-fms-compatibility-version=19.11" 
"-std=c++14" "-fdelayed-template-parsing" "-fobjc-runtime=gcc" 
"-fdiagnostics-show-option" "-fcolor-diagnostics" "-faddrsig" "-o" "b.obj" "-x" 
"c++" "b.cpp"


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D80833/new/

https://reviews.llvm.org/D80833



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to