diff options
author | Ömer Sinan Ağacan <omeragacan@gmail.com> | 2018-01-26 13:09:17 -0500 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2018-01-26 14:37:28 -0500 |
commit | cacba075d72473511f6924c6505952ff12a20316 (patch) | |
tree | 165c260cbb82b54a386a18167c7f138c53f7fcc3 /testsuite/tests | |
parent | cbdea95938bf09e8e3e7be31918549224d171873 (diff) | |
download | haskell-cacba075d72473511f6924c6505952ff12a20316.tar.gz |
Linker: ignore empty paths in addEnvPaths
Previously `splitEnv` worked like this:
> splitEnv "foo:::bar::baz:"
["foo","","","bar","","baz",""]
with this patch:
> splitEnv working_dir "foo:::bar:baz:"
["foo",working_dir,working_dir"bar","baz",working_dir]
This fixes #14695, where having a trailing `:` in the env variable
caused ghci to pass empty `-B` parameter to `gcc`, which in turned
caused the next parameter (`--print-file-name`) to be considered as the
argument to `-B`. As a result ghci did not work.
The `working_dir` argument is to have a similar behavior with POSIX:
according to chapter 8.3 zero-length prefix means current working
directory.
Reviewers: hvr, bgamari, AndreasK, simonmar
Reviewed By: bgamari, AndreasK, simonmar
Subscribers: AndreasK, rwbarton, thomie, carter
GHC Trac Issues: #14695
Differential Revision: https://phabricator.haskell.org/D4330
Diffstat (limited to 'testsuite/tests')
-rw-r--r-- | testsuite/tests/rts/Makefile | 4 | ||||
-rw-r--r-- | testsuite/tests/rts/all.T | 1 |
2 files changed, 5 insertions, 0 deletions
diff --git a/testsuite/tests/rts/Makefile b/testsuite/tests/rts/Makefile index a6d248201b..ded3be1b3b 100644 --- a/testsuite/tests/rts/Makefile +++ b/testsuite/tests/rts/Makefile @@ -174,3 +174,7 @@ T11788: .PHONY: T12497 T12497: echo main | "$(TEST_HC)" $(filter-out -rtsopts, $(TEST_HC_OPTS_INTERACTIVE)) T12497.hs + +.PHONY: T14695 +T14695: + echo ":quit" | LD_LIBRARY_PATH="foo:" "$(TEST_HC)" $(filter-out -rtsopts, $(TEST_HC_OPTS_INTERACTIVE)) diff --git a/testsuite/tests/rts/all.T b/testsuite/tests/rts/all.T index 6377bde04f..fe86dd1146 100644 --- a/testsuite/tests/rts/all.T +++ b/testsuite/tests/rts/all.T @@ -382,3 +382,4 @@ test('T12903', [when(opsys('mingw32'), skip)], compile_and_run, ['']) test('T13832', exit_code(1), compile_and_run, ['-threaded']) test('T13894', normal, compile_and_run, ['']) test('T14497', normal, compile_and_run, ['-O']) +test('T14695', normal, run_command, ['$MAKE -s --no-print-directory T14695']) |