Giter Club home page Giter Club logo

Comments (7)

jforissier avatar jforissier commented on June 14, 2024

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.

from build.

TaihuLight avatar TaihuLight commented on June 14, 2024

@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.

from build.

jforissier avatar jforissier commented on June 14, 2024

@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!

from build.

TaihuLight avatar TaihuLight commented on June 14, 2024

@jforissier
I am very sorry for that. The method #652 (comment) 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?

from build.

jforissier avatar jforissier commented on June 14, 2024

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.

from build.

TaihuLight avatar TaihuLight commented on June 14, 2024

@jforissier Thank you very much. The suggestion #652 (comment) 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.

from build.

github-actions avatar github-actions commented on June 14, 2024

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.

from build.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.