[PATCH] D126192: [Driver] Improve linking options for target AVR

Haowei Wu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jun 14 18:34:40 PDT 2022


haowei added a comment.

Emmm, I applied your latest patch on top of main(6e02e27536b9de25a651cfc9c2966ce471169355 <https://reviews.llvm.org/rG6e02e27536b9de25a651cfc9c2966ce471169355>) but I still get a test failure on `Clang :: Driver/avr-toolchain.c`.

`Clang :: Driver/avr-ld.c` no longer fail.
Error message:

  FAIL: Clang :: Driver/avr-toolchain.c (7349 of 16540)
  ******************** TEST 'Clang :: Driver/avr-toolchain.c' FAILED ********************
  Script:
  --
  : 'RUN: at line 4';   /mnt/nvme_sec/SRC/llvm-project/build-revert-test/bin/clang -### /mnt/nvme_sec/SRC/llvm-project/clang/test/Driver/avr-toolchain.c --target=avr --sysroot=/mnt/nvme_sec/SRC/llvm-project/clang/test/Driver/Inputs/basic_avr_tree
  -resource-dir=/mnt/nvme_sec/SRC/llvm-project/clang/test/Driver/Inputs/resource_dir 2>&1 | /mnt/nvme_sec/SRC/llvm-project/build-revert-test/bin/FileCheck --check-prefix=CHECK1 /mnt/nvme_sec/SRC/llvm-project/clang/test/Driver/avr-toolchain.c
  : 'RUN: at line 15';   /mnt/nvme_sec/SRC/llvm-project/build-revert-test/bin/clang -### /mnt/nvme_sec/SRC/llvm-project/clang/test/Driver/avr-toolchain.c --target=avr --sysroot=/mnt/nvme_sec/SRC/llvm-project/clang/test/Driver/Inputs/basic_avr_tree
  _2/opt/local -S 2>&1 | /mnt/nvme_sec/SRC/llvm-project/build-revert-test/bin/FileCheck --check-prefix=CHECK2 /mnt/nvme_sec/SRC/llvm-project/clang/test/Driver/avr-toolchain.c
  : 'RUN: at line 21';   /mnt/nvme_sec/SRC/llvm-project/build-revert-test/bin/clang -### /mnt/nvme_sec/SRC/llvm-project/clang/test/Driver/avr-toolchain.c --target=avr --sysroot=/mnt/nvme_sec/SRC/llvm-project/clang/test/Driver/Inputs/basic_avr_tree
  _2 -S 2>&1 | /mnt/nvme_sec/SRC/llvm-project/build-revert-test/bin/FileCheck --check-prefix=CHECK3 /mnt/nvme_sec/SRC/llvm-project/clang/test/Driver/avr-toolchain.c
  : 'RUN: at line 27';   /mnt/nvme_sec/SRC/llvm-project/build-revert-test/bin/clang -### /mnt/nvme_sec/SRC/llvm-project/clang/test/Driver/avr-toolchain.c --target=avr 2>&1 | /mnt/nvme_sec/SRC/llvm-project/build-revert-test/bin/FileCheck -check-pre
  fix=CC1 /mnt/nvme_sec/SRC/llvm-project/clang/test/Driver/avr-toolchain.c
  : 'RUN: at line 30';   /mnt/nvme_sec/SRC/llvm-project/build-revert-test/bin/clang -### /mnt/nvme_sec/SRC/llvm-project/clang/test/Driver/avr-toolchain.c --target=avr -fuse-init-array -fuse-cxa-atexit 2>&1 | /mnt/nvme_sec/SRC/llvm-project/build-re
  vert-test/bin/FileCheck -check-prefix=CHECK4 /mnt/nvme_sec/SRC/llvm-project/clang/test/Driver/avr-toolchain.c
  : 'RUN: at line 35';   /mnt/nvme_sec/SRC/llvm-project/build-revert-test/bin/clang -### /mnt/nvme_sec/SRC/llvm-project/clang/test/Driver/avr-toolchain.c --target=avr --sysroot=/mnt/nvme_sec/SRC/llvm-project/clang/test/Driver/Inputs/basic_avr_tree
   2>&1 -nostdinc | /mnt/nvme_sec/SRC/llvm-project/build-revert-test/bin/FileCheck --check-prefix=NOSTDINC /mnt/nvme_sec/SRC/llvm-project/clang/test/Driver/avr-toolchain.c
  : 'RUN: at line 36';   /mnt/nvme_sec/SRC/llvm-project/build-revert-test/bin/clang -### /mnt/nvme_sec/SRC/llvm-project/clang/test/Driver/avr-toolchain.c --target=avr --sysroot=/mnt/nvme_sec/SRC/llvm-project/clang/test/Driver/Inputs/basic_avr_tree
   2>&1 -nostdlibinc | /mnt/nvme_sec/SRC/llvm-project/build-revert-test/bin/FileCheck --check-prefix=NOSTDINC /mnt/nvme_sec/SRC/llvm-project/clang/test/Driver/avr-toolchain.c
  : 'RUN: at line 39';   /mnt/nvme_sec/SRC/llvm-project/build-revert-test/bin/clang -### --target=avr --sysroot=/mnt/nvme_sec/SRC/llvm-project/clang/test/Driver/Inputs/basic_avr_tree -mmcu=atmega328 /mnt/nvme_sec/SRC/llvm-project/clang/test/Driver
  /avr-toolchain.c 2>&1 | /mnt/nvme_sec/SRC/llvm-project/build-revert-test/bin/FileCheck --check-prefix=NOWARN /mnt/nvme_sec/SRC/llvm-project/clang/test/Driver/avr-toolchain.c
  : 'RUN: at line 40';   /mnt/nvme_sec/SRC/llvm-project/build-revert-test/bin/clang -### --target=avr --sysroot=/mnt/nvme_sec/SRC/llvm-project/clang/test/Driver/Inputs/basic_avr_tree -mmcu=atmega328 -S /mnt/nvme_sec/SRC/llvm-project/clang/test/Dri
  ver/avr-toolchain.c 2>&1 | /mnt/nvme_sec/SRC/llvm-project/build-revert-test/bin/FileCheck --check-prefix=NOWARN /mnt/nvme_sec/SRC/llvm-project/clang/test/Driver/avr-toolchain.c
  : 'RUN: at line 41';   /mnt/nvme_sec/SRC/llvm-project/build-revert-test/bin/clang -### --target=avr --sysroot=/mnt/nvme_sec/SRC/llvm-project/clang/test/Driver/Inputs/ -mmcu=atmega328 -S /mnt/nvme_sec/SRC/llvm-project/clang/test/Driver/avr-toolch
  ain.c 2>&1 | /mnt/nvme_sec/SRC/llvm-project/build-revert-test/bin/FileCheck --check-prefix=NOWARN /mnt/nvme_sec/SRC/llvm-project/clang/test/Driver/avr-toolchain.c
  : 'RUN: at line 44';   /mnt/nvme_sec/SRC/llvm-project/build-revert-test/bin/clang -### --target=avr --sysroot=/mnt/nvme_sec/SRC/llvm-project/clang/test/Driver/Inputs/basic_avr_tree -S /mnt/nvme_sec/SRC/llvm-project/clang/test/Driver/avr-toolchai
  n.c 2>&1 | /mnt/nvme_sec/SRC/llvm-project/build-revert-test/bin/FileCheck --check-prefixes=NOMCU,LINKA /mnt/nvme_sec/SRC/llvm-project/clang/test/Driver/avr-toolchain.c
  : 'RUN: at line 45';   /mnt/nvme_sec/SRC/llvm-project/build-revert-test/bin/clang -### --target=avr --sysroot=/mnt/nvme_sec/SRC/llvm-project/clang/test/Driver/Inputs/ -S /mnt/nvme_sec/SRC/llvm-project/clang/test/Driver/avr-toolchain.c 2>&1 | /mn
  t/nvme_sec/SRC/llvm-project/build-revert-test/bin/FileCheck --check-prefixes=NOMCU,LINKA /mnt/nvme_sec/SRC/llvm-project/clang/test/Driver/avr-toolchain.c
  : 'RUN: at line 46';   /mnt/nvme_sec/SRC/llvm-project/build-revert-test/bin/clang -### --target=avr --sysroot=/mnt/nvme_sec/SRC/llvm-project/clang/test/Driver/Inputs/basic_avr_tree /mnt/nvme_sec/SRC/llvm-project/clang/test/Driver/avr-toolchain.c
   2>&1 | /mnt/nvme_sec/SRC/llvm-project/build-revert-test/bin/FileCheck --check-prefixes=NOMCU,LINKB /mnt/nvme_sec/SRC/llvm-project/clang/test/Driver/avr-toolchain.c
  : 'RUN: at line 55';   /mnt/nvme_sec/SRC/llvm-project/build-revert-test/bin/clang -### --target=avr --sysroot=/mnt/nvme_sec/SRC/llvm-project/clang/test/Driver/Inputs/ -mmcu=atmega328 /mnt/nvme_sec/SRC/llvm-project/clang/test/Driver/avr-toolchain
  .c 2>&1 | /mnt/nvme_sec/SRC/llvm-project/build-revert-test/bin/FileCheck --check-prefixes=NOGCC /mnt/nvme_sec/SRC/llvm-project/clang/test/Driver/avr-toolchain.c
  : 'RUN: at line 61';   /mnt/nvme_sec/SRC/llvm-project/build-revert-test/bin/clang -### --target=avr --sysroot=/mnt/nvme_sec/SRC/llvm-project/clang/test/Driver/Inputs/basic_avr_tree -mmcu=atmega328 /mnt/nvme_sec/SRC/llvm-project/clang/test/Driver
  /avr-toolchain.c -fuse-ld=avrld 2>&1 | /mnt/nvme_sec/SRC/llvm-project/build-revert-test/bin/FileCheck --check-prefix=NOLD /mnt/nvme_sec/SRC/llvm-project/clang/test/Driver/avr-toolchain.c
  : 'RUN: at line 64';   /mnt/nvme_sec/SRC/llvm-project/build-revert-test/bin/clang -### --target=avr --sysroot=/mnt/nvme_sec/SRC/llvm-project/clang/test/Driver/Inputs/basic_avr_tree -mmcu=atmega328 /mnt/nvme_sec/SRC/llvm-project/clang/test/Driver
  /avr-toolchain.c -fuse-ld=/mnt/nvme_sec/SRC/llvm-project/clang/test/Driver/Inputs/basic_avr_tree/usr/bin/ld.lld 2>&1 | /mnt/nvme_sec/SRC/llvm-project/build-revert-test/bin/FileCheck --check-prefix=LLD /mnt/nvme_sec/SRC/llvm-project/clang/test/Dr
  iver/avr-toolchain.c
  : 'RUN: at line 69';   /mnt/nvme_sec/SRC/llvm-project/build-revert-test/bin/clang -### --target=avr --sysroot=/mnt/nvme_sec/SRC/llvm-project/clang/test/Driver/Inputs/basic_avr_tree -mmcu=atmega328 /mnt/nvme_sec/SRC/llvm-project/clang/test/Driver
  /avr-toolchain.c -T avr.lds 2>&1 | /mnt/nvme_sec/SRC/llvm-project/build-revert-test/bin/FileCheck --check-prefix=LDS0 /mnt/nvme_sec/SRC/llvm-project/clang/test/Driver/avr-toolchain.c
  : 'RUN: at line 72';   /mnt/nvme_sec/SRC/llvm-project/build-revert-test/bin/clang -### --target=avr --sysroot=/mnt/nvme_sec/SRC/llvm-project/clang/test/Driver/Inputs/basic_avr_tree -mmcu=atmega328 /mnt/nvme_sec/SRC/llvm-project/clang/test/Driver
  /avr-toolchain.c -fuse-ld=/mnt/nvme_sec/SRC/llvm-project/clang/test/Driver/Inputs/basic_avr_tree/usr/bin/ld.lld -T avr.lds 2>&1 | /mnt/nvme_sec/SRC/llvm-project/build-revert-test/bin/FileCheck --check-prefix=LDS1 /mnt/nvme_sec/SRC/llvm-project/c
  lang/test/Driver/avr-toolchain.c
  --
  Exit Code: 1
  
  Command Output (stderr):
  --
  /mnt/nvme_sec/SRC/llvm-project/clang/test/Driver/avr-toolchain.c:65:9: error: LLD: expected string not found in input
  // LLD: {{".*lld"}}
          ^
  <stdin>:1:1: note: scanning from here
  Fuchsia clang version 15.0.0 (git at github.com:llvm/llvm-project.git 6e02e27536b9de25a651cfc9c2966ce471169355)
  ^
  <stdin>:5:139: note: possible intended match here
  clang-15: error: invalid linker name in argument '-fuse-ld=/mnt/nvme_sec/SRC/llvm-project/clang/test/Driver/Inputs/basic_avr_tree/usr/bin/ld.lld'
                                                                                                                                            ^
  
  Input file: <stdin>
  Check file: /mnt/nvme_sec/SRC/llvm-project/clang/test/Driver/avr-toolchain.c
  
  -dump-input=help explains the following input dump.
  
  Input was:
  <<<<<<
              1: Fuchsia clang version 15.0.0 (git at github.com:llvm/llvm-project.git 6e02e27536b9de25a651cfc9c2966ce471169355)
  check:65'0     X~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ error: no match found
              2: Target: avr
  check:65'0     ~~~~~~~~~~~~
              3: Thread model: posix
  check:65'0     ~~~~~~~~~~~~~~~~~~~~
              4: InstalledDir: /mnt/nvme_sec/SRC/llvm-project/build-revert-test/bin
  check:65'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
              5: clang-15: error: invalid linker name in argument '-fuse-ld=/mnt/nvme_sec/SRC/llvm-project/clang/test/Driver/Inputs/basic_avr_tree/usr/bin/ld.lld'
  check:65'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  check:65'1                                                                                                                                               ?        possible intended match
              6:  "/mnt/nvme_sec/SRC/llvm-project/build-revert-test/bin/clang-15" "-cc1" "-triple" "avr" "-emit-obj" "-mrelax-all" "--mrelax-relocations" "-disable-free" "-clear-ast-before-backend" "-main-file-name" "avr-toolchain.c" "-mrelocation
  -model" "static" "-mframe-pointer=all" "-fmath-errno" "-ffp-contract=on" "-fno-rounding-math" "-mconstructor-aliases" "-fno-use-init-array" "-fno-use-cxa-atexit" "-target-cpu" "atmega328" "-mllvm" "-treat-scalable-fixed-error-as-warning" "-debug
  ger-tuning=gdb" "-fcoverage-compilation-dir=/mnt/nvme_sec/SRC/llvm-project/build-revert-test/tools/clang/test/Driver" "-resource-dir" "/mnt/nvme_sec/SRC/llvm-project/build-revert-test/lib/clang/15.0.0" "-isysroot" "/mnt/nvme_sec/SRC/llvm-project
  /clang/test/Driver/Inputs/basic_avr_tree" "-internal-isystem" "/mnt/nvme_sec/SRC/llvm-project/clang/test/Driver/Inputs/basic_avr_tree/usr/lib/gcc/avr/5.4.0/../../../avr/include" "-fdebug-compilation-dir=/mnt/nvme_sec/SRC/llvm-project/build-rever
  t-test/tools/clang/test/Driver" "-ferror-limit" "19" "-fgnuc-version=4.2.1" "-faddrsig" "-o" "/tmp/lit-tmp-a4e1rfqj/avr-toolchain-f24e25.o" "-x" "c" "/mnt/nvme_sec/SRC/llvm-project/clang/test/Driver/avr-toolchain.c"
  check:65'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
              7:  "/mnt/nvme_sec/SRC/llvm-project/clang/test/Driver/Inputs/basic_avr_tree/usr/lib/gcc/avr/5.4.0/../../../../bin/avr-ld" "/tmp/lit-tmp-a4e1rfqj/avr-toolchain-f24e25.o" "-o" "a.out" "--gc-sections" "-L/mnt/nvme_sec/SRC/llvm-project/c
  lang/test/Driver/Inputs/basic_avr_tree/usr/lib/gcc/avr/5.4.0/../../../avr/lib/avr5" "-L/mnt/nvme_sec/SRC/llvm-project/clang/test/Driver/Inputs/basic_avr_tree/usr/lib/gcc/avr/5.4.0/avr5" "-Tdata=0x800100" "--start-group" "-l:crtatmega328.o" "-lgc
  c" "-lm" "-lc" "-latmega328" "--end-group" "-mavr5"
  check:65'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  >>>>>>
  
  --
  
  ********************
  ********************

  


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

https://reviews.llvm.org/D126192



More information about the cfe-commits mailing list