This is an archive of the discontinued LLVM Phabricator instance.

[ELF] Allow --reproduce to be specified as an env variable
ClosedPublic

Authored by davide on Jun 22 2016, 4:15 PM.

Diff Detail

Event Timeline

davide updated this revision to Diff 61623.Jun 22 2016, 4:15 PM
davide retitled this revision from to [ELF] Allow --reproduce to be specified as an env variable.
davide updated this object.
davide added reviewers: ruiu, rafael.
davide added subscribers: silvas, llvm-commits.
davide added a comment.EditedJun 22 2016, 4:21 PM

Example repro (just used to reproduce a libreoffice link failure)

$ export LLD_REPRODUCE=patatino
$ echo $LLD_REPRODUCE
patatino
$ make
mkdir -p /home/davide/lto_experiments/libreoffice/instdir
/home/davide/lto_experiments/libreoffice/solenv/bin/install-gdb-printers -a /home/davide/lto_experiments/libreoffice/instdir -c
make -j 1  -rs -f /home/davide/lto_experiments/libreoffice/Makefile.gbuild    all
[build DEP] LNK:Library/libsal_textenclo.so
[build LNK] Library/libsal_textenclo.so
undefined symbol: _ZN3sal6detail7textenc37handleBadInputTextToUnicodeConversionEbbcjPPDsS2_Pj in /home/davide/lto_experiments/libreoffice/workdir/CxxObject/sal/textenc/convertbig5hkscs.o
undefined symbol: _ZN3sal6detail7textenc37handleBadInputUnicodeToTextConversionEbjjPPcS2_PjPKcmPb in /home/davide/lto_experiments/libreoffice/workdir/CxxObject/sal/textenc/convertbig5hkscs.o
undefined symbol: _ZN3sal6detail7textenc20convertCharToUnicodeEPKvPvPKcmPDsmjPjPm in /home/davide/lto_experiments/libreoffice/workdir/CxxObject/sal/textenc/tables.o
undefined symbol: _ZN3sal6detail7textenc20convertUnicodeToCharEPKvPvPKDsmPcmjPjPm in /home/davide/lto_experiments/libreoffice/workdir/CxxObject/sal/textenc/tables.o
undefined symbol: _ZN3sal6detail7textenc32handleUndefinedUnicodeToTextCharEPPKDsS3_PPcPKcjPj in /home/davide/lto_experiments/libreoffice/workdir/CxxObject/sal/textenc/tcvtbyte.o
clang-3.9: error: linker command failed with exit code 1 (use -v to see invocation)
/home/davide/lto_experiments/libreoffice/sal/Library_sal_textenc.mk:11: recipe for target '/home/davide/lto_experiments/libreoffice/instdir/program/libsal_textenclo.so' failed
make[1]: *** [/home/davide/lto_experiments/libreoffice/instdir/program/libsal_textenclo.so] Error 1
Makefile:254: recipe for target 'build' failed
make: *** [build] Error 2

$ find . -name "patatino*"
./patatino.cpio
ruiu added inline comments.Jun 22 2016, 7:23 PM
ELF/Driver.cpp
264–265

Please separate this code as getReproduceOption function and then use it as

if (const char *Path = getReproduceOption()) {
  ...
}

Do you need :: for getenv?

davide updated this revision to Diff 61754.Jun 23 2016, 8:20 PM

Addressed Rui's comments.

ruiu accepted this revision.Jun 23 2016, 10:34 PM
ruiu edited edge metadata.

LGTM with a few nits.[[ URL | name ]]

ELF/Driver.cpp
239

This variable is dead.

264

This line has two occurrence of Reproduce. This is too much. I'd name just Path.

This revision is now accepted and ready to land.Jun 23 2016, 10:34 PM
This revision was automatically updated to reflect the committed changes.