From 7af10249595349420b99731df58f19f296d76302 Mon Sep 17 00:00:00 2001 From: jljusten Date: Tue, 31 Jul 2012 17:54:18 +0000 Subject: [PATCH] OvmfPkg: Disable debugging for UNIXGCC to save space UNIXGCC builds larger images than GCC44, and can have issues fitting into the FD image. Therefore, when using UNIXGCC, debug will be disabled by default. The README file is updated with instructions for selectively enabling debug for UNIXGCC. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jordan Justen Reviewed-by: Laszlo Ersek git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13569 6f19259b-4bc3-4df7-8a09-765794883524 MU SOURCE COMMIT:0b5a5022e5b5377d07d06e6c330fd4305ac47f9d --- Platforms/OvmfPkg/OvmfPkgIa32.dsc | 1 + Platforms/OvmfPkg/OvmfPkgIa32X64.dsc | 1 + Platforms/OvmfPkg/OvmfPkgX64.dsc | 1 + Platforms/OvmfPkg/README | 19 +++++++++++++++++++ 4 files changed, 22 insertions(+) diff --git a/Platforms/OvmfPkg/OvmfPkgIa32.dsc b/Platforms/OvmfPkg/OvmfPkgIa32.dsc index 9b6b13b8..ba27f3b0 100644 --- a/Platforms/OvmfPkg/OvmfPkgIa32.dsc +++ b/Platforms/OvmfPkg/OvmfPkgIa32.dsc @@ -36,6 +36,7 @@ DEFINE SECURE_BOOT_ENABLE = FALSE [BuildOptions] + GCC:*_UNIXGCC_*_CC_FLAGS = -DMDEPKG_NDEBUG GCC:RELEASE_*_*_CC_FLAGS = -DMDEPKG_NDEBUG INTEL:RELEASE_*_*_CC_FLAGS = /D MDEPKG_NDEBUG MSFT:RELEASE_*_*_CC_FLAGS = /D MDEPKG_NDEBUG diff --git a/Platforms/OvmfPkg/OvmfPkgIa32X64.dsc b/Platforms/OvmfPkg/OvmfPkgIa32X64.dsc index cdd4518b..e696efef 100644 --- a/Platforms/OvmfPkg/OvmfPkgIa32X64.dsc +++ b/Platforms/OvmfPkg/OvmfPkgIa32X64.dsc @@ -36,6 +36,7 @@ DEFINE SECURE_BOOT_ENABLE = FALSE [BuildOptions] + GCC:*_UNIXGCC_*_CC_FLAGS = -DMDEPKG_NDEBUG GCC:RELEASE_*_*_CC_FLAGS = -DMDEPKG_NDEBUG INTEL:RELEASE_*_*_CC_FLAGS = /D MDEPKG_NDEBUG MSFT:RELEASE_*_*_CC_FLAGS = /D MDEPKG_NDEBUG diff --git a/Platforms/OvmfPkg/OvmfPkgX64.dsc b/Platforms/OvmfPkg/OvmfPkgX64.dsc index 920e98dd..a4ae3a6d 100644 --- a/Platforms/OvmfPkg/OvmfPkgX64.dsc +++ b/Platforms/OvmfPkg/OvmfPkgX64.dsc @@ -36,6 +36,7 @@ DEFINE SECURE_BOOT_ENABLE = FALSE [BuildOptions] + GCC:*_UNIXGCC_*_CC_FLAGS = -DMDEPKG_NDEBUG GCC:RELEASE_*_*_CC_FLAGS = -DMDEPKG_NDEBUG INTEL:RELEASE_*_*_CC_FLAGS = /D MDEPKG_NDEBUG MSFT:RELEASE_*_*_CC_FLAGS = /D MDEPKG_NDEBUG diff --git a/Platforms/OvmfPkg/README b/Platforms/OvmfPkg/README index fc1d8983..7e82cf33 100644 --- a/Platforms/OvmfPkg/README +++ b/Platforms/OvmfPkg/README @@ -115,3 +115,22 @@ To add network drivers to OVMF: -net nic,model=e1000,addr=3 -net nic,model=e1000,addr=4 -net user,restrict=yes -net user,dhcpstart=10.0.2.10 +=== UNIXGCC Debug === + +If you build with the UNIXGCC toolchain, then debugging will be disabled +due to larger image sizes being produced by the UNIXGCC toolchain. The +first choice recommendation is to use GCC44 or newer instead. + +If you must use UNIXGCC, then you can override the build options for +particular libraries and modules in the .dsc to re-enable debugging +selectively. For example: + [Components] + OvmfPkg/Library/PlatformBdsLib/PlatformBdsLib.inf { + + GCC:*_*_*_CC_FLAGS = -UMDEPKG_NDEBUG + } + IntelFrameworkModulePkg/Universal/BdsDxe/BdsDxe.inf { + + GCC:*_*_*_CC_FLAGS = -UMDEPKG_NDEBUG + } +