On 22 July 2016 at 10:38, Gao, Liming <liming....@intel.com> wrote: > Ard: > I have some comments on GCC5 DLINK PATH definition. *_GCC5_*_DLINK_PATH > = $(EDK_TOOLS_PATH)/Scripts/lto-ld-wrapper.py > 1) It directly points to python script. In OS, python script need be trigged > by python execute. > 2) Most windows users directly use the binary base tools. They may not > install python, and not directly use python script in build process. This > patch still breaks windows GCC5 build. > > So, I suggest: > 1) Add lto-ld-wrapper script in BaseTools/BinWrappers/PosixLike to call > $(EDK_TOOLS_PATH)/Scripts/lto-ld-wrapper.py for Linux > 2) Freeze $(EDK_TOOLS_PATH)/Scripts/lto-ld-wrapper.py to > $(EDK_TOOLS_PATH)/Scripts/lto-ld-wrapper.exe for Windows > 3) Define *_GCC5_*_DLINK_PATH = > ENV(LTO_LD_PREFIX)lto-ld-wrapper, then Windows user can configure > LTO_LD_PREFIX evn to use it. > > And, for lto-ld-wrapper.py script, it should print the full command before > execute it so that user knows the real commands >
OK. > Last, on GCC5 DLINK and DLINK_FLAGS. There are two styles to define them. I > prefer style 2 to keep DLINK_FALGS without changes. > 1) > *_GCC5_*_DLINK_PATH = ENV(LTO_LD_PREFIX)lto-ld-wrapper > *_GCC5_IA32_DLINK_FLAGS = --cc "DEF(GCC5_IA32_PREFIX)gcc" > DEF(GCC5_IA32_X64_DLINK_FLAGS) -m elf_i386 --oformat=elf32-i386 > > 2) > *_GCC5_*_DLINK_PATH = ENV(LTO_LD_PREFIX)lto-ld-wrapper --cc > "DEF(GCC5_IA32_PREFIX)gcc" > *_GCC5_IA32_DLINK_FLAGS = DEF(GCC5_IA32_X64_DLINK_FLAGS) -m elf_i386 > --oformat=elf32-i386 > That does not work, unfortunately. The build rule puts quotes around the path, and so the --cc argument becomes part of argument 0, e.g., /bin/sh: 1: lto-ld-wrapper --cc aarch64-linux-gnu-gcc: not found due to <Command.GCC> "$(DLINK)" -o ${dst} $(DLINK_FLAGS) --start-group $(DLINK_SPATH) @$(STATIC_LIBRARY_FILES_LIST) --end-group $(DLINK2_FLAGS) "$(OBJCOPY)" $(OBJCOPY_FLAGS) ${dst} _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel