Skip to content

Commit

Permalink
devel/xtensa-esp-elf@idf54: add experimental esp8266 support
Browse files Browse the repository at this point in the history
  • Loading branch information
trombik committed Nov 2, 2024
1 parent 51fa4b6 commit 55558b8
Show file tree
Hide file tree
Showing 3 changed files with 101 additions and 0 deletions.
8 changes: 8 additions & 0 deletions devel/xtensa-esp-elf/Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
PORTNAME?= xtensa-esp-elf
PORTVERSION= ${ESPRESSIF_VERSION:S/esp-//:S/_/./}
PORTREVISION= 1
CATEGORIES= devel
MASTER_SITES=
DISTFILES=
Expand Down Expand Up @@ -196,6 +197,7 @@ ESP_REMOVE_BEFORE_DO_INSTALL= \
GH_TUPLE+= espressif:picolibc:${ESPRESSIF_PICOLIBC_TAG}:source109
EXTRACT_ONLY+= espressif-picolibc-${ESPRESSIF_PICOLIBC_TAG}_GH0.tar.gz
ESP_REMOVE_BEFORE_DO_INSTALL+= espressif-picolibc-${ESPRESSIF_PICOLIBC_TAG}
XTENSA_ESP_TOOLCHAIN_BIN_WRAPPERS_CHIPS+= esp8266
.endif

PATCHDIR= ${MASTERDIR}/files/${FLAVOR}
Expand Down Expand Up @@ -261,6 +263,12 @@ post-extract:
${LN} -s ${WRKDIR}/esp-toolchain-bin-wrappers-${XTENSA_ESP_TOOLCHAIN_BIN_WRAPPERS_TAGNAME} ${BUILD_WRKSRC}/esp-toolchain-bin-wrappers
.endif

post-patch:
.if ${PORTNAME} == xtensa-esp-elf && ${FLAVOR} == idf54
@${ECHO_MSG} "===> Applying ESP8266 support patch to gcc-${ESPRESSIF_GCC_TAG}"
@(cd ${WRKDIR}/gcc-${ESPRESSIF_GCC_TAG} && ${PATCH} ${PATCH_ARGS} < ${FILESDIR}/${FLAVOR}/esp8266.patch)
.endif

pre-configure:
@${REINPLACE_CMD} -e 's/\(GNU bash, version.*4\)/\1|5/' \
${WRKSRC}/configure.ac
Expand Down
15 changes: 15 additions & 0 deletions devel/xtensa-esp-elf/files/idf54/esp8266.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
--- gcc/config/xtensa/t-esp-multilib.orig 2024-11-02 08:04:05.650057000 +0700
+++ gcc/config/xtensa/t-esp-multilib 2024-11-02 08:05:42.000992000 +0700
@@ -16,9 +16,9 @@
# along with GCC; see the file COPYING3. If not see
# <http://www.gnu.org/licenses/>.

-MULTILIB_OPTIONS = mdynconfig=xtensa_esp32.so/mdynconfig=xtensa_esp32s2.so/mdynconfig=xtensa_esp32s3.so mfix-esp32-psram-cache-issue fno-rtti
-MULTILIB_DIRNAMES = esp32 esp32s2 esp32s3 psram no-rtti
-MULTILIB_REQUIRED = mdynconfig=xtensa_esp32.so mdynconfig=xtensa_esp32.so/fno-rtti \
+MULTILIB_OPTIONS = mdynconfig=xtensa_esp8266.so/mdynconfig=xtensa_esp32.so/mdynconfig=xtensa_esp32s2.so/mdynconfig=xtensa_esp32s3.so mfix-esp32-psram-cache-issue fno-rtti
+MULTILIB_DIRNAMES = esp8266 esp32 esp32s2 esp32s3 psram no-rtti
+MULTILIB_REQUIRED = mdynconfig=xtensa_esp8266.so mdynconfig=xtensa_esp32.so mdynconfig=xtensa_esp32.so/fno-rtti \
mdynconfig=xtensa_esp32.so/mfix-esp32-psram-cache-issue mdynconfig=xtensa_esp32.so/mfix-esp32-psram-cache-issue/fno-rtti \
mdynconfig=xtensa_esp32s2.so mdynconfig=xtensa_esp32s2.so/fno-rtti \
mdynconfig=xtensa_esp32s3.so mdynconfig=xtensa_esp32s3.so/fno-rtti
78 changes: 78 additions & 0 deletions devel/xtensa-esp-elf/pkg-plist.xtensa-esp-elf-idf54
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,34 @@ xtensa-esp-elf-idf54/bin/xtensa-esp32s3-elf-readelf
xtensa-esp-elf-idf54/bin/xtensa-esp32s3-elf-size
xtensa-esp-elf-idf54/bin/xtensa-esp32s3-elf-strings
xtensa-esp-elf-idf54/bin/xtensa-esp32s3-elf-strip
xtensa-esp-elf-idf54/bin/xtensa-esp8266-elf-addr2line
xtensa-esp-elf-idf54/bin/xtensa-esp8266-elf-ar
xtensa-esp-elf-idf54/bin/xtensa-esp8266-elf-as
xtensa-esp-elf-idf54/bin/xtensa-esp8266-elf-c++
xtensa-esp-elf-idf54/bin/xtensa-esp8266-elf-c++filt
xtensa-esp-elf-idf54/bin/xtensa-esp8266-elf-cpp
xtensa-esp-elf-idf54/bin/xtensa-esp8266-elf-elfedit
xtensa-esp-elf-idf54/bin/xtensa-esp8266-elf-g++
xtensa-esp-elf-idf54/bin/xtensa-esp8266-elf-gcc
xtensa-esp-elf-idf54/bin/xtensa-esp8266-elf-gcc-14.2.0
xtensa-esp-elf-idf54/bin/xtensa-esp8266-elf-gcc-ar
xtensa-esp-elf-idf54/bin/xtensa-esp8266-elf-gcc-nm
xtensa-esp-elf-idf54/bin/xtensa-esp8266-elf-gcc-ranlib
xtensa-esp-elf-idf54/bin/xtensa-esp8266-elf-gcov
xtensa-esp-elf-idf54/bin/xtensa-esp8266-elf-gcov-dump
xtensa-esp-elf-idf54/bin/xtensa-esp8266-elf-gcov-tool
xtensa-esp-elf-idf54/bin/xtensa-esp8266-elf-gprof
xtensa-esp-elf-idf54/bin/xtensa-esp8266-elf-ld
xtensa-esp-elf-idf54/bin/xtensa-esp8266-elf-ld.bfd
xtensa-esp-elf-idf54/bin/xtensa-esp8266-elf-lto-dump
xtensa-esp-elf-idf54/bin/xtensa-esp8266-elf-nm
xtensa-esp-elf-idf54/bin/xtensa-esp8266-elf-objcopy
xtensa-esp-elf-idf54/bin/xtensa-esp8266-elf-objdump
xtensa-esp-elf-idf54/bin/xtensa-esp8266-elf-ranlib
xtensa-esp-elf-idf54/bin/xtensa-esp8266-elf-readelf
xtensa-esp-elf-idf54/bin/xtensa-esp8266-elf-size
xtensa-esp-elf-idf54/bin/xtensa-esp8266-elf-strings
xtensa-esp-elf-idf54/bin/xtensa-esp8266-elf-strip
xtensa-esp-elf-idf54/lib/bfd-plugins/libdep.so
xtensa-esp-elf-idf54/lib/bfd-plugins/liblto_plugin.so
xtensa-esp-elf-idf54/lib/gcc/xtensa-esp-elf/14.2.0/crtbegin.o
Expand Down Expand Up @@ -166,6 +194,12 @@ xtensa-esp-elf-idf54/lib/gcc/xtensa-esp-elf/14.2.0/esp32s3/no-rtti/crti.o
xtensa-esp-elf-idf54/lib/gcc/xtensa-esp-elf/14.2.0/esp32s3/no-rtti/crtn.o
xtensa-esp-elf-idf54/lib/gcc/xtensa-esp-elf/14.2.0/esp32s3/no-rtti/libgcc.a
xtensa-esp-elf-idf54/lib/gcc/xtensa-esp-elf/14.2.0/esp32s3/no-rtti/libgcov.a
xtensa-esp-elf-idf54/lib/gcc/xtensa-esp-elf/14.2.0/esp8266/crtbegin.o
xtensa-esp-elf-idf54/lib/gcc/xtensa-esp-elf/14.2.0/esp8266/crtend.o
xtensa-esp-elf-idf54/lib/gcc/xtensa-esp-elf/14.2.0/esp8266/crti.o
xtensa-esp-elf-idf54/lib/gcc/xtensa-esp-elf/14.2.0/esp8266/crtn.o
xtensa-esp-elf-idf54/lib/gcc/xtensa-esp-elf/14.2.0/esp8266/libgcc.a
xtensa-esp-elf-idf54/lib/gcc/xtensa-esp-elf/14.2.0/esp8266/libgcov.a
xtensa-esp-elf-idf54/lib/gcc/xtensa-esp-elf/14.2.0/include-fixed/README
xtensa-esp-elf-idf54/lib/gcc/xtensa-esp-elf/14.2.0/include/float.h
xtensa-esp-elf-idf54/lib/gcc/xtensa-esp-elf/14.2.0/include/gcov.h
Expand Down Expand Up @@ -1884,6 +1918,29 @@ xtensa-esp-elf-idf54/xtensa-esp-elf/include/c++/14.2.0/xtensa-esp-elf/esp32s3/no
xtensa-esp-elf-idf54/xtensa-esp-elf/include/c++/14.2.0/xtensa-esp-elf/esp32s3/no-rtti/bits/stdtr1c++.h
xtensa-esp-elf-idf54/xtensa-esp-elf/include/c++/14.2.0/xtensa-esp-elf/esp32s3/no-rtti/bits/time_members.h
xtensa-esp-elf-idf54/xtensa-esp-elf/include/c++/14.2.0/xtensa-esp-elf/esp32s3/no-rtti/ext/opt_random.h
xtensa-esp-elf-idf54/xtensa-esp-elf/include/c++/14.2.0/xtensa-esp-elf/esp8266/bits/atomic_word.h
xtensa-esp-elf-idf54/xtensa-esp-elf/include/c++/14.2.0/xtensa-esp-elf/esp8266/bits/basic_file.h
xtensa-esp-elf-idf54/xtensa-esp-elf/include/c++/14.2.0/xtensa-esp-elf/esp8266/bits/c++allocator.h
xtensa-esp-elf-idf54/xtensa-esp-elf/include/c++/14.2.0/xtensa-esp-elf/esp8266/bits/c++config.h
xtensa-esp-elf-idf54/xtensa-esp-elf/include/c++/14.2.0/xtensa-esp-elf/esp8266/bits/c++io.h
xtensa-esp-elf-idf54/xtensa-esp-elf/include/c++/14.2.0/xtensa-esp-elf/esp8266/bits/c++locale.h
xtensa-esp-elf-idf54/xtensa-esp-elf/include/c++/14.2.0/xtensa-esp-elf/esp8266/bits/cpu_defines.h
xtensa-esp-elf-idf54/xtensa-esp-elf/include/c++/14.2.0/xtensa-esp-elf/esp8266/bits/ctype_base.h
xtensa-esp-elf-idf54/xtensa-esp-elf/include/c++/14.2.0/xtensa-esp-elf/esp8266/bits/ctype_inline.h
xtensa-esp-elf-idf54/xtensa-esp-elf/include/c++/14.2.0/xtensa-esp-elf/esp8266/bits/cxxabi_tweaks.h
xtensa-esp-elf-idf54/xtensa-esp-elf/include/c++/14.2.0/xtensa-esp-elf/esp8266/bits/error_constants.h
xtensa-esp-elf-idf54/xtensa-esp-elf/include/c++/14.2.0/xtensa-esp-elf/esp8266/bits/extc++.h
xtensa-esp-elf-idf54/xtensa-esp-elf/include/c++/14.2.0/xtensa-esp-elf/esp8266/bits/gthr-default.h
xtensa-esp-elf-idf54/xtensa-esp-elf/include/c++/14.2.0/xtensa-esp-elf/esp8266/bits/gthr-posix.h
xtensa-esp-elf-idf54/xtensa-esp-elf/include/c++/14.2.0/xtensa-esp-elf/esp8266/bits/gthr-single.h
xtensa-esp-elf-idf54/xtensa-esp-elf/include/c++/14.2.0/xtensa-esp-elf/esp8266/bits/gthr.h
xtensa-esp-elf-idf54/xtensa-esp-elf/include/c++/14.2.0/xtensa-esp-elf/esp8266/bits/messages_members.h
xtensa-esp-elf-idf54/xtensa-esp-elf/include/c++/14.2.0/xtensa-esp-elf/esp8266/bits/opt_random.h
xtensa-esp-elf-idf54/xtensa-esp-elf/include/c++/14.2.0/xtensa-esp-elf/esp8266/bits/os_defines.h
xtensa-esp-elf-idf54/xtensa-esp-elf/include/c++/14.2.0/xtensa-esp-elf/esp8266/bits/stdc++.h
xtensa-esp-elf-idf54/xtensa-esp-elf/include/c++/14.2.0/xtensa-esp-elf/esp8266/bits/stdtr1c++.h
xtensa-esp-elf-idf54/xtensa-esp-elf/include/c++/14.2.0/xtensa-esp-elf/esp8266/bits/time_members.h
xtensa-esp-elf-idf54/xtensa-esp-elf/include/c++/14.2.0/xtensa-esp-elf/esp8266/ext/opt_random.h
xtensa-esp-elf-idf54/xtensa-esp-elf/include/c++/14.2.0/xtensa-esp-elf/ext/opt_random.h
xtensa-esp-elf-idf54/xtensa-esp-elf/include/complex.h
xtensa-esp-elf-idf54/xtensa-esp-elf/include/cpio.h
Expand Down Expand Up @@ -2219,6 +2276,27 @@ xtensa-esp-elf-idf54/xtensa-esp-elf/lib/esp32s3/nosys.specs
xtensa-esp-elf-idf54/xtensa-esp-elf/lib/esp32s3/sim.elf.specs
xtensa-esp-elf-idf54/xtensa-esp-elf/lib/esp32s3/sys.openocd.specs
xtensa-esp-elf-idf54/xtensa-esp-elf/lib/esp32s3/sys.qemu.specs
xtensa-esp-elf-idf54/xtensa-esp-elf/lib/esp8266/board.elf.specs
xtensa-esp-elf-idf54/xtensa-esp-elf/lib/esp8266/crt0.o
xtensa-esp-elf-idf54/xtensa-esp-elf/lib/esp8266/default.specs
xtensa-esp-elf-idf54/xtensa-esp-elf/lib/esp8266/libc_nano.a
xtensa-esp-elf-idf54/xtensa-esp-elf/lib/esp8266/libc.a
xtensa-esp-elf-idf54/xtensa-esp-elf/lib/esp8266/libg_nano.a
xtensa-esp-elf-idf54/xtensa-esp-elf/lib/esp8266/libg.a
xtensa-esp-elf-idf54/xtensa-esp-elf/lib/esp8266/libgloss.a
xtensa-esp-elf-idf54/xtensa-esp-elf/lib/esp8266/libm_nano.a
xtensa-esp-elf-idf54/xtensa-esp-elf/lib/esp8266/libm.a
xtensa-esp-elf-idf54/xtensa-esp-elf/lib/esp8266/libnosys.a
xtensa-esp-elf-idf54/xtensa-esp-elf/lib/esp8266/libpthread_stubs.a
xtensa-esp-elf-idf54/xtensa-esp-elf/lib/esp8266/libstdc++.a
xtensa-esp-elf-idf54/xtensa-esp-elf/lib/esp8266/libstdc++.a-gdb.py
xtensa-esp-elf-idf54/xtensa-esp-elf/lib/esp8266/libstdc++exp.a
xtensa-esp-elf-idf54/xtensa-esp-elf/lib/esp8266/libsupc++.a
xtensa-esp-elf-idf54/xtensa-esp-elf/lib/esp8266/nano.specs
xtensa-esp-elf-idf54/xtensa-esp-elf/lib/esp8266/nosys.specs
xtensa-esp-elf-idf54/xtensa-esp-elf/lib/esp8266/sim.elf.specs
xtensa-esp-elf-idf54/xtensa-esp-elf/lib/esp8266/sys.openocd.specs
xtensa-esp-elf-idf54/xtensa-esp-elf/lib/esp8266/sys.qemu.specs
xtensa-esp-elf-idf54/xtensa-esp-elf/lib/ldscripts/elf32xtensa.x
xtensa-esp-elf-idf54/xtensa-esp-elf/lib/ldscripts/elf32xtensa.xbn
xtensa-esp-elf-idf54/xtensa-esp-elf/lib/ldscripts/elf32xtensa.xc
Expand Down

0 comments on commit 55558b8

Please sign in to comment.