Add notes about GCC 11
authorSophon <strongtz@yeah.net>
星期天, 23 Jan 2022 07:56:50 +0000 (15:56 +0800)
committerSophon <strongtz@yeah.net>
星期天, 23 Jan 2022 07:56:50 +0000 (15:56 +0800)
README.md
README.zh.md

index f289499c56b2ce60db55497ae569173aee64c25c..8dbe1018bd3701ec9f6d2836181821f1cb3dc094 100644 (file)
--- a/README.md
+++ b/README.md
@@ -54,6 +54,24 @@ sudo apt upgrade
 sudo apt install build-essential uuid-dev iasl git nasm gcc-aarch64-linux-gnu abootimg python3-distutils python3-pil python3-git gettext
 ```
 
+If you are using GCC 11+, modify `edk2/BaseTools/Source/C/Makefiles/header.makefile`
+
+```diff
+diff --git a/BaseTools/Source/C/Makefiles/header.makefile b/BaseTools/Source/C/Makefiles/header.makefile
+index 0df728f..247c917 100644
+--- a/BaseTools/Source/C/Makefiles/header.makefile
++++ b/BaseTools/Source/C/Makefiles/header.makefile
+@@ -92,7 +92,7 @@ BUILD_CFLAGS = -MD -fshort-wchar -fno-strict-aliasing -fwrapv \
+ -Wno-unused-result -nostdlib -g
+ else
+ BUILD_CFLAGS = -MD -fshort-wchar -fno-strict-aliasing -fwrapv \
+--fno-delete-null-pointer-checks -Wall -Werror \
++-fno-delete-null-pointer-checks -Wall \^M
+ -Wno-deprecated-declarations -Wno-stringop-truncation -Wno-restrict \
+ -Wno-unused-result -nostdlib -g
+ endif
+```
+
 ## Building
 
 1.Clone this project
index 7b0b78a96b590d280f41876456303583d228034f..a0fffcac77248526e7c79e235f1407676384f3ef 100644 (file)
@@ -55,6 +55,24 @@ sudo apt upgrade
 sudo apt install build-essential uuid-dev iasl git nasm gcc-aarch64-linux-gnu abootimg python3-distutils python3-pil python3-git gettext\r
 ```\r
 \r
+如果你的编译器为 GCC 11+, 请手动修改 `edk2/BaseTools/Source/C/Makefiles/header.makefile`\r
+\r
+```diff\r
+diff --git a/BaseTools/Source/C/Makefiles/header.makefile b/BaseTools/Source/C/Makefiles/header.makefile\r
+index 0df728f..247c917 100644\r
+--- a/BaseTools/Source/C/Makefiles/header.makefile\r
++++ b/BaseTools/Source/C/Makefiles/header.makefile\r
+@@ -92,7 +92,7 @@ BUILD_CFLAGS = -MD -fshort-wchar -fno-strict-aliasing -fwrapv \\r
+ -Wno-unused-result -nostdlib -g\r
+ else\r
+ BUILD_CFLAGS = -MD -fshort-wchar -fno-strict-aliasing -fwrapv \\r
+--fno-delete-null-pointer-checks -Wall -Werror \\r
++-fno-delete-null-pointer-checks -Wall \^M\r
+ -Wno-deprecated-declarations -Wno-stringop-truncation -Wno-restrict \\r
+ -Wno-unused-result -nostdlib -g\r
+ endif\r
+```\r
+\r
 ## 构建\r
 \r
 **不建议使用Ubuntu 18.04版本,请使用Ubuntu 20.04**\r