Translate

Archives

Installing And Configuring UDK2018/Clang 7.0 On Fedora 29

UDK2018 (UEFI Development Kit, 2018 release), released in March 2018, contains reasonably detailed instructions on how to build the UDK2018 release on a “Linux-like System” which in practical terms is actually Ubuntu 16.04 LTS, or Ubuntu 16.10, and GCC 5. In this post, I show you how to install and build UDK2018 on Fedora 29 – which was released on October 30th, 2018 – using the Clang 7.0 toolchain.

UDK2018 is simply a validated snapshot of a subset of the EDK II (EFI Development Kit, version 2) source code at a particular point in time. The previous validated snapshot of EDK II was UDK2017 which was released in June 2017. Henceforth in this post, I will use the term EDK2 instead of EDK II.

This post assumes that you have a modicum of understanding about EDK2, Fedora, and the Clang toolchain. I also assume that gcc, Python 2.7, git and make are already installed. If not, you will need to install the appropriate packages. You also need the GNU C++ compiler installed because one of the build tools, i.e. vfrcompiler, requires building with a C++ compiler. Amongst other things, the vrfcompiler tool converts VFRs (Virtual Forms Representation) into IFRs (Internal Forms Representation) which form part of a UEFI HII (Human Interface Infrastructure) database.

First, you need to obtain the UDK2018 sources. You can use git to get a copy of the UDK2018 sources as shown here:

$ cd ~
$ git clone https://github.com/tianocore/edk2.git vUDK2018
$ mv vUDK2018 UDK2018


or, alternatively, you can download a zipfile or a tarball of the source files from here.

In the rest of this post, I assume that UDK2018 is installed at ~/UDK2018. In my case, that is /home/fpm/UDK2018. For reasons unknown, the current online instructions for building UDK2018 on a “Linux-like System” specify the root as ~/src/MyWorkspace.

Next install all the necessary packages to build the UDK2018 build tools.

# dnf install gcc-c++ nasm libuuid-devel acpica-tools

You should now be able to build all the necessary EDK2-specific tools required to build applications in UDK2017.

$ cd ~/UDK2018/BaseTools
$ make


For detailed information on all the EDK2 tools (and there are lots of them), refer to the EDK BaseTools User Guides. By the way, all EDK2 tools use INI style text based files to describe components, platforms and firmware volumes.

Assuming that the build tools have all been built successfully, the next step is to test and validate the build environment. Initialize the UDK2018 build environment using the edksetup.sh shell script.

$ cd ~/UDK2018
$ . ./edksetup.sh
WORKSPACE: /home/fpm/UDK2018
EDK_TOOLS_PATH: /home/fpm/UDK2018/BaseTools
CONF_PATH: /home/fpm/UDK2018/Conf
$

Note difference when you initiate the build environment for the second time or subsequent times:

$ cd ~/UDK2018
$ . ./edksetup.sh
Loading previous configuration from /home/fpm/UDK2018/Conf/BuildEnv.sh
WORKSPACE: /home/fpm/UDK2018
EDK_TOOLS_PATH: /home/fpm/UDK2018/BaseTools
CONF_PATH: /home/fpm/UDK2018/Conf

On Fedora 29, the default version of the GCC C compiler is 8.2.1. UDK2018 does not support GCC C compiler v8 out of the box. It only supports versions 4.4 through 5.0. However, it will still build modules (packages) and binaries using the default settings. Later on in this post, I will show you how to add Clang 7.0 support.

To test that your UDK2018 build environment is correct, enter following commands to build the supplied MdeModule package:

$ . ./edksetup.sh
...
$ build -p MdeModulePkg/MdeModulePkg.dsc -t GCC5

Build environment: Linux-4.19.13-300.fc29.x86_64-x86_64-with-fedora-29-Twenty_Nine
Build start time: 02:48:51, Jan.26 2019

WORKSPACE        = /home/fpm/UDK2018
ECP_SOURCE       = /home/fpm/UDK2018/EdkCompatibilityPkg
EDK_SOURCE       = /home/fpm/UDK2018/EdkCompatibilityPkg
EFI_SOURCE       = /home/fpm/UDK2018/EdkCompatibilityPkg
EDK_TOOLS_PATH   = /home/fpm/UDK2018/BaseTools
CONF_PATH        = /home/fpm/UDK2018/Conf

Architecture(s)  = IA32
Build target     = DEBUG
Toolchain        = GCC5

Active Platform          = /home/fpm/UDK2018/MdeModulePkg/MdeModulePkg.dsc

Processing meta-data ....... done!
Building ... /home/fpm/UDK2018/MdePkg/Library/UefiLib/UefiLib.inf [IA32]
Building ... /home/fpm/UDK2018/MdePkg/Library/UefiApplicationEntryPoint/UefiApplicationEntryPoint.inf [IA32]
"gcc" -g -fshort-wchar -fno-builtin -fno-strict-aliasing -Wall -Werror -Wno-array-bounds -ffunction-sections -fdata-sections -include AutoGen.h -fno-common -DSTRING_ARRAY_NAME=UefiLibStrings -m32 -march=i586 -malign-double -fno-stack-protector -D EFI32 -fno-asynchronous-unwind-tables -Wno-address -fno-pic -fno-pie -flto -Os -D DISABLE_NEW_DEPRECATED_INTERFACES -c -o /home/fpm/UDK2018/Build/MdeModule/DEBUG_GCC5/IA32/MdePkg/Library/UefiLib/UefiLib/OUTPUT/./UefiLibPrint.obj -I/home/fpm/UDK2018/MdePkg/Library/UefiLib -I/home/fpm/UDK2018/Build/MdeModule/DEBUG_GCC5/IA32/MdePkg/Library/UefiLib/UefiLib/DEBUG -I/home/fpm/UDK2018/MdePkg -I/home/fpm/UDK2018/MdePkg/Include -I/home/fpm/UDK2018/MdePkg/Include/Ia32 /home/fpm/UDK2018/MdePkg/Library/UefiLib/UefiLibPrint.c

...

rm -f /home/fpm/UDK2018/Build/MdeModule/DEBUG_GCC5/IA32/MdeModulePkg/Application/MemoryProfileInfo/MemoryProfileInfo/OUTPUT/MemoryProfileInfo.lib
"gcc-ar" cr gcc-ar" cr /home/fpm/UDK2018/Build/MdeModule/DEBUG_GCC5/IA32/MdeModulePkg/Application/MemoryProfileInfo/MemoryProfileInfo/OUTPUT/MemoryProfileInfo.lib  @/home/fpm/UDK2018/Build/MdeModule/DEBUG_GCC5/IA32/MdeModulePkg/Application/MemoryProfileInfo/MemoryProfileInfo/OUTPUT/object_files.lst
"gcc" -o /home/fpm/UDK2018/Build/MdeModule/DEBUG_GCC5/IA32/MdeModulePkg/Application/MemoryProfileInfo/MemoryProfileInfo/DEBUG/MemoryProfileInfo.dll -nostdlib -Wl,-n,-q,--gc-sections -z common-page-size=0x40 -Wl,--entry,_ModuleEntryPoint -u _ModuleEntryPoint -Wl,-Map,/home/fpm/UDK2018/Build/MdeModule/DEBUG_GCC5/IA32/MdeModulePkg/Application/MemoryProfileInfo/MemoryProfileInfo/DEBUG/MemoryProfileInfo.map,--whole-archive -flto -Os -Wl,-m,elf_i386,--oformat=elf32-i386 -Wl,--start-group,@/home/fpm/UDK2018/Build/MdeModule/DEBUG_GCC5/IA32/MdeModulePkg/Application/MemoryProfileInfo/MemoryProfileInfo/OUTPUT/static_library_files.lst,--end-group -g -fshort-wchar -fno-builtin -fno-strict-aliasing -Wall -Werror -Wno-array-bounds -ffunction-sections -fdata-sections -include AutoGen.h -fno-common -DSTRING_ARRAY_NAME=MemoryProfileInfoStrings -m32 -march=i586 -malign-double -fno-stack-protector -D EFI32 -fno-asynchronous-unwind-tables -Wno-address -fno-pic -fno-pie -flto -Os -D DISABLE_NEW_DEPRECATED_INTERFACES -Wl,--defsym=PECOFF_HEADER_SIZE=0x220 -Wl,--script=/home/fpm/UDK2018/BaseTools/Scripts/GccBase.lds -Wno-error -no-pie
"objcopy"  /home/fpm/UDK2018/Build/MdeModule/DEBUG_GCC5/IA32/MdeModulePkg/Application/MemoryProfileInfo/MemoryProfileInfo/DEBUG/MemoryProfileInfo.dll

...

cp -f /home/fpm/UDK2018/Build/MdeModule/DEBUG_GCC5/IA32/MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciHostBridgeDxe/DEBUG/PciHostBridgeDxe.efi /home/fpm/UDK2018/Build/MdeModule/DEBUG_GCC5/IA32/MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciHostBridgeDxe/OUTPUT
cp -f /home/fpm/UDK2018/Build/MdeModule/DEBUG_GCC5/IA32/MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciHostBridgeDxe/DEBUG/PciHostBridgeDxe.efi /home/fpm/UDK2018/Build/MdeModule/DEBUG_GCC5/IA32/PciHostBridgeDxe.efi
cp -f /home/fpm/UDK2018/Build/MdeModule/DEBUG_GCC5/IA32/MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciHostBridgeDxe/DEBUG/*.map /home/fpm/UDK2018/Build/MdeModule/DEBUG_GCC5/IA32/MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciHostBridgeDxe/OUTPUT

- Done -

Build total time: 00:01:53


If the build is successful, there should be a UEFI executable named “HelloWorld.efi” in the ~/UDK2018/Build/MdeModule/DEBUG_GCC5/IA32 directory.

Now that you have proved that your basic build environment is working by building a specific package, it is time to build your own UEFI application. Typically, you will want your own source code area within the UDK2018 directory framework for applications you develop. Let us call this area MyApps.

Create a new directory ~/UDK2018/MyApps and cd to that directory. Create a file named MyApps.dec containing the following text:

[Defines]
  DEC_SPECIFICATION              = 0x00010005
  PACKAGE_NAME                   = MyApps
  PACKAGE_GUID                   = B3E3D3D5-D62B-4497-A175-264F489D127E
  PACKAGE_VERSION                = 0.01

[Guids]

[PcdsFixedAtBuild]


The DEC (Declaration) file format was designed to support building packaging and distribution of EDK2 modules, as well as for building custom applications using the EDK2 build infrastructure. See the EDK II Package Declaration (DEC) File Format Specification for full details. It can be accessed from here.

Also, in the same subdirectory, create a file named MyApps.dsc containing the following text:

[Defines]
  PLATFORM_NAME                  = MyApps
  PLATFORM_GUID                  = 0458dade-8b6e-4e45-b773-1b27cbda3e06
  PLATFORM_VERSION               = 0.01
  DSC_SPECIFICATION              = 0x00010006
  OUTPUT_DIRECTORY               = Build/MyApps
  SUPPORTED_ARCHITECTURES        = IA32|X64|EBC
  BUILD_TARGETS                  = DEBUG|RELEASE|NOOPT
  SKUID_IDENTIFIER               = DEFAULT

#
#  Debug output control
#
  DEFINE DEBUG_ENABLE_OUTPUT      = FALSE       # Set to TRUE to enable debug output
  DEFINE DEBUG_PRINT_ERROR_LEVEL  = 0x80000040  # Flags to control amount of debug output
  DEFINE DEBUG_PROPERTY_MASK      = 0

[PcdsFeatureFlag]

[PcdsFixedAtBuild]
  gEfiMdePkgTokenSpaceGuid.PcdDebugPropertyMask|$(DEBUG_PROPERTY_MASK)
  gEfiMdePkgTokenSpaceGuid.PcdDebugPrintErrorLevel|$(DEBUG_PRINT_ERROR_LEVEL)

[PcdsFixedAtBuild.IPF]

[LibraryClasses]
  # Entry Point Libraries
  UefiApplicationEntryPoint|MdePkg/Library/UefiApplicationEntryPoint/UefiApplicationEntryPoint.inf
  ShellCEntryLib|ShellPkg/Library/UefiShellCEntryLib/UefiShellCEntryLib.inf
  UefiDriverEntryPoint|MdePkg/Library/UefiDriverEntryPoint/UefiDriverEntryPoint.inf

  # Common Libraries
  BaseLib|MdePkg/Library/BaseLib/BaseLib.inf
  BaseMemoryLib|MdePkg/Library/BaseMemoryLib/BaseMemoryLib.inf
  UefiLib|MdePkg/Library/UefiLib/UefiLib.inf
  PrintLib|MdePkg/Library/BasePrintLib/BasePrintLib.inf
  PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf
  MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf
  UefiBootServicesTableLib|MdePkg/Library/UefiBootServicesTableLib/UefiBootServicesTableLib.inf
  UefiRuntimeServicesTableLib|MdePkg/Library/UefiRuntimeServicesTableLib/UefiRuntimeServicesTableLib.inf
  !if $(DEBUG_ENABLE_OUTPUT)
    DebugLib|MdePkg/Library/UefiDebugLibConOut/UefiDebugLibConOut.inf
    DebugPrintErrorLevelLib|MdePkg/Library/BaseDebugPrintErrorLevelLib/BaseDebugPrintErrorLevelLib.inf
  !else   ## DEBUG_ENABLE_OUTPUT
    DebugLib|MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf
  !endif  ## DEBUG_ENABLE_OUTPUT

  DevicePathLib|MdePkg/Library/UefiDevicePathLib/UefiDevicePathLib.inf
  PeCoffGetEntryPointLib|MdePkg/Library/BasePeCoffGetEntryPointLib/BasePeCoffGetEntryPointLib.inf
  IoLib|MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsic.inf
  PciLib|MdePkg/Library/BasePciLibCf8/BasePciLibCf8.inf
  PciCf8Lib|MdePkg/Library/BasePciCf8Lib/BasePciCf8Lib.inf
  SynchronizationLib|MdePkg/Library/BaseSynchronizationLib/BaseSynchronizationLib.inf
  UefiRuntimeLib|MdePkg/Library/UefiRuntimeLib/UefiRuntimeLib.inf
  HiiLib|MdeModulePkg/Library/UefiHiiLib/UefiHiiLib.inf
  UefiHiiServicesLib|MdeModulePkg/Library/UefiHiiServicesLib/UefiHiiServicesLib.inf
  PerformanceLib|MdeModulePkg/Library/DxePerformanceLib/DxePerformanceLib.inf
  HobLib|MdePkg/Library/DxeHobLib/DxeHobLib.inf
  FileHandleLib|MdePkg/Library/UefiFileHandleLib/UefiFileHandleLib.inf
  SortLib|MdeModulePkg/Library/UefiSortLib/UefiSortLib.inf
  ShellLib|ShellPkg/Library/UefiShellLib/UefiShellLib.inf
  ShellCommandLib|ShellPkg/Library/UefiShellCommandLib/UefiShellCommandLib.inf
  HandleParsingLib|ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.inf
  CacheMaintenanceLib|MdePkg/Library/BaseCacheMaintenanceLib/BaseCacheMaintenanceLib.inf

[Components]

#### Applications ####
  MyApps/HelloWorld/HelloWorld.inf

A DSC file is an EDK2 platform description file that contains a list of:

  • EDK2 Module INF Files
  • EDK Components
  • EDK libraries (used by EDK components)
  • EDK2 Library class instance mappings (used by EDK2 modules)
  • EDK2 PCD Entries

See the EDK II Platform Description (DSC) File Specification for full details. It can be accessed from here. The sample contents provided above contain most of the libraries that you should ever need. The only supported architecture in the above platform description file is X64; you can add additional architectures such as IA32 or AARCH64 if you want too.

Next, let us create a simple Hello World UEFI application. In our particular build environment, all the source files associated with our Hello World application are located in one directory and form a package. Go ahead an create a subdirectory under …/UDK2018/MyApps named HelloWorld.

In the HelloWorld subdirectory, create a file named HelloWorld.inf with the following contents:

Defines]
  INF_VERSION                   = 0x00010006
  BASE_NAME                     = HelloWorld
  FILE_GUID                     = a912f198-7f0e-4803-b908-b757b806ec83
  MODULE_TYPE                   = UEFI_APPLICATION
  VERSION_STRING                = 1.0
  ENTRY_POINT                   = ShellCEntryLib
  VALID_ARCHITECTURES           = X64

[Sources]
  HelloWorld.c

[Packages]
  MdePkg/MdePkg.dec
  ShellPkg/ShellPkg.dec

[LibraryClasses]
  UefiLib
  ShellCEntryLib


An INF file is an EDK2 module information file. INF files are used by EDK2 build tools to generate AutoGen.c and AutoGen.h and Makefile/GNU makefile files for the EDK2 build infrastructure. The intent of a module’s INF file is to define the source files, libraries, and definitions relevant to building the module, creating one or more binary files that are either raw binary files or PE32 or PE32+ or COFF format files. See the EDK II Module Information (INF) File Specification for full details. It can be accessed from here.

Next, in the HelloWorld subdirectory, create a file named HelloWorld.c containing the following:

#include <uefi.h>
#include <Library/UefiLib.h>
#include <Library/ShellCEntryLib.h>

INTN
EFIAPI
ShellAppMain( UINTN Argc, CHAR16 **Argv)
{
    Print(L"Hello World!\n");

    return(0);
}


This is the actual source file for our HelloWorld UEFI application. Everything else we have done up to this point was related to the EDK2 build environment.

Now, we finally get to build out HelloWorld application:

$ cd ~/UDK2018
$ . ./edksetup.sh 
$ build -p MyApps/MyApps.dsc -t GCC5 -a X64
Build environment: Linux-4.19.13-300.fc29.x86_64-x86_64-with-fedora-29-Twenty_Nine
Build start time: 09:34:19, Jan.26 2019

WORKSPACE        = /home/fpm/UDK2018
ECP_SOURCE       = /home/fpm/UDK2018/EdkCompatibilityPkg
EDK_SOURCE       = /home/fpm/UDK2018/EdkCompatibilityPkg
EFI_SOURCE       = /home/fpm/UDK2018/EdkCompatibilityPkg
EDK_TOOLS_PATH   = /home/fpm/UDK2018/BaseTools
CONF_PATH        = /home/fpm/UDK2018/Conf

Architecture(s)  = X64
Build target     = DEBUG
Toolchain        = GCC5

Active Platform          = /home/fpm/UDK2018/MyApps/MyApps.dsc

Processing meta-data . done!

...

Building ... /home/fpm/UDK2018/MyApps/HelloWorld/HelloWorld.inf [X64]
"gcc" -g -fshort-wchar -fno-builtin -fno-strict-aliasing -Wall -Werror -Wno-array-bounds -ffunction-sections -fdata-sections -include AutoGen.h -fno-common -DSTRING_ARRAY_NAME=HelloWorldStrings -m64 -fno-stack-protector "-DEFIAPI=__attribute__((ms_abi))" -maccumulate-outgoing-args -mno-red-zone -Wno-address -mcmodel=small -fpie -fno-asynchronous-unwind-tables -Wno-address -flto -DUSING_LTO -Os -c -o /home/fpm/UDK2018/Build/MyApps/DEBUG_GCC5/X64/MyApps/HelloWorld/HelloWorld/OUTPUT/./HelloWorld.obj -I/home/fpm/UDK2018/MyApps/HelloWorld -I/home/fpm/UDK2018/Build/MyApps/DEBUG_GCC5/X64/MyApps/HelloWorld/HelloWorld/DEBUG -I/home/fpm/UDK2018/MdePkg -I/home/fpm/UDK2018/MdePkg/Include -I/home/fpm/UDK2018/MdePkg/Include/X64 -I/home/fpm/UDK2018/ShellPkg -I/home/fpm/UDK2018/ShellPkg/Include /home/fpm/UDK2018/MyApps/HelloWorld/HelloWorld.c
rm -f /home/fpm/UDK2018/Build/MyApps/DEBUG_GCC5/X64/MyApps/HelloWorld/HelloWorld/OUTPUT/HelloWorld.lib
"gcc-ar" cr /home/fpm/UDK2018/Build/MyApps/DEBUG_GCC5/X64/MyApps/HelloWorld/HelloWorld/OUTPUT/HelloWorld.lib  @/home/fpm/UDK2018/Build/MyApps/DEBUG_GCC5/X64/MyApps/HelloWorld/HelloWorld/OUTPUT/object_files.lst
"gcc" -o /home/fpm/UDK2018/Build/MyApps/DEBUG_GCC5/X64/MyApps/HelloWorld/HelloWorld/DEBUG/HelloWorld.dll -nostdlib -Wl,-n,-q,--gc-sections -z common-page-size=0x40 -Wl,--entry,_ModuleEntryPoint -u _ModuleEntryPoint -Wl,-Map,/home/fpm/UDK2018/Build/MyApps/DEBUG_GCC5/X64/MyApps/HelloWorld/HelloWorld/DEBUG/HelloWorld.map,--whole-archive -Wl,-melf_x86_64,--oformat=elf64-x86-64,-pie -flto -Os -Wl,--start-group,@/home/fpm/UDK2018/Build/MyApps/DEBUG_GCC5/X64/MyApps/HelloWorld/HelloWorld/OUTPUT/static_library_files.lst,--end-group -g -fshort-wchar -fno-builtin -fno-strict-aliasing -Wall -Werror -Wno-array-bounds -ffunction-sections -fdata-sections -include AutoGen.h -fno-common -DSTRING_ARRAY_NAME=HelloWorldStrings -m64 -fno-stack-protector "-DEFIAPI=__attribute__((ms_abi))" -maccumulate-outgoing-args -mno-red-zone -Wno-address -mcmodel=small -fpie -fno-asynchronous-unwind-tables -Wno-address -flto -DUSING_LTO -Os -Wl,--defsym=PECOFF_HEADER_SIZE=0x228 -Wl,--script=/home/fpm/UDK2018/BaseTools/Scripts/GccBase.lds -Wno-error
"objcopy"  /home/fpm/UDK2018/Build/MyApps/DEBUG_GCC5/X64/MyApps/HelloWorld/HelloWorld/DEBUG/HelloWorld.dll
cp -f /home/fpm/UDK2018/Build/MyApps/DEBUG_GCC5/X64/MyApps/HelloWorld/HelloWorld/DEBUG/HelloWorld.dll /home/fpm/UDK2018/Build/MyApps/DEBUG_GCC5/X64/MyApps/HelloWorld/HelloWorld/DEBUG/HelloWorld.debug
objcopy --strip-unneeded -R .eh_frame /home/fpm/UDK2018/Build/MyApps/DEBUG_GCC5/X64/MyApps/HelloWorld/HelloWorld/DEBUG/HelloWorld.dll
objcopy --add-gnu-debuglink=/home/fpm/UDK2018/Build/MyApps/DEBUG_GCC5/X64/MyApps/HelloWorld/HelloWorld/DEBUG/HelloWorld.debug /home/fpm/UDK2018/Build/MyApps/DEBUG_GCC5/X64/MyApps/HelloWorld/HelloWorld/DEBUG/HelloWorld.dll
cp -f /home/fpm/UDK2018/Build/MyApps/DEBUG_GCC5/X64/MyApps/HelloWorld/HelloWorld/DEBUG/HelloWorld.debug /home/fpm/UDK2018/Build/MyApps/DEBUG_GCC5/X64/HelloWorld.debug
"GenFw" -e UEFI_APPLICATION -o /home/fpm/UDK2018/Build/MyApps/DEBUG_GCC5/X64/MyApps/HelloWorld/HelloWorld/DEBUG/HelloWorld.efi /home/fpm/UDK2018/Build/MyApps/DEBUG_GCC5/X64/MyApps/HelloWorld/HelloWorld/DEBUG/HelloWorld.dll
cp -f /home/fpm/UDK2018/Build/MyApps/DEBUG_GCC5/X64/MyApps/HelloWorld/HelloWorld/DEBUG/HelloWorld.efi /home/fpm/UDK2018/Build/MyApps/DEBUG_GCC5/X64/MyApps/HelloWorld/HelloWorld/OUTPUT
cp -f /home/fpm/UDK2018/Build/MyApps/DEBUG_GCC5/X64/MyApps/HelloWorld/HelloWorld/DEBUG/HelloWorld.efi /home/fpm/UDK2018/Build/MyApps/DEBUG_GCC5/X64/HelloWorld.efi
cp -f /home/fpm/UDK2018/Build/MyApps/DEBUG_GCC5/X64/MyApps/HelloWorld/HelloWorld/DEBUG/*.map /home/fpm/UDK2018/Build/MyApps/DEBUG_GCC5/X64/MyApps/HelloWorld/HelloWorld/OUTPUT

- Done -
Build total time: 00:00:02
$ 


Note how a HelloWorld.dll was first built, and genfw was then used to convert that DLL into HelloWorld.efi which is actually a simple MSDOS executable.

Turning now to adding Clang 7.0 support to the UDK2018 build environment. Only one file needs to be augmented, i.e. …/UDK2017/Conf/tools_def.txt. Here are the diffs for that file:

5475a5476,5537
> ####################################################################################
> #
> #  Clang 7.0 - This configuration is used to compile under Linux to produce
> #  PE/COFF binaries using LLVM/Clang 7.0 with Link Time Optimization enabled
> #
> ####################################################################################
> *_CLANG70_*_*_FAMILY                = GCC
> *_CLANG70_*_MAKE_PATH               = make
> *_CLANG70_*_*_DLL                   = ENV(CLANG70_DLL)
> *_CLANG70_*_ASL_PATH                = DEF(UNIX_IASL_BIN)
> 
> *_CLANG70_*_APP_FLAGS               =
> *_CLANG70_*_ASL_FLAGS               = DEF(IASL_FLAGS)
> *_CLANG70_*_ASL_OUTFLAGS            = DEF(IASL_OUTFLAGS)
> 
> DEFINE CLANG70_X64_PREFIX           = ENV(CLANG70_BIN)
> 
> DEFINE CLANG70_X64_TARGET           = -target x86_64-pc-linux-gnu
> 
> DEFINE CLANG70_WARNING_OVERRIDES    = -Wno-parentheses-equality -Wno-tautological-compare -Wno-tautological-constant-out-of-range-compare -Wno-empty-body -Wno-unused-const-variable -Wno-varargs -Wno-unknown-warning-option
> DEFINE CLANG70_ALL_CC_FLAGS         = DEF(GCC44_ALL_CC_FLAGS) DEF(CLANG38_WARNING_OVERRIDES) -fno-stack-protector -mms-bitfields -Wno-address -Wno-shift-negative-value -Wno-unknown-pragmas -Wno-incompatible-library-redeclaration -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
> 
> 
> ##########################
> # CLANG70 X64 definitions
> ##########################
> *_CLANG70_X64_OBJCOPY_PATH         = objcopy
> *_CLANG70_X64_CC_PATH              = DEF(CLANG70_X64_PREFIX)clang
> *_CLANG70_X64_SLINK_PATH           = DEF(CLANG70_X64_PREFIX)llvm-ar
> *_CLANG70_X64_DLINK_PATH           = DEF(CLANG70_X64_PREFIX)clang
> *_CLANG70_X64_ASLDLINK_PATH        = DEF(CLANG70_X64_PREFIX)clang
> *_CLANG70_X64_ASM_PATH             = DEF(CLANG70_X64_PREFIX)clang
> *_CLANG70_X64_PP_PATH              = DEF(CLANG70_X64_PREFIX)clang
> *_CLANG70_X64_VFRPP_PATH           = DEF(CLANG70_X64_PREFIX)clang
> *_CLANG70_X64_ASLCC_PATH           = DEF(CLANG70_X64_PREFIX)clang
> *_CLANG70_X64_ASLPP_PATH           = DEF(CLANG70_X64_PREFIX)clang
> *_CLANG70_X64_RC_PATH              = objcopy
> 
> *_CLANG70_X64_ASLCC_FLAGS          = DEF(GCC_ASLCC_FLAGS) -m64 -fno-lto DEF(CLANG70_X64_TARGET)
> *_CLANG70_X64_ASLDLINK_FLAGS       = DEF(GCC5_IA32_X64_ASLDLINK_FLAGS) -Wl,-m,elf_x86_64
> *_CLANG70_X64_ASM_FLAGS            = DEF(GCC5_ASM_FLAGS) -m64 DEF(CLANG70_X64_TARGET)
> *_CLANG70_X64_RC_FLAGS             = DEF(GCC_X64_RC_FLAGS)
> *_CLANG70_X64_OBJCOPY_FLAGS        =
> *_CLANG70_X64_NASM_FLAGS           = -f elf64
> *_CLANG70_X64_PP_FLAGS             = DEF(GCC_PP_FLAGS) DEF(CLANG70_X64_TARGET)
> *_CLANG70_X64_ASLPP_FLAGS          = DEF(GCC_ASLPP_FLAGS) DEF(CLANG70_X64_TARGET)
> *_CLANG70_X64_VFRPP_FLAGS          = DEF(GCC_VFRPP_FLAGS) DEF(CLANG70_X64_TARGET)
> 
> DEBUG_CLANG70_X64_CC_FLAGS         = DEF(CLANG70_ALL_CC_FLAGS) -m64 "-DEFIAPI=__attribute__((ms_abi))" -mno-red-zone -mcmodel=small -fpie -Oz -flto DEF(CLANG70_X64_TARGET) -g
> DEBUG_CLANG70_X64_DLINK_FLAGS      = DEF(GCC5_IA32_X64_DLINK_FLAGS) -flto -Wl,-Oz -Wl,-melf_x86_64 -Wl,--oformat=elf64-x86-64 -Wl,-pie -mcmodel=small
> DEBUG_CLANG70_X64_DLINK2_FLAGS     = DEF(GCC5_X64_DLINK2_FLAGS) -O3
> 
> RELEASE_CLANG70_X64_CC_FLAGS       = DEF(CLANG70_ALL_CC_FLAGS) -m64 "-DEFIAPI=__attribute__((ms_abi))" -mno-red-zone -mcmodel=small -fpie -Oz -flto DEF(CLANG70_X64_TARGET)
> RELEASE_CLANG70_X64_DLINK_FLAGS    = DEF(GCC5_IA32_X64_DLINK_FLAGS) -flto -Wl,-Oz -Wl,-melf_x86_64 -Wl,--oformat=elf64-x86-64 -Wl,-pie -mcmodel=small
> RELEASE_CLANG70_X64_DLINK2_FLAGS   = DEF(GCC5_X64_DLINK2_FLAGS) -O3
> 
> NOOPT_CLANG70_X64_CC_FLAGS         = DEF(CLANG70_ALL_CC_FLAGS) -m64 "-DEFIAPI=__attribute__((ms_abi))" -mno-red-zone -mcmodel=small -fpie -O0 DEF(CLANG70_X64_TARGET) -g
> NOOPT_CLANG70_X64_DLINK_FLAGS      = DEF(GCC5_IA32_X64_DLINK_FLAGS) -Wl,-O0 -Wl,-melf_x86_64 -Wl,--oformat=elf64-x86-64 -Wl,-pie -mcmodel=small
> NOOPT_CLANG70_X64_DLINK2_FLAGS     = DEF(GCC5_X64_DLINK2_FLAGS) -O0
> 


You can download the full updated tools_def.txt from here. The file is named UDK2018_CLANG70_tools_def.txt.

You can also set defaults for a number of the build options such the package to build, the target architecture, toolchain to use, and more. To do this, you need to modify …/UDK2018/Conf/target.txt. Here are the diffs for the modifications I made to my version of this file:

$ diff target.txt.org target.txt
26c26
< ACTIVE_PLATFORM       = Nt32Pkg/Nt32Pkg.dsc
---
> ACTIVE_PLATFORM       = MyApps/MyApps.dsc
34c34
< TARGET                = DEBUG
---
> TARGET                = RELEASE
50c50
< TARGET_ARCH           = IA32
---
> TARGET_ARCH           = X64 
60c60
< TOOL_CHAIN_TAG        = MYTOOLS
---
> TOOL_CHAIN_TAG        = CLANG70
69c69
< # MAX_CONCURRENT_THREAD_NUMBER = 1
---
> MAX_CONCURRENT_THREAD_NUMBER = 5
$ 

Here I build the HelloWorld application again but this time using the Clang 7.0 toolchain and build with no arguments:

$ build
Build environment: Linux-4.19.13-300.fc29.x86_64-x86_64-with-fedora-29-Twenty_Nine
Build start time: 02:32:08, Jan.26 2019

WORKSPACE        = /home/fpm/UDK2018
ECP_SOURCE       = /home/fpm/UDK2018/EdkCompatibilityPkg
EDK_SOURCE       = /home/fpm/UDK2018/EdkCompatibilityPkg
EFI_SOURCE       = /home/fpm/UDK2018/EdkCompatibilityPkg
EDK_TOOLS_PATH   = /home/fpm/UDK2018/BaseTools
CONF_PATH        = /home/fpm/UDK2018/Conf

Architecture(s)  = X64
Build target     = RELEASE
Toolchain        = CLANG70

Active Platform          = /home/fpm/UDK2018/MyApps/MyApps.dsc

Processing meta-data . done!

...

Building ... /home/fpm/UDK2018/MyApps/HelloWorld/HelloWorld.inf [X64]
"clang" -g -fshort-wchar -fno-builtin -fno-strict-aliasing -Wall -Werror -Wno-array-bounds -ffunction-sections -fdata-sections -include AutoGen.h -fno-common -DSTRING_ARRAY_NAME=HelloWorldStrings -Wno-parentheses-equality -Wno-tautological-compare -Wno-tautological-constant-out-of-range-compare -Wno-empty-body -Wno-unused-const-variable -Wno-varargs -Wno-unknown-warning-option -fno-stack-protector -mms-bitfields -Wno-address -Wno-shift-negative-value -Wno-unknown-pragmas -Wno-incompatible-library-redeclaration -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 -m64 "-DEFIAPI=__attribute__((ms_abi))" -mno-red-zone -mcmodel=small -fpie -Oz -flto -target x86_64-pc-linux-gnu -c -o /home/fpm/UDK2018/Build/MyApps/RELEASE_CLANG70/X64/MyApps/HelloWorld/HelloWorld/OUTPUT/./HelloWorld.obj -I/home/fpm/UDK2018/MyApps/HelloWorld -I/home/fpm/UDK2018/Build/MyApps/RELEASE_CLANG70/X64/MyApps/HelloWorld/HelloWorld/DEBUG -I/home/fpm/UDK2018/MdePkg -I/home/fpm/UDK2018/MdePkg/Include -I/home/fpm/UDK2018/MdePkg/Include/X64 -I/home/fpm/UDK2018/ShellPkg -I/home/fpm/UDK2018/ShellPkg/Include /home/fpm/UDK2018/MyApps/HelloWorld/HelloWorld.c
"clang" -g -fshort-wchar -fno-builtin -fno-strict-aliasing -Wall -Werror -Wno-array-bounds -ffunction-sections -fdata-sections -include AutoGen.h -fno-common -DSTRING_ARRAY_NAME=HelloWorldStrings -Wno-parentheses-equality -Wno-tautological-compare -Wno-tautological-constant-out-of-range-compare -Wno-empty-body -Wno-unused-const-variable -Wno-varargs -Wno-unknown-warning-option -fno-stack-protector -mms-bitfields -Wno-address -Wno-shift-negative-value -Wno-unknown-pragmas -Wno-incompatible-library-redeclaration -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 -m64 "-DEFIAPI=__attribute__((ms_abi))" -mno-red-zone -mcmodel=small -fpie -Oz -flto -target x86_64-pc-linux-gnu -c -o /home/fpm/UDK2018/Build/MyApps/RELEASE_CLANG70/X64/MyApps/HelloWorld/HelloWorld/OUTPUT/./AutoGen.obj -I/home/fpm/UDK2018/MyApps/HelloWorld -I/home/fpm/UDK2018/Build/MyApps/RELEASE_CLANG70/X64/MyApps/HelloWorld/HelloWorld/DEBUG -I/home/fpm/UDK2018/MdePkg -I/home/fpm/UDK2018/MdePkg/Include -I/home/fpm/UDK2018/MdePkg/Include/X64 -I/home/fpm/UDK2018/ShellPkg -I/home/fpm/UDK2018/ShellPkg/Include /home/fpm/UDK2018/Build/MyApps/RELEASE_CLANG70/X64/MyApps/HelloWorld/HelloWorld/DEBUG/AutoGen.c
rm -f /home/fpm/UDK2018/Build/MyApps/RELEASE_CLANG70/X64/MyApps/HelloWorld/HelloWorld/OUTPUT/HelloWorld.lib
"llvm-ar" cr /home/fpm/UDK2018/Build/MyApps/RELEASE_CLANG70/X64/MyApps/HelloWorld/HelloWorld/OUTPUT/HelloWorld.lib  @/home/fpm/UDK2018/Build/MyApps/RELEASE_CLANG70/X64/MyApps/HelloWorld/HelloWorld/OUTPUT/object_files.lst
"clang" -o /home/fpm/UDK2018/Build/MyApps/RELEASE_CLANG70/X64/MyApps/HelloWorld/HelloWorld/DEBUG/HelloWorld.dll -nostdlib -Wl,-n,-q,--gc-sections -z common-page-size=0x40 -Wl,--entry,_ModuleEntryPoint -u _ModuleEntryPoint -Wl,-Map,/home/fpm/UDK2018/Build/MyApps/RELEASE_CLANG70/X64/MyApps/HelloWorld/HelloWorld/DEBUG/HelloWorld.map,--whole-archive -flto -Wl,-Oz -Wl,-melf_x86_64 -Wl,--oformat=elf64-x86-64 -Wl,-pie -mcmodel=small -Wl,--start-group,@/home/fpm/UDK2018/Build/MyApps/RELEASE_CLANG70/X64/MyApps/HelloWorld/HelloWorld/OUTPUT/static_library_files.lst,--end-group -g -fshort-wchar -fno-builtin -fno-strict-aliasing -Wall -Werror -Wno-array-bounds -ffunction-sections -fdata-sections -include AutoGen.h -fno-common -DSTRING_ARRAY_NAME=HelloWorldStrings -Wno-parentheses-equality -Wno-tautological-compare -Wno-tautological-constant-out-of-range-compare -Wno-empty-body -Wno-unused-const-variable -Wno-varargs -Wno-unknown-warning-option -fno-stack-protector -mms-bitfields -Wno-address -Wno-shift-negative-value -Wno-unknown-pragmas -Wno-incompatible-library-redeclaration -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 -m64 "-DEFIAPI=__attribute__((ms_abi))" -mno-red-zone -mcmodel=small -fpie -Oz -flto -target x86_64-pc-linux-gnu -Wl,--defsym=PECOFF_HEADER_SIZE=0x228 -Wl,--script=/home/fpm/UDK2018/BaseTools/Scripts/GccBase.lds -Wno-error -O3
"objcopy"  /home/fpm/UDK2018/Build/MyApps/RELEASE_CLANG70/X64/MyApps/HelloWorld/HelloWorld/DEBUG/HelloWorld.dll
cp -f /home/fpm/UDK2018/Build/MyApps/RELEASE_CLANG70/X64/MyApps/HelloWorld/HelloWorld/DEBUG/HelloWorld.dll /home/fpm/UDK2018/Build/MyApps/RELEASE_CLANG70/X64/MyApps/HelloWorld/HelloWorld/DEBUG/HelloWorld.debug
objcopy --strip-unneeded -R .eh_frame /home/fpm/UDK2018/Build/MyApps/RELEASE_CLANG70/X64/MyApps/HelloWorld/HelloWorld/DEBUG/HelloWorld.dll
objcopy  /home/fpm/UDK2018/Build/MyApps/RELEASE_CLANG70/X64/MyApps/HelloWorld/HelloWorld/DEBUG/HelloWorld.dll
cp -f /home/fpm/UDK2018/Build/MyApps/RELEASE_CLANG70/X64/MyApps/HelloWorld/HelloWorld/DEBUG/HelloWorld.debug /home/fpm/UDK2018/Build/MyApps/RELEASE_CLANG70/X64/HelloWorld.debug
"GenFw" -e UEFI_APPLICATION -o /home/fpm/UDK2018/Build/MyApps/RELEASE_CLANG70/X64/MyApps/HelloWorld/HelloWorld/DEBUG/HelloWorld.efi /home/fpm/UDK2018/Build/MyApps/RELEASE_CLANG70/X64/MyApps/HelloWorld/HelloWorld/DEBUG/HelloWorld.dll
cp -f /home/fpm/UDK2018/Build/MyApps/RELEASE_CLANG70/X64/MyApps/HelloWorld/HelloWorld/DEBUG/HelloWorld.efi /home/fpm/UDK2018/Build/MyApps/RELEASE_CLANG70/X64/MyApps/HelloWorld/HelloWorld/OUTPUT
cp -f /home/fpm/UDK2018/Build/MyApps/RELEASE_CLANG70/X64/MyApps/HelloWorld/HelloWorld/DEBUG/HelloWorld.efi /home/fpm/UDK2018/Build/MyApps/RELEASE_CLANG70/X64/HelloWorld.efi
cp -f /home/fpm/UDK2018/Build/MyApps/RELEASE_CLANG70/X64/MyApps/HelloWorld/HelloWorld/DEBUG/*.map /home/fpm/UDK2018/Build/MyApps/RELEASE_CLANG70/X64/MyApps/HelloWorld/HelloWorld/OUTPUT

- Done -
Build end time: 02:32:11, Jan.26 2019
Build total time: 00:00:03
$ 

When you type build by itself, the Python-based tool checks …/UDK2018/Conf/target.txt, sees that it should use …/UDK2017/MyApps/MyApps.dsc to determine what package to build, and uses the CLANG70 toolchain to build a X64 RELEASE version of the application.

Examining the list of files generated by our build revels more interesting information:

$ cd ~/UDK2018/Build/MyApps/RELEASE_CLANG70/X64/MyApps/HelloWorld/HelloWorld/OUTPUT/
$ ll
-rw-rw-r-- 1 fpm fpm 30032 Jan 26 09:43 AutoGen.obj
-rw-rw-r-- 1 fpm fpm  6528 Jan 26 09:43 HelloWorld.efi
-rw-rw-r-- 1 fpm fpm  6129 Jan 26 09:43 HelloWorld.inf
-rw-rw-r-- 1 fpm fpm 36522 Jan 26 09:43 HelloWorld.lib
-rw-rw-r-- 1 fpm fpm 29916 Jan 26 09:43 HelloWorld.map
-rw-rw-r-- 1 fpm fpm  4524 Jan 26 09:43 HelloWorld.obj
-rw-rw-r-- 1 fpm fpm   200 Jan 26 09:42 object_files.lst
-rw-rw-r-- 1 fpm fpm  1672 Jan 26 09:42 static_library_files.lst

$ cd ~/UDK2017/Build/MyApps/DEBUG_GCC5/X64/MyApps/HelloWorld/HelloWorld/OUTPUT
$ ll
-rw-rw-r--. 1 fpm fpm 44032 Sep 27 12:03 AutoGen.obj
-rw-rw-r--. 1 fpm fpm  5888 Sep 27 12:03 HelloWorld.efi
-rw-rw-r--. 1 fpm fpm  5098 Sep 27 12:03 HelloWorld.inf
-rw-rw-r--. 1 fpm fpm 50640 Sep 27 12:03 HelloWorld.lib
-rw-rw-r--. 1 fpm fpm 34503 Sep 27 12:03 HelloWorld.map
-rw-rw-r--. 1 fpm fpm  4704 Sep 27 12:03 HelloWorld.obj
-rw-rw-r--. 1 fpm fpm   190 Sep 27 12:03 object_files.lst
-rw-rw-r--. 1 fpm fpm  1607 Sep 27 12:03 static_library_files.lst
$ file HelloWorld.efi
HelloWorld.efi: MS-DOS executable

$ objdump -x HelloWorld.efi

HelloWorld.efi:     file format pei-x86-64
HelloWorld.efi
architecture: i386:x86-64, flags 0x0000010b:
HAS_RELOC, EXEC_P, HAS_DEBUG, D_PAGED
start address 0x000000000000119e

Characteristics 0x2e
	executable
	line numbers stripped
	symbols stripped
	large address aware

Time/Date		Wed Dec 31 19:00:00 1969
Magic			020b	(PE32+)
MajorLinkerVersion	0
MinorLinkerVersion	0
SizeOfCode		00001480
SizeOfInitializedData	00000240
SizeOfUninitializedData	00000000
AddressOfEntryPoint	000000000000119e
BaseOfCode		0000000000000240
ImageBase		0000000000000000
SectionAlignment	0000000000000040
FileAlignment		0000000000000040
MajorOSystemVersion	0
MinorOSystemVersion	0
MajorImageVersion	0
MinorImageVersion	0
MajorSubsystemVersion	0
MinorSubsystemVersion	0
Win32Version		00000000
SizeOfImage		00001980
SizeOfHeaders		00000240
CheckSum		00000000
Subsystem		0000000a	(EFI application)
DllCharacteristics	00000000
SizeOfStackReserve	0000000000000000
SizeOfStackCommit	0000000000000000
SizeOfHeapReserve	0000000000000000
SizeOfHeapCommit	0000000000000000
LoaderFlags		00000000
NumberOfRvaAndSizes	00000010

The Data Directory
Entry 0 0000000000000000 00000000 Export Directory [.edata (or where ever we found it)]
Entry 1 0000000000000000 00000000 Import Directory [parts of .idata]
Entry 2 0000000000000000 00000000 Resource Directory [.rsrc]
Entry 3 0000000000000000 00000000 Exception Directory [.pdata]
Entry 4 0000000000000000 00000000 Security Directory
Entry 5 0000000000001900 00000080 Base Relocation Directory [.reloc]
Entry 6 0000000000001838 0000001c Debug Directory
Entry 7 0000000000000000 00000000 Description Directory
Entry 8 0000000000000000 00000000 Special Directory
Entry 9 0000000000000000 00000000 Thread Storage Directory [.tls]
Entry a 0000000000000000 00000000 Load Configuration Directory
Entry b 0000000000000000 00000000 Bound Import Directory
Entry c 0000000000000000 00000000 Import Address Table Directory
Entry d 0000000000000000 00000000 Delay Import Directory
Entry e 0000000000000000 00000000 CLR Runtime Header
Entry f 0000000000000000 00000000 Reserved

PE File Base Relocations (interpreted .reloc section contents)

Virtual Address: 00001000 Chunk size 128 (0x80) Number of fixups 60
	reloc    0 offset  6c0 [16c0] DIR64
	reloc    1 offset  6c8 [16c8] DIR64
	reloc    2 offset  6d0 [16d0] DIR64
	reloc    3 offset  6d8 [16d8] DIR64
	reloc    4 offset  6e0 [16e0] DIR64
	reloc    5 offset  6e8 [16e8] DIR64
	reloc    6 offset  6f0 [16f0] DIR64
	reloc    7 offset  6f8 [16f8] DIR64
	reloc    8 offset  700 [1700] DIR64
	reloc    9 offset  708 [1708] DIR64
	reloc   10 offset  710 [1710] DIR64
	reloc   11 offset  718 [1718] DIR64
	reloc   12 offset  720 [1720] DIR64
	reloc   13 offset  728 [1728] DIR64
	reloc   14 offset  730 [1730] DIR64
	reloc   15 offset  738 [1738] DIR64
	reloc   16 offset  740 [1740] DIR64
	reloc   17 offset  748 [1748] DIR64
	reloc   18 offset  750 [1750] DIR64
	reloc   19 offset  758 [1758] DIR64
	reloc   20 offset  760 [1760] DIR64
	reloc   21 offset  768 [1768] DIR64
	reloc   22 offset  770 [1770] DIR64
	reloc   23 offset  778 [1778] DIR64
	reloc   24 offset  780 [1780] DIR64
	reloc   25 offset  788 [1788] DIR64
	reloc   26 offset  790 [1790] DIR64
	reloc   27 offset  798 [1798] DIR64
	reloc   28 offset  7a0 [17a0] DIR64
	reloc   29 offset  7a8 [17a8] DIR64
	reloc   30 offset  7b0 [17b0] DIR64
	reloc   31 offset  7b8 [17b8] DIR64
	reloc   32 offset  7c0 [17c0] DIR64
	reloc   33 offset  7c8 [17c8] DIR64
	reloc   34 offset  7d0 [17d0] DIR64
	reloc   35 offset  7d8 [17d8] DIR64
	reloc   36 offset  7e0 [17e0] DIR64
	reloc   37 offset  7e8 [17e8] DIR64
	reloc   38 offset  7f0 [17f0] DIR64
	reloc   39 offset    0 [1000] ABSOLUTE
	reloc   40 offset    0 [1000] ABSOLUTE
	reloc   41 offset    0 [1000] ABSOLUTE
	reloc   42 offset    0 [1000] ABSOLUTE
	reloc   43 offset    0 [1000] ABSOLUTE
	reloc   44 offset    0 [1000] ABSOLUTE
	reloc   45 offset    0 [1000] ABSOLUTE
	reloc   46 offset    0 [1000] ABSOLUTE
	reloc   47 offset    0 [1000] ABSOLUTE
	reloc   48 offset    0 [1000] ABSOLUTE
	reloc   49 offset    0 [1000] ABSOLUTE
	reloc   50 offset    0 [1000] ABSOLUTE
	reloc   51 offset    0 [1000] ABSOLUTE
	reloc   52 offset    0 [1000] ABSOLUTE
	reloc   53 offset    0 [1000] ABSOLUTE
	reloc   54 offset    0 [1000] ABSOLUTE
	reloc   55 offset    0 [1000] ABSOLUTE
	reloc   56 offset    0 [1000] ABSOLUTE
	reloc   57 offset    0 [1000] ABSOLUTE
	reloc   58 offset    0 [1000] ABSOLUTE
	reloc   59 offset    0 [1000] ABSOLUTE

There is a debug directory in .data at 0x1838

Type                Size     Rva      Offset
  2        CodeView 00000075 00001854 00001854
(format NB10 signature 00000000 age 0)

Sections:
Idx Name          Size      VMA               LMA               File off  Algn
  0 .text         00001480  0000000000000240  0000000000000240  00000240  2**4
                  CONTENTS, ALLOC, LOAD, READONLY, CODE
  1 .data         00000240  00000000000016c0  00000000000016c0  000016c0  2**4
                  CONTENTS, ALLOC, LOAD, DATA
  2 .reloc        00000080  0000000000001900  0000000000001900  00001900  2**2
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
SYMBOL TABLE:
no symbols
$ 


Interestingly, the Clang 7.0 toolchain produces a slighly bigger executable than the GCC 7 toolchain I use with UDK2017. If I find time to investigate why, I will update this post.

You should now have sufficient information to start developing UEFI applications on Fedora 29 using the Clang 7.0 toolchain.

Enjoy!

2 comments to Installing And Configuring UDK2018/Clang 7.0 On Fedora 29