Closed TaihuLight closed 1 year ago
Try this:
diff --git a/hikey960.mk b/hikey960.mk
index dbff5c2..af167b3 100644
--- a/hikey960.mk
+++ b/hikey960.mk
@@ -134,7 +134,7 @@ edk2:
ln -s $(OPENPLATPKG_PATH)
set -e && cd $(EDK2_PATH) && source edksetup.sh && \
$(MAKE) -j1 -C $(EDK2_PATH)/BaseTools \
- BUILD_CC="gcc $(call cc-option,gcc,-Wno-error=stringop-truncation,)" && \
+ BUILD_CC="gcc $(call cc-option,gcc,-Wno-error=stringop-truncation,) $(call cc-option,gcc,-Wno-error=stringop-overflow,)" && \
$(call edk2-call)
.PHONY: edk2-cleandiff --git a/hikey960.mk b/hikey960.mk
EDK2 for HiKey is unmaintained, so unless someone takes up this task it is likely that sooner or later we will have to drop it and use something else (U-Boot), or even remove HiKey in OP-TEE support entirely.
@jforissier I will try to do it tomorrow, and reply you timely. please do not remove OP-TEE support for hikey960. It is important for reseachers.
@jforissier I will try to do it tomorrow, and reply you timely. please do not remove OP-TEE support for hikey960. It is important for reseachers.
Don't worry, we will not remove anything unless there is a good reason and we will always discuss here first. I am glad to hear that people are still using HiKey, and I hope we can get patches to make it live longer! I personally used to use HiKey/HiKey960 a lot, but not so much so.
If my above suggestion works for you, please create a pull request so it can be merged (note that the hikey.mk
file needs the same fix too I suppose). Thanks!
@jforissier I am very sorry for that. The method https://github.com/OP-TEE/build/issues/652#issuecomment-1585681108 does not work. The same error occurred. This issue may arise from the default toolchain version 11.3 being too new, Because I could build OP-TEE for Hikey 960 with the old toolchain version 10.2 as following (also shown in #625)
$ cd build
$ make -j4 toolchains AARCH32_GCC_VERSION= gcc-arm-10.2-2020.11-x86_64-arm-none-linux-gnueabihf SRC_AARCH32_GCC= https://developer.arm.com/-/media/Files/downloads/gnu-a/10.2-2020.11/binrel/$(AARCH32_GCC_VERSION).tar.xz
AARCH64_GCC_VERSION= gcc-arm-10.2-2020.11-x86_64-aarch64-none-linux-gnu SRC_AARCH64_GCC = https://developer.arm.com/-/media/Files/downloads/gnu-a/10.2-2020.11/binrel/$(AARCH64_GCC_VERSION).tar.xz
$ make all -j6 PLATFORM=hikey-hikey960 CFG_DRAM_SIZE_GB=4 BR2_TOOLCHAIN_EXTERNAL_GCC_10=y BR2_TOOLCHAIN_EXTERNAL_INET_RPC=y
So, how to fix this issue for building OP-TEE 3.21.0 for Hikey 960 with the default GCC toolchain version 11.3?
In fact, the C flags have to be modified in GCC_ALL_CC_FLAGS
in edk2/BaseTools/Conf/tools_def.template
like so:
diff --git a/BaseTools/Conf/tools_def.template b/BaseTools/Conf/tools_def.template
index 2b4fb47ec..8a58208e8 100755
--- a/BaseTools/Conf/tools_def.template
+++ b/BaseTools/Conf/tools_def.template
@@ -4338,7 +4338,7 @@ DEBUG_*_*_OBJCOPY_ADDDEBUGFLAG = --add-gnu-debuglink=$(DEBUG_DIR)/$(MODULE_N
RELEASE_*_*_OBJCOPY_ADDDEBUGFLAG =
NOOPT_*_*_OBJCOPY_ADDDEBUGFLAG = --add-gnu-debuglink=$(DEBUG_DIR)/$(MODULE_NAME).debug
-DEFINE GCC_ALL_CC_FLAGS = -g -Os -fshort-wchar -fno-strict-aliasing -Wall -Werror -Wno-array-bounds -include AutoGen.h -fno-common
+DEFINE GCC_ALL_CC_FLAGS = -g -Os -fshort-wchar -fno-strict-aliasing -Wall -Werror -Wno-array-bounds -Wno-stringop-overflow -include AutoGen.h -fno-common^M
DEFINE GCC_IA32_CC_FLAGS = DEF(GCC_ALL_CC_FLAGS) -m32 -malign-double -freorder-blocks -freorder-blocks-and-partition -O2 -mno-stack-arg-probe
DEFINE GCC_X64_CC_FLAGS = DEF(GCC_ALL_CC_FLAGS) -mno-red-zone -Wno-address -mno-stack-arg-probe
DEFINE GCC_IPF_CC_FLAGS = DEF(GCC_ALL_CC_FLAGS) -minline-int-divide-min-latency
Please refer to this Dockerfile, it worked for me: Dockerfile.txt
Perhaps we should add the sed
command to hikey{,960}.mk
.
@jforissier Thank you very much. The suggestion https://github.com/OP-TEE/build/issues/652#issuecomment-1586324847 is work for me. I would like to test OP-TEE support for Hikey 960 and then report the results. This work may be complemented in later, because I must buy a new UART-USB for testing the result.
This issue has been marked as a stale issue because it has been open (more than) 30 days with no activity. Remove the stale label or add a comment saying that you would like to have the label removed otherwise this issue will automatically be closed in 5 days. Note, that you can always re-open a closed issue at any time.
OP-TEE 3.20.0 can be built on my host PC successfully. But, OP-TEE 3.21.0 can not be built successfully on the same PC with the same environment. Errors shows as following:
@jforissier @jbech-linaro @jenswi-linaro