Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
# is provided to nmake
# test -

!IFNDEF "$(PREFIX)"
!IFNDEF PREFIX
PREFIX="$(MAKEDIR)\install\"
!ENDIF

Expand Down Expand Up @@ -64,12 +64,12 @@ cl.exe : $(SRCS)
link $(LFLAGS) $** $(API_LIBS) /out:cl.exe

install : cl.exe
mkdir $(PREFIX)
move cl.exe $(PREFIX)
mklink $(PREFIX)\link.exe $(PREFIX)\cl.exe
mklink $(PREFIX)\ifx.exe $(PREFIX)\cl.exe
mklink $(PREFIX)\ifort.exe $(PREFIX)\ifort.exe
mklink $(PREFIX)\relocate.exe $(PREFIX)\cl.exe
@if not exist "$(PREFIX)" mkdir "$(PREFIX)""
@if not exist "$(PREFIX)\cl.exe" move cl.exe "$(PREFIX)"
@if not exist "$(PREFIX)\link.exe" mklink "$(PREFIX)\link.exe" "$(PREFIX)\cl.exe"
@if not exist "$(PREFIX)\ifx.exe" mklink "$(PREFIX)\ifx.exe" "$(PREFIX)\cl.exe"
@if not exist "$(PREFIX)\ifort.exe" mklink "$(PREFIX)\ifort.exe" "$(PREFIX)\cl.exe"
@if not exist "$(PREFIX)\relocate.exe" mklink "$(PREFIX)\relocate.exe" "$(PREFIX)\cl.exe"

setup_test: cl.exe
@echo \n
Expand Down
3 changes: 2 additions & 1 deletion src/ld.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,8 @@ std::unique_ptr<RCFileManager> LdInvocation::createRC(LinkerInvocation& link_run
const std::string rc_file_name = join({rc_tmp_dir, base_rc_file_name}, "\\");

ExecuteCommand rc_executor("rc",
{"/fo" + res_file_name + " " + rc_file_name});
{"/fo\"" + res_file_name + "\"",
"\"" + rc_file_name + "\""});
std::ofstream rc_out(rc_file_name);
if (!rc_out) {
std::cerr << "Error: could not open rc file for creation: "
Expand Down
2 changes: 1 addition & 1 deletion src/toolchain.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ void ToolChainInvocation::ParseCommandArgs(char const* const* cli) {
}

std::string ToolChainInvocation::ComposeIncludeArg(std::string& include) {
return "/external:I " + include;
return "/external:I\"" + include + "\"";
}

std::string ToolChainInvocation::ComposeLibPathArg(std::string& libPath) {
Expand Down
2 changes: 1 addition & 1 deletion src/utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ class LibraryFinder {

class PathRelocator {
private:
bool bc_;
bool bc_ = true; // default: build-cache prefix→prefix mode
std::string new_prefix_;
std::map<std::string, std::string> old_new_map;
std::string relocateBC(std::string const& pe);
Expand Down
10 changes: 5 additions & 5 deletions src/winrpath.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ LibRename::LibRename(std::string p_exe, std::string coff, bool full,
* Produces something like `/EXPORTS <name of coff file>`
*/
std::string LibRename::ComputeDefLine() {
return "/NOLOGO /EXPORTS " + this->coff;
return "/NOLOGO /EXPORTS \"" + this->coff + "\"";
}

/**
Expand Down Expand Up @@ -440,10 +440,10 @@ bool LibRename::ExecutePERename() {
*
*/
std::string LibRename::ComputeRenameLink() {
std::string line("-def:");
line += this->def_file + " ";
line += "-name:";
line += mangle_name(this->pe) + " ";
std::string line("-def:\"");
line += this->def_file + "\" ";
line += "-name:\"";
line += mangle_name(this->pe) + "\" ";
std::string const name(stem(this->coff));
if (!this->replace) {
this->new_lib = name + ".abs-name.lib";
Expand Down
Loading