]> granicus.if.org Git - esp-idf/commitdiff
ldgen: remove resolution of template includes
authorRenz Christian Bagaporo <renz@espressif.com>
Thu, 21 Feb 2019 06:11:09 +0000 (14:11 +0800)
committerRenz Christian Bagaporo <renz@espressif.com>
Fri, 22 Feb 2019 00:25:56 +0000 (08:25 +0800)
make/ldgen.mk
tools/ci/executable-list.txt
tools/ci/test_build_system.sh
tools/ci/test_build_system_cmake.sh
tools/cmake/ldgen.cmake
tools/ldgen/lddeps.py [deleted file]

index 244de16904ddba9705a40e0ac8e81abd86a0fb82..705edcb56d6c3b1037d1abd326c4368911224825 100644 (file)
@@ -18,8 +18,7 @@ define ldgen_process_template
 $(BUILD_DIR_BASE)/ldgen.section_infos: $(LDGEN_SECTIONS_INFO_FILES) $(IDF_PATH)/make/ldgen.mk
        printf "$(foreach info,$(LDGEN_SECTIONS_INFO_FILES),$(subst \,/,$(shell cygpath -w $(info)))\n)" > $(BUILD_DIR_BASE)/ldgen.section_infos
 
-$(2): $(1) $(LDGEN_FRAGMENT_FILES) $(SDKCONFIG) $(BUILD_DIR_BASE)/ldgen.section_infos \
-$(shell $(PYTHON) $(IDF_PATH)/tools/ldgen/lddeps.py $(abspath $(1)))
+$(2): $(1) $(LDGEN_FRAGMENT_FILES) $(SDKCONFIG) $(BUILD_DIR_BASE)/ldgen.section_infos
        @echo 'Generating $(notdir $(2))'
        $(PYTHON) $(IDF_PATH)/tools/ldgen/ldgen.py \
                --input         $(1) \
@@ -37,8 +36,7 @@ define ldgen_process_template
 $(BUILD_DIR_BASE)/ldgen.section_infos: $(LDGEN_SECTIONS_INFO_FILES) $(IDF_PATH)/make/ldgen.mk
        printf "$(foreach info,$(LDGEN_SECTIONS_INFO_FILES),$(info)\n)" > $(BUILD_DIR_BASE)/ldgen.section_infos
 
-$(2): $(1) $(LDGEN_FRAGMENT_FILES) $(SDKCONFIG) $(BUILD_DIR_BASE)/ldgen.section_infos \
-$(shell $(PYTHON) $(IDF_PATH)/tools/ldgen/lddeps.py $(abspath $(1)))
+$(2): $(1) $(LDGEN_FRAGMENT_FILES) $(SDKCONFIG) $(BUILD_DIR_BASE)/ldgen.section_infos 
        @echo 'Generating $(notdir $(2))'
        $(PYTHON) $(IDF_PATH)/tools/ldgen/ldgen.py \
                --input         $(1) \
index ba84bd2134264d373c6657cc4c7b8de7eb061c0e..06821ebbd9179405823fc306c6604fb320e3da2c 100644 (file)
@@ -66,7 +66,6 @@ tools/ci/multirun_with_pyenv.sh
 components/espcoredump/test/test_espcoredump.py
 components/espcoredump/test/test_espcoredump.sh
 tools/ldgen/ldgen.py
-tools/ldgen/lddeps.py
 tools/ldgen/test/test_fragments.py
 tools/ldgen/test/test_generation.py
 examples/build_system/cmake/idf_as_lib/build.sh
index 4c49de625fc988aef982e0c546aeba10f84b46e5..99da318d61c6f91acb2ce3ef2aba3a4b16263bec 100755 (executable)
@@ -171,13 +171,6 @@ function run_tests()
     assert_rebuilt ${APP_BINS}
     assert_not_rebuilt ${BOOTLOADER_BINS}
 
-    print_status "Touching linker script included in template should re-link app"
-    take_build_snapshot
-    touch ${IDF_PATH}/components/esp32/ld/esp32.spiram.rom-functions-iram.ld
-    make
-    assert_rebuilt ${APP_BINS}
-    assert_not_rebuilt ${BOOTLOADER_BINS}
-
     print_status "sdkconfig update triggers full recompile"
     make
     take_build_snapshot
index 48ef8c18571f84e2f884d4c42dfd46fa1a82a19f..3fb5cb103ddd5b32aaac36b71e0a9ef5ceebaf1d 100755 (executable)
@@ -186,16 +186,6 @@ function run_tests()
     assert_not_rebuilt ${BOOTLOADER_BINS}
     mv esp32_fragments.lf ${IDF_PATH}/components/esp32/ld/
 
-    print_status "Updating linker script included in template should re-link app"
-    take_build_snapshot
-    cp ${IDF_PATH}/components/esp32/ld/esp32.spiram.rom-functions-iram.ld .
-    sleep 1  # ninja may ignore if the timestamp delta is too low
-    echo "/* (Build test comment) */" >> ${IDF_PATH}/components/esp32/ld/esp32.spiram.rom-functions-iram.ld
-    idf.py build || failure "Failed to build with modified linker script included in template"
-    assert_rebuilt ${APP_BINS}
-    assert_not_rebuilt ${BOOTLOADER_BINS}
-    mv esp32.spiram.rom-functions-iram.ld ${IDF_PATH}/components/esp32/ld/
-
     print_status "sdkconfig update triggers full recompile"
     clean_build_dir
     idf.py build
index 6ea6d5d8309971d8fe6913cf4e948b1fb688edc5..8cc277986e74e727ed07aef07df2c76fbd29e25c 100644 (file)
@@ -47,18 +47,6 @@ endfunction()
 # Passes a linker script template to the linker script generation tool for
 # processing
 function(ldgen_process_template template output)
-    get_filename_component(template ${template} ABSOLUTE BASE_DIR ${CMAKE_CURRENT_LIST_DIR})
-    execute_process(COMMAND ${PYTHON} ${IDF_PATH}/tools/ldgen/lddeps.py ${template}
-                    OUTPUT_VARIABLE template_includes
-                    ERROR_VARIABLE template_includes_err
-                    )
-
-    if(template_includes_err)
-        message(FATAL_ERROR "Unable to parse linker script template for INCLUDEs\n" ${template_includes_err})
-    endif()
-
-    spaces2list(template_includes)
-
     file(GENERATE OUTPUT ${CMAKE_BINARY_DIR}/ldgen.section_infos
         CONTENT "$<JOIN:$<TARGET_PROPERTY:ldgen_section_infos,SECTIONS_INFO_FILES>,\n>")
 
@@ -78,7 +66,7 @@ function(ldgen_process_template template output)
         --env       "IDF_PATH=${IDF_PATH}"
         --env       "IDF_TARGET=${IDF_TARGET}"
         DEPENDS     ${template} $<TARGET_PROPERTY:ldgen,FRAGMENT_FILES> ${SDKCONFIG}
-                    ldgen_section_infos ${template_includes}
+                    ldgen_section_infos
     )
 
     get_filename_component(output_name ${output} NAME)
diff --git a/tools/ldgen/lddeps.py b/tools/ldgen/lddeps.py
deleted file mode 100644 (file)
index f396395..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-
-# !/usr/bin/env python
-#
-# Copyright 2019 Espressif Systems (Shanghai) PTE LTD
-#
-# This script is used by the linker script generation in order to list a template's
-# INCLUDE'd linker scripts recursively. This is so that updates to these INCLUDE'd
-# scripts also trigger a relink of the app.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-import os
-import re
-import argparse
-
-
-INCLUDE_PATTERN = re.compile(r"INCLUDE[\t ]+([^\n]+)")
-
-
-def find_includes(file_path, includes_list):
-    # Find include files recursively
-    file_dir = os.path.dirname(file_path)
-
-    with open(file_path, "r") as f:
-        includes_list.append(file_path)
-        includes = re.findall(INCLUDE_PATTERN, f.read())
-
-    for include in includes:
-        include_file_path = os.path.abspath(os.path.join(file_dir, include))
-        find_includes(include_file_path, includes_list)
-
-
-def main():
-    argparser = argparse.ArgumentParser(description="List INCLUDE'd linker scripts recursively")
-    argparser.add_argument("input", help="input linker script")
-    args = argparser.parse_args()
-
-    includes_list = list()
-    find_includes(args.input, includes_list)
-    includes_list.remove(args.input)
-
-    print(" ".join(includes_list))
-
-
-if __name__ == "__main__":
-    main()