diff --git a/make_scripts_riscv/project.mk b/make_scripts_riscv/project.mk index 66c41c7b..0d078bb4 100644 --- a/make_scripts_riscv/project.mk +++ b/make_scripts_riscv/project.mk @@ -183,11 +183,16 @@ export COMPONENT_INCLUDES include $(BL60X_SDK_PATH)/make_scripts_riscv/common.mk include $(BL60X_SDK_PATH)/make_scripts_riscv/toolchain.mk +# In this recipe, "pip install" may need to build native code, so make sure it +# doesn't use the cross-compilation environment. The specific list of variables +# unset is taken from the intersection of what we export and what Python's +# distutils uses (see CPython's Lib/distutils/sysconfig.py). all: ifeq ("$(OS)","Windows_NT") else ifeq ("$(CONFIG_CHIP_NAME)", "BL602") - @cd $(BL60X_SDK_PATH)/image_conf && python3 -m pip install -r requirements.txt && python3 flash_build.py $(PROJECT_NAME) $(CONFIG_CHIP_NAME) + @env -u CC -u CXX -u AR -u CFLAGS -u CPPFLAGS python3 -m pip install -r $(BL60X_SDK_PATH)/image_conf/requirements.txt + @cd $(BL60X_SDK_PATH)/image_conf && python3 flash_build.py $(PROJECT_NAME) $(CONFIG_CHIP_NAME) endif endif @echo "Building Finish. To flash build output."