> > Could you try putting -O2 in the DLINK2_FLAGS for Clang 38? (i.e., so
> that the last -O option the linker sees is not -Oz) > Ard, Add -O2 or -O3 in DLINK2_FLAGS works as below, thank your suggestion! "/home/jshi19/clang38/bin/clang" -o /home/jshi19/edk2-fork/Build/OvmfX64/RELEASE_CLANG38/X64/MdeModulePkg/Core/Dxe/DxeMain/DEBUG/DxeCore.dll -nostdlib -Wl,-n,-q,--gc-sections -z common-page-size=0x40 -Wl,--entry,_ModuleEntryPoint -u _ModuleEntryPoint -Wl,-Map,/home/jshi19/edk2-fork/Build/OvmfX64/RELEASE_CLANG38/X64/MdeModulePkg/Core/Dxe/DxeMain/DEBUG/DxeCore.map -flto -Wl,-Oz -Wl,-melf_x86_64 -Wl,--oformat=elf64-x86-64 -Wl,-pie -mcmodel=small -Wl,--start-group,@/home/jshi19/edk2-fork/Build/OvmfX64/RELEASE_CLANG38/X64/MdeModulePkg/Core/Dxe/DxeMain/OUTPUT/static_library_files.lst,--end-group -g -fshort-wchar -fno-strict-aliasing -Wall -Werror -Wno-array-bounds -ffunction-sections -fdata-sections -include AutoGen.h -fno-common -DSTRING_ARRAY_NAME=DxeCoreStrings -Wno-empty-body -fno-stack-protector -fno-builtin -mms-bitfields -Wno-address -Wno-shift-negative-value -Wno-parentheses-equality -Wno-unknown-pragmas -Wno-tautological-constant-out-of-range-compare -Wno-incompatible-library-rede claration -fno-asynchronous-unwind-tables -mno-sse -mno-mmx -msoft-float -mno-implicit-float -ftrap-function=undefined_behavior_has_been_optimized_away_by_clang -funsigned-char -fno-ms-extensions -Wno-null-dereference -Wno-tautological-compare -m64 "-DEFIAPI=__attribute__((ms_abi))" -mno-red-zone -mcmodel=small -fpie -Oz -flto -target x86_64-pc-linux-gnu -DMDEPKG_NDEBUG -mno-mmx -mno-sse -Wl,--defsym=PECOFF_HEADER_SIZE=0x228 -Wl,--script=/home/jshi19/edk2-fork/BaseTools/Scripts/GccBase.lds -Wno-error -O3 -v clang version 3.8.0 (tags/RELEASE_380/final) Target: x86_64-pc-linux-gnu Thread model: posix InstalledDir: /home/jshi19/clang38/bin Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.7 Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.7.4 Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.9 Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.9.3 Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/5.4.0 Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/6.0.0 Selected GCC installation: /usr/lib/gcc/x86_64-linux-gnu/5.4.0 Candidate multilib: .;@m64 Candidate multilib: 32;@m32 Candidate multilib: x32;@mx32 Selected multilib: .;@m64 "/usr/bin/ld" -z relro --hash-style=gnu --build-id --eh-frame-hdr -m elf_x86_64 -dynamic-linker /lib64/ld-linux-x86-64.so.2 -o /home/jshi19/edk2-fork/Build/OvmfX64/RELEASE_CLANG38/X64/MdeModulePkg/Core/Dxe/DxeMain/DEBUG/DxeCore.dll -u _ModuleEntryPoint -L/usr/lib/gcc/x86_64-linux-gnu/5.4.0 -L/usr/lib/gcc/x86_64-linux-gnu/5.4.0/../../../x86_64-linux-gnu -L/lib/x86_64-linux-gnu -L/lib/../lib64 -L/usr/lib/x86_64-linux-gnu -L/usr/lib/gcc/x86_64-linux-gnu/5.4.0/../../.. -L/home/jshi19/clang38/bin/../lib -L/lib -L/usr/lib -plugin /home/jshi19/clang38/bin/../lib/LLVMgold.so -plugin-opt=mcpu=x86-64 -plugin-opt=O3 -n -q --gc-sections -z common-page-size=0x40 --entry _ModuleEntryPoint -Map /home/jshi19/edk2-fork/Build/OvmfX64/RELEASE_CLANG38/X64/MdeModulePkg/Core/Dxe/DxeMain/DEBUG/DxeCore.map -Oz -melf_x86_64 --oformat=elf64-x86-64 -pie --start-group @/home/jshi19/edk2-fork/Build/OvmfX64/RELEASE_CLANG38/X64/MdeModulePkg/Core/Dxe/DxeMain/OUTPUT/static_library_files.lst --end-group --defsym=PECO FF_HEADER_SIZE=0x228 --script=/home/jshi19/edk2-fork/BaseTools/Scripts/GccBase.lds Steven Shi Intel\SSG\STO\UEFI Firmware Tel: +86 021-61166522 iNet: 821-6522 _______________________________________________ edk2-devel mailing list [email protected] https://lists.01.org/mailman/listinfo/edk2-devel

