audk/BaseTools/Source/C/VfrCompile
Laszlo Ersek aa4e0df1f0 BaseTools/VfrCompile: honor EXTRA_LDFLAGS
In commit 81502cee20 ("BaseTools/Source/C: take EXTRA_LDFLAGS from the
caller", 2018-08-16), I missed that "VfrCompile/GNUmakefile" does not use
BUILD_LFLAGS in the APPLICATION linking rule, unlike "app.makefile" does.
Instead, "VfrCompile/GNUmakefile" uses the (undefined) LFLAGS macro.
Therefore commit 81502cee20 did not cover the linking step of
VfrCompile.

Thankfully, the structure of the linking rules is the same, between
"app.makefile" and "VfrCompile/GNUmakefile". Rename the undefined LFLAGS
macro in "VfrCompile/GNUmakefile" to VFR_LFLAGS (for consistency with
VFR_CXXFLAGS), and set it to EXTRA_LDFLAGS.

As a result, we have:

             | compilation                    | linking
  -----------+--------------------------------+----------------------
  VfrCompile | VFR_CXXFLAGS =                 | VFR_LFLAGS =
             | BUILD_OPTFLAGS =               | EXTRA_LDFLAGS
             | '-O2' + EXTRA_OPTFLAGS         |
  -----------+--------------------------------+----------------------
  other apps | BUILD_CFLAGS/BUILD_CXXFLAGS =  | BUILD_LFLAGS =
             | [...] + BUILD_OPTFLAGS =       | [...] + EXTRA_LDFLAGS
             | [...] + '-O2' + EXTRA_OPTFLAGS |

This table shows
- that the VfrCompile compilation and linking flags are always a subset of
  the corresponding flags used by the other apps,
- and that the EXTRA flags are always at the end.

Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Ref: https://bugzilla.redhat.com/show_bug.cgi?id=1540244
Fixes: 81502cee20
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
2018-08-22 09:32:46 -07:00
..
Pccts BaseTools: silence parentheses-equality warning 2018-01-02 20:37:32 +08:00
EfiVfr.h BaseTools: Clean up source files 2018-07-09 10:25:47 +08:00
GNUmakefile BaseTools/VfrCompile: honor EXTRA_LDFLAGS 2018-08-22 09:32:46 -07:00
Makefile Sync EDKII BaseTools to BaseTools project r2100. 2010-12-06 05:17:09 +00:00
VfrCompiler.cpp BaseTools: Clean up source files 2018-07-09 10:25:47 +08:00
VfrCompiler.h BaseTools: Clean up source files 2018-07-09 10:25:47 +08:00
VfrError.cpp BaseTools: Clean up source files 2018-07-09 10:25:47 +08:00
VfrError.h BaseTools: Clean up source files 2018-07-09 10:25:47 +08:00
VfrFormPkg.cpp BaseTools: Clean up source files 2018-07-09 10:25:47 +08:00
VfrFormPkg.h BaseTools: Clean up source files 2018-07-09 10:25:47 +08:00
VfrSyntax.g BaseTools/VfrCompile: Avoid using uninitialized pointer 2018-05-09 16:30:36 +08:00
VfrUtilityLib.cpp BaseTools: Clean up source files 2018-07-09 10:25:47 +08:00
VfrUtilityLib.h BaseTools: Clean up source files 2018-07-09 10:25:47 +08:00