diff options
author | Tanzinul Islam <tanzinul.islam@gmail.com> | 2020-11-19 17:57:46 +0000 |
---|---|---|
committer | Dmitry Belyavskiy <beldmit@gmail.com> | 2021-04-19 11:05:54 +0200 |
commit | a75a87561b491fc9b96b15153eba1f5e142280c5 (patch) | |
tree | 837e5fb001eb74b10a6265633b9f5901355ee00f /Configurations | |
parent | 830cd025b199fab165a378884fb5b4373799bde9 (diff) |
Generalize link rule in windows-makefile.tmpl
C++Builder's [`ilink32.exe`][1] expects its different types of input /
output files to be in a particular sequence and comma-separated -- even
in the response file as experimentation revealed, contrary to what is
documented. The lines of the response file need to end with `+`.
Also [`setargv.obj`][2] is MSVC-specific. The C++Builder equivalent is
[`wildargs.obj`][3].
[1]: http://docwiki.embarcadero.com/RADStudio/Sydney/en/Using_ILINK32_and_ILINK64_on_the_Command_Line
[2]: https://docs.microsoft.com/en-us/cpp/c-language/expanding-wildcard-arguments?view=msvc-160
[3]: http://docwiki.embarcadero.com/RADStudio/Sydney/en/Wildcard_Arguments
Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
(Merged from https://github.com/openssl/openssl/pull/13540)
Diffstat (limited to 'Configurations')
-rw-r--r-- | Configurations/10-main.conf | 3 | ||||
-rw-r--r-- | Configurations/windows-makefile.tmpl | 24 |
2 files changed, 13 insertions, 14 deletions
diff --git a/Configurations/10-main.conf b/Configurations/10-main.conf index fbab220360..f65fd30e5d 100644 --- a/Configurations/10-main.conf +++ b/Configurations/10-main.conf @@ -1281,6 +1281,9 @@ my %targets = ( LD => "link", LDFLAGS => "/nologo /debug", ldoutflag => "/out:", + ldpostoutflag => "", + ld_resp_delim => "\n", + ld_wildcard_args => "setargv.obj", AR => "lib", ARFLAGS => "/nologo", aroutflag => "/out:", diff --git a/Configurations/windows-makefile.tmpl b/Configurations/windows-makefile.tmpl index 51b29515a7..feb9bb1a11 100644 --- a/Configurations/windows-makefile.tmpl +++ b/Configurations/windows-makefile.tmpl @@ -858,8 +858,8 @@ EOF @{$args{objs}}; my @deps = compute_lib_depends(@{$args{deps}}); die "More than one exported symbols list" if scalar @defs > 1; - my $linklibs = join("", map { "$_\n" } @deps); - my $objs = join("\n", @objs); + my $linklibs = join("", map { "$_$target{ld_resp_delim}" } @deps); + my $objs = join($target{ld_resp_delim}, @objs); my $deps = join(" ", @objs, @defs, @deps); my $import = platform->sharedlib_import($lib); my $dll = platform->sharedlib($lib); @@ -874,8 +874,7 @@ $dll: $deps IF EXIST \$@ DEL /F /Q \$@ \$(LD) \$(LDFLAGS) \$(LIB_LDFLAGS) \\ /implib:$import \$(LDOUTFLAG)$dll$shared_def @<< || (DEL /Q \$(\@B).* $import; EXIT 1) -$objs -$linklibs\$(LIB_EX_LIBS) +$objs$target{ld_resp_delim}$linklibs\$(LIB_EX_LIBS) << IF EXIST $dll.manifest \\ \$(MT) \$(MTFLAGS) \$(MTINFLAG)$dll.manifest \$(MTOUTFLAG)$dll @@ -898,8 +897,8 @@ EOF grep { platform->isdef($_) } @{$args{objs}}; my @deps = compute_lib_depends(@{$args{deps}}); - my $objs = join("\n", @objs); - my $linklibs = join("", map { "$_\n" } @deps); + my $objs = join($target{ld_resp_delim}, @objs); + my $linklibs = join("", map { "$_$target{ld_resp_delim}" } @deps); my $deps = join(" ", @objs, @defs, @deps); my $shared_def = join("", map { " /def:$_" } @defs); return <<"EOF"; @@ -907,8 +906,7 @@ $dso: $deps IF EXIST $dso.manifest DEL /F /Q $dso.manifest \$(LD) \$(LDFLAGS) \$(DSO_LDFLAGS) \\ \$(LDOUTFLAG)$dso$shared_def @<< || (DEL /Q \$(\@B).* $dso_n.*; EXIT 1) -$objs -$linklibs \$(DSO_EX_LIBS) +$objs$target{ld_resp_delim}$linklibs \$(DSO_EX_LIBS) << IF EXIST $dso.manifest \\ \$(MT) \$(MTFLAGS) \$(MTINFLAG)$dso.manifest \$(MTOUTFLAG)$dso @@ -934,16 +932,14 @@ EOF grep { platform->isobj($_) || platform->isres($_) } @{$args{objs}}; my @deps = compute_lib_depends(@{$args{deps}}); - my $objs = join("\n", @objs); - my $linklibs = join("", map { "$_\n" } @deps); + my $objs = join($target{ld_resp_delim}, @objs); + my $linklibs = join("", map { "$_$target{ld_resp_delim}" } @deps); my $deps = join(" ", @objs, @deps); return <<"EOF"; $bin: $deps IF EXIST $bin.manifest DEL /F /Q $bin.manifest - \$(LD) \$(LDFLAGS) \$(BIN_LDFLAGS) \$(LDOUTFLAG)$bin @<< -$objs -setargv.obj -$linklibs\$(BIN_EX_LIBS) + \$(LD) \$(LDFLAGS) \$(BIN_LDFLAGS) @<< +$objs$target{ld_resp_delim}$target{ld_wildcard_args}$target{ld_resp_delim}\$(LDOUTFLAG)$bin$target{ldpostoutflag}$target{ld_resp_delim}$linklibs\$(BIN_EX_LIBS) << IF EXIST $bin.manifest \\ \$(MT) \$(MTFLAGS) \$(MTINFLAG)$bin.manifest \$(MTOUTFLAG)$bin |