@@ -27,12 +27,13 @@ fetch_ulptool_examples() {
2727}
2828
2929fetch_binutils_esp32ulp_examples () {
30- [ -d binutils-esp32ulp ] && return
30+ [ -d binutils-gdb ] && return
3131
32- echo " Fetching binutils-esp32ulp examples"
32+ echo " Fetching binutils-gdb ( esp32ulp) examples"
3333 log_file=log/fetch-binutils.log
3434 git clone --depth 1 \
35- https://github.com/espressif/binutils-esp32ulp.git 1> $log_file 2>&1
35+ -b esp32ulp-elf-v2.35_20220830 \
36+ https://github.com/espressif/binutils-gdb.git 1> $log_file 2>&1
3637}
3738
3839build_defines_db () {
@@ -63,7 +64,7 @@ patch_test() {
6364
6465 if [ " ${test_name} " = esp32ulp_jumpr ]; then
6566 (
66- cd binutils-esp32ulp /gas/testsuite/gas/esp32ulp/esp32
67+ cd binutils-gdb /gas/testsuite/gas/esp32ulp/esp32
6768 cp ${test_name} .s ${out_file}
6869 echo -e " \tPatching test to work around binutils-esp32ulp .global bug"
6970 cat >> ${out_file} << EOF
7475
7576 elif [ " ${test_name} " = esp32ulp_ranges ]; then
7677 (
77- cd binutils-esp32ulp /gas/testsuite/gas/esp32ulp/esp32
78+ cd binutils-gdb /gas/testsuite/gas/esp32ulp/esp32
7879 # merge 2 files: https://github.com/espressif/binutils-esp32ulp/blob/249ec34/gas/testsuite/gas/esp32ulp/esp32/check_as_ld.sh#L31
7980 echo -e " \t${test_name} requires esp32ulp_globals. Merging both files into ${out_file} "
8081 cat esp32ulp_globals.s ${test_name} .s > ${out_file}
81- echo -e " \tPatching test to work around binutils-esp32ulp .global bug"
82+ echo -e " \tPatching test to work around binutils-gdb ( esp32ulp) .global bug"
8283 cat >> ${out_file} << EOF
8384 .global min_add
8485 .global min_jump1
@@ -99,7 +100,7 @@ fetch_ulptool_examples
99100fetch_binutils_esp32ulp_examples
100101build_defines_db $1
101102
102- for src_file in ulptool/src/ulp_examples/* /* .s binutils-esp32ulp /gas/testsuite/gas/esp32ulp/esp32/* .s; do
103+ for src_file in ulptool/src/ulp_examples/* /* .s binutils-gdb /gas/testsuite/gas/esp32ulp/esp32/* .s; do
103104
104105 src_name=" ${src_file% .s} "
105106 src_dir=" ${src_name%/* } "
@@ -116,7 +117,7 @@ for src_file in ulptool/src/ulp_examples/*/*.s binutils-esp32ulp/gas/testsuite/g
116117 fi
117118 done
118119
119- # BEGIN: work around known issues with binutils-esp32ulp
120+ # BEGIN: work around known issues with binutils-gdb ( esp32ulp)
120121 ulp_file=" ${src_name} .ulp"
121122
122123 if patch_test ${test_name} ; then
@@ -125,7 +126,7 @@ for src_file in ulptool/src/ulp_examples/*/*.s binutils-esp32ulp/gas/testsuite/g
125126 src_name=" ${src_file% .tmp} "
126127 ulp_file=" ${src_name} .tmp.ulp" # when extension is not .s, micropython-esp32-ulp doesn't remove original extension
127128 fi
128- # END: work around known issues with binutils-esp32ulp
129+ # END: work around known issues with binutils-gdb ( esp32ulp)
129130
130131 echo -e " \tBuilding using micropython-esp32-ulp"
131132 log_file=" ${src_name} .log"
@@ -140,7 +141,7 @@ for src_file in ulptool/src/ulp_examples/*/*.s binutils-esp32ulp/gas/testsuite/g
140141 gcc -I esp-idf/components/soc/esp32/include -I esp-idf/components/esp_common/include \
141142 -x assembler-with-cpp \
142143 -E -o ${pre_file} $src_file
143- esp32ulp-elf-as -o $obj_file ${pre_file}
144+ esp32ulp-elf-as --mcpu=esp32 - o $obj_file ${pre_file}
144145 esp32ulp-elf-ld -T esp32.ulp.ld -o $elf_file $obj_file
145146 esp32ulp-elf-objcopy -O binary $elf_file $bin_file
146147
0 commit comments