diff options
-rw-r--r-- | uefi/compiler/pmodules.pas | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/uefi/compiler/pmodules.pas b/uefi/compiler/pmodules.pas index c662cba6b2..117b3b6bae 100644 --- a/uefi/compiler/pmodules.pas +++ b/uefi/compiler/pmodules.pas @@ -1865,6 +1865,10 @@ type i : Longint; sysinitmod: tmodule; begin + // Under UEFI, an application is technically a dll. + // So, we build both programs and libraries as libraries + if target_info.system in [system_i386_uefi] then + IsLibrary := true; Status.IsLibrary:=IsLibrary; Status.IsPackage:=false; Status.IsExe:=true; @@ -1911,7 +1915,19 @@ type if islibrary then begin - consume(_LIBRARY); + if target_info.system in [system_i386_uefi] then + begin + // For UEFI targets, every binaries are libraries. + // So, we treat 'program' as 'library' as well. + if not try_to_consume(_LIBRARY) then + begin + consume(_PROGRAM); + end; + end + else + begin + consume(_LIBRARY); + end; program_name:=orgpattern; consume(_ID); while token=_POINT do |