[PATCH] D40125: [ELF] Fix rewriting of --sysroot in reproducer tars

Rafael Avila de Espindola via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 17 10:21:22 PST 2017


LGTM

Alexander Richardson via Phabricator via llvm-commits
<llvm-commits at lists.llvm.org> writes:

> arichardson updated this revision to Diff 123325.
> arichardson marked an inline comment as done.
> arichardson added a comment.
>
> - merged with the other cases
> - added both `--sysroot=<path>` and `--sysroot <path>` to the test
>
>
> https://reviews.llvm.org/D40125
>
> Files:
>   ELF/DriverUtils.cpp
>   test/ELF/reproduce.s
>
>
> Index: test/ELF/reproduce.s
> ===================================================================
> --- test/ELF/reproduce.s
> +++ test/ELF/reproduce.s
> @@ -34,23 +34,27 @@
>  # RUN: echo > file
>  # RUN: echo > file2
>  # RUN: echo "_start" > order
> +# RUN: mkdir "sysroot with spaces"
>  # RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o 'foo bar'
>  # RUN: ld.lld --reproduce repro2.tar 'foo bar' -L"foo bar" -Lfile -Tfile2 \
>  # RUN:   --dynamic-list dyn -rpath file --script=file --symbol-ordering-file order \
> +# RUN:   --sysroot "sysroot with spaces" --sysroot="sysroot with spaces" \
>  # RUN:   --version-script ver --dynamic-linker "some unusual/path" -soname 'foo bar' \
>  # RUN:   -soname='foo bar'
>  # RUN: tar xf repro2.tar
>  # RUN: FileCheck %s --check-prefix=RSP2 < repro2/response.txt
>  # RSP2:      --chroot .
>  # RSP2:      "{{.*}}foo bar"
> -# RSP2-NEXT: --library-path "{{.*}}foo bar"
> -# RSP2-NEXT: --library-path {{.+}}file
> -# RSP2-NEXT: --script {{.+}}file2
> -# RSP2-NEXT: --dynamic-list {{.+}}dyn
> -# RSP2-NEXT: -rpath {{.+}}file
> -# RSP2-NEXT: --script {{.+}}file
> -# RSP2-NEXT: --symbol-ordering-file [[PATH:.+]]order
> -# RSP2-NEXT: --version-script [[PATH]]ver
> +# RSP2-NEXT: --library-path "[[BASEDIR:.+]]/foo bar"
> +# RSP2-NEXT: --library-path [[BASEDIR]]/file
> +# RSP2-NEXT: --script [[BASEDIR]]/file2
> +# RSP2-NEXT: --dynamic-list [[BASEDIR]]/dyn
> +# RSP2-NEXT: -rpath [[BASEDIR]]/file
> +# RSP2-NEXT: --script [[BASEDIR]]/file
> +# RSP2-NEXT: --symbol-ordering-file [[BASEDIR]]/order
> +# RSP2-NEXT: --sysroot "[[BASEDIR]]/sysroot with spaces"
> +# RSP2-NEXT: --sysroot "[[BASEDIR]]/sysroot with spaces"
> +# RSP2-NEXT: --version-script [[BASEDIR]]/ver
>  # RSP2-NEXT: --dynamic-linker "some unusual/path"
>  # RSP2-NEXT: -soname "foo bar"
>  # RSP2-NEXT: -soname "foo bar"
> Index: ELF/DriverUtils.cpp
> ===================================================================
> --- ELF/DriverUtils.cpp
> +++ ELF/DriverUtils.cpp
> @@ -161,6 +161,7 @@
>      case OPT_script:
>      case OPT_symbol_ordering_file:
>      case OPT_version_script:
> +    case OPT_sysroot:
>        OS << Arg->getSpelling() << " " << quote(rewritePath(Arg->getValue()))
>           << "\n";
>        break;
>
>
> Index: test/ELF/reproduce.s
> ===================================================================
> --- test/ELF/reproduce.s
> +++ test/ELF/reproduce.s
> @@ -34,23 +34,27 @@
>  # RUN: echo > file
>  # RUN: echo > file2
>  # RUN: echo "_start" > order
> +# RUN: mkdir "sysroot with spaces"
>  # RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o 'foo bar'
>  # RUN: ld.lld --reproduce repro2.tar 'foo bar' -L"foo bar" -Lfile -Tfile2 \
>  # RUN:   --dynamic-list dyn -rpath file --script=file --symbol-ordering-file order \
> +# RUN:   --sysroot "sysroot with spaces" --sysroot="sysroot with spaces" \
>  # RUN:   --version-script ver --dynamic-linker "some unusual/path" -soname 'foo bar' \
>  # RUN:   -soname='foo bar'
>  # RUN: tar xf repro2.tar
>  # RUN: FileCheck %s --check-prefix=RSP2 < repro2/response.txt
>  # RSP2:      --chroot .
>  # RSP2:      "{{.*}}foo bar"
> -# RSP2-NEXT: --library-path "{{.*}}foo bar"
> -# RSP2-NEXT: --library-path {{.+}}file
> -# RSP2-NEXT: --script {{.+}}file2
> -# RSP2-NEXT: --dynamic-list {{.+}}dyn
> -# RSP2-NEXT: -rpath {{.+}}file
> -# RSP2-NEXT: --script {{.+}}file
> -# RSP2-NEXT: --symbol-ordering-file [[PATH:.+]]order
> -# RSP2-NEXT: --version-script [[PATH]]ver
> +# RSP2-NEXT: --library-path "[[BASEDIR:.+]]/foo bar"
> +# RSP2-NEXT: --library-path [[BASEDIR]]/file
> +# RSP2-NEXT: --script [[BASEDIR]]/file2
> +# RSP2-NEXT: --dynamic-list [[BASEDIR]]/dyn
> +# RSP2-NEXT: -rpath [[BASEDIR]]/file
> +# RSP2-NEXT: --script [[BASEDIR]]/file
> +# RSP2-NEXT: --symbol-ordering-file [[BASEDIR]]/order
> +# RSP2-NEXT: --sysroot "[[BASEDIR]]/sysroot with spaces"
> +# RSP2-NEXT: --sysroot "[[BASEDIR]]/sysroot with spaces"
> +# RSP2-NEXT: --version-script [[BASEDIR]]/ver
>  # RSP2-NEXT: --dynamic-linker "some unusual/path"
>  # RSP2-NEXT: -soname "foo bar"
>  # RSP2-NEXT: -soname "foo bar"
> Index: ELF/DriverUtils.cpp
> ===================================================================
> --- ELF/DriverUtils.cpp
> +++ ELF/DriverUtils.cpp
> @@ -161,6 +161,7 @@
>      case OPT_script:
>      case OPT_symbol_ordering_file:
>      case OPT_version_script:
> +    case OPT_sysroot:
>        OS << Arg->getSpelling() << " " << quote(rewritePath(Arg->getValue()))
>           << "\n";
>        break;
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits


More information about the llvm-commits mailing list