diff --git a/.gitlab/ci/build.yml b/.gitlab/ci/build.yml index ef04ea5ab4..f7ed2345dc 100644 --- a/.gitlab/ci/build.yml +++ b/.gitlab/ci/build.yml @@ -143,7 +143,7 @@ build_clang_test_apps_esp32s3: # For RISCV clang generates '.linker-options' sections of type 'llvm_linker_options' in asm files. # See (https://llvm.org/docs/Extensions.html#linker-options-section-linker-options). # Binutils gas ignores them with warning. - # TODO: LLVM-112, Use integrated assembler. + # TODO: LLVM-333, Use integrated assembler. TEST_BUILD_OPTS_EXTRA: "--ignore-warning-str 'Warning: unrecognized section type'" build_clang_test_apps_esp32c3: @@ -164,11 +164,30 @@ build_clang_test_apps_esp32c6: extends: - .build_clang_test_apps_riscv - .rules:build - # TODO: c6 builds fail in master due to missing headers - allow_failure: true variables: IDF_TARGET: esp32c6 +build_clang_test_apps_esp32c5: + extends: + - .build_clang_test_apps_riscv + - .rules:build + variables: + IDF_TARGET: esp32c5 + +build_clang_test_apps_esp32h2: + extends: + - .build_clang_test_apps_riscv + - .rules:build + variables: + IDF_TARGET: esp32h2 + +build_clang_test_apps_esp32p4: + extends: + - .build_clang_test_apps_riscv + - .rules:build + variables: + IDF_TARGET: esp32p4 + ###################### # Build System Tests # ###################### diff --git a/.gitlab/ci/common.yml b/.gitlab/ci/common.yml index 6fde5691cb..61137bccfd 100644 --- a/.gitlab/ci/common.yml +++ b/.gitlab/ci/common.yml @@ -83,6 +83,12 @@ variables: # This is used only if CI_PYTHON_TOOL_REPO is not empty. CI_PYTHON_TOOL_BRANCH: "" + # Set this variable to Clang toolchain distro URL to be used. + # NOTE: We have separate toolchains for Xtensa and RISCV, therefore jobs for one arch will fail. + # This is OK as far as we use CI_CLANG_DISTRO_URL for pre-release tests purposes only. + # Keep the variable empty when not used. + CI_CLANG_DISTRO_URL: "" + # Set this variable to specify the file name for the known failure cases. KNOWN_FAILURE_CASES_FILE_NAME: "master.txt" @@ -152,7 +158,7 @@ variables: fi # Install esp-clang if necessary - if [[ "$IDF_TOOLCHAIN" == "clang" ]]; then + if [[ "$IDF_TOOLCHAIN" == "clang" && -z "$CI_CLANG_DISTRO_URL" ]]; then $IDF_PATH/tools/idf_tools.py --non-interactive install esp-clang fi @@ -167,7 +173,7 @@ variables: source ./export.sh - # Custom clang + # Custom clang toolchain if [[ ! -z "$CI_CLANG_DISTRO_URL" ]]; then echo "Using custom clang from ${CI_CLANG_DISTRO_URL}" wget $CI_CLANG_DISTRO_URL diff --git a/components/newlib/CMakeLists.txt b/components/newlib/CMakeLists.txt index df29489bad..eb62582e9b 100644 --- a/components/newlib/CMakeLists.txt +++ b/components/newlib/CMakeLists.txt @@ -68,6 +68,7 @@ list(APPEND EXTRA_LINK_FLAGS "-u newlib_include_heap_impl") list(APPEND EXTRA_LINK_FLAGS "-u newlib_include_syscalls_impl") list(APPEND EXTRA_LINK_FLAGS "-u newlib_include_pthread_impl") list(APPEND EXTRA_LINK_FLAGS "-u newlib_include_assert_impl") +list(APPEND EXTRA_LINK_FLAGS "-u newlib_include_getentropy_impl") target_link_libraries(${COMPONENT_LIB} INTERFACE "${EXTRA_LINK_FLAGS}") # Forces the linker to include newlib_init.c diff --git a/components/newlib/esp32-spiram-rom-functions-c.lf b/components/newlib/esp32-spiram-rom-functions-c.lf index 7708edf477..1e066d61b1 100644 --- a/components/newlib/esp32-spiram-rom-functions-c.lf +++ b/components/newlib/esp32-spiram-rom-functions-c.lf @@ -19,302 +19,153 @@ entries: # The following libs are either used in a lot of places or in critical # code. (such as panic or abort) # Thus, they shall always be placed in IRAM. - if IDF_TOOLCHAIN = "gcc": # TODO: IDF-8134 - libc_a-itoa (noflash) - libc_a-memcmp (noflash) - libc_a-memcpy (noflash) - libc_a-memset (noflash) - libc_a-strcat (noflash) - libc_a-strcmp (noflash) - libc_a-strlen (noflash) - else: - lib_a-itoa (noflash) - lib_a-memcmp (noflash) - lib_a-memcpy (noflash) - lib_a-memset (noflash) - lib_a-strcat (noflash) - lib_a-strcmp (noflash) - lib_a-strlen (noflash) + libc_a-itoa (noflash) + libc_a-memcmp (noflash) + libc_a-memcpy (noflash) + libc_a-memset (noflash) + libc_a-strcat (noflash) + libc_a-strcmp (noflash) + libc_a-strlen (noflash) if SPIRAM_CACHE_LIBJMP_IN_IRAM = y: - if IDF_TOOLCHAIN = "gcc": - libc_a-longjmp (noflash) - libc_a-setjmp (noflash) - else: - lib_a-longjmp (noflash) - lib_a-setjmp (noflash) + libc_a-longjmp (noflash) + libc_a-setjmp (noflash) if SPIRAM_CACHE_LIBMATH_IN_IRAM = y: - if IDF_TOOLCHAIN = "gcc": - libc_a-abs (noflash) - libc_a-div (noflash) - libc_a-labs (noflash) - libc_a-ldiv (noflash) - libc_a-quorem (noflash) - libc_a-s_fpclassify (noflash) - libc_a-sf_nan (noflash) - else: - lib_a-abs (noflash) - lib_a-div (noflash) - lib_a-labs (noflash) - lib_a-ldiv (noflash) - lib_a-quorem (noflash) - lib_a-s_fpclassify (noflash) - lib_a-sf_nan (noflash) + libc_a-abs (noflash) + libc_a-div (noflash) + libc_a-labs (noflash) + libc_a-ldiv (noflash) + libc_a-quorem (noflash) + libc_a-s_fpclassify (noflash) + libc_a-sf_nan (noflash) if SPIRAM_CACHE_LIBNUMPARSER_IN_IRAM = y: - if IDF_TOOLCHAIN = "gcc": - libc_a-utoa (noflash) - libc_a-atoi (noflash) - libc_a-atol (noflash) - libc_a-strtol (noflash) - libc_a-strtoul (noflash) - else: - lib_a-utoa (noflash) - lib_a-atoi (noflash) - lib_a-atol (noflash) - lib_a-strtol (noflash) - lib_a-strtoul (noflash) + libc_a-utoa (noflash) + libc_a-atoi (noflash) + libc_a-atol (noflash) + libc_a-strtol (noflash) + libc_a-strtoul (noflash) if SPIRAM_CACHE_LIBIO_IN_IRAM = y: - if IDF_TOOLCHAIN = "gcc": - libc_a-wcrtomb (noflash) - libc_a-fvwrite (noflash) - libc_a-wbuf (noflash) - libc_a-wsetup (noflash) - libc_a-fputwc (noflash) - libc_a-wctomb_r (noflash) - libc_a-ungetc (noflash) - libc_a-makebuf (noflash) - libc_a-fflush (noflash) - libc_a-refill (noflash) - libc_a-sccl (noflash) - else: - lib_a-wcrtomb (noflash) - lib_a-fvwrite (noflash) - lib_a-wbuf (noflash) - lib_a-wsetup (noflash) - lib_a-fputwc (noflash) - lib_a-wctomb_r (noflash) - lib_a-ungetc (noflash) - lib_a-makebuf (noflash) - lib_a-fflush (noflash) - lib_a-refill (noflash) - lib_a-sccl (noflash) + libc_a-wcrtomb (noflash) + libc_a-fvwrite (noflash) + libc_a-wbuf (noflash) + libc_a-wsetup (noflash) + libc_a-fputwc (noflash) + libc_a-wctomb_r (noflash) + libc_a-ungetc (noflash) + libc_a-makebuf (noflash) + libc_a-fflush (noflash) + libc_a-refill (noflash) + libc_a-sccl (noflash) if SPIRAM_CACHE_LIBTIME_IN_IRAM = y: - if IDF_TOOLCHAIN = "gcc": - libc_a-asctime (noflash) - libc_a-asctime_r (noflash) - libc_a-ctime (noflash) - libc_a-ctime_r (noflash) - libc_a-lcltime (noflash) - libc_a-lcltime_r (noflash) - libc_a-gmtime (noflash) - libc_a-gmtime_r (noflash) - libc_a-strftime (noflash) - libc_a-mktime (noflash) - libc_a-tzset_r (noflash) - libc_a-tzset (noflash) - libc_a-time (noflash) - libc_a-gettzinfo (noflash) - libc_a-systimes (noflash) - libc_a-month_lengths (noflash) - libc_a-timelocal (noflash) - libc_a-tzvars (noflash) - libc_a-tzlock (noflash) - libc_a-tzcalc_limits (noflash) - libc_a-strptime (noflash) - else: - lib_a-asctime (noflash) - lib_a-asctime_r (noflash) - lib_a-ctime (noflash) - lib_a-ctime_r (noflash) - lib_a-lcltime (noflash) - lib_a-lcltime_r (noflash) - lib_a-gmtime (noflash) - lib_a-gmtime_r (noflash) - lib_a-strftime (noflash) - lib_a-mktime (noflash) - lib_a-tzset_r (noflash) - lib_a-tzset (noflash) - lib_a-time (noflash) - lib_a-gettzinfo (noflash) - lib_a-systimes (noflash) - lib_a-month_lengths (noflash) - lib_a-timelocal (noflash) - lib_a-tzvars (noflash) - lib_a-tzlock (noflash) - lib_a-tzcalc_limits (noflash) - lib_a-strptime (noflash) + libc_a-asctime (noflash) + libc_a-asctime_r (noflash) + libc_a-ctime (noflash) + libc_a-ctime_r (noflash) + libc_a-lcltime (noflash) + libc_a-lcltime_r (noflash) + libc_a-gmtime (noflash) + libc_a-gmtime_r (noflash) + libc_a-strftime (noflash) + libc_a-mktime (noflash) + libc_a-tzset_r (noflash) + libc_a-tzset (noflash) + libc_a-time (noflash) + libc_a-gettzinfo (noflash) + libc_a-systimes (noflash) + libc_a-month_lengths (noflash) + libc_a-timelocal (noflash) + libc_a-tzvars (noflash) + libc_a-tzlock (noflash) + libc_a-tzcalc_limits (noflash) + libc_a-strptime (noflash) if SPIRAM_CACHE_LIBCHAR_IN_IRAM = y: - if IDF_TOOLCHAIN = "gcc": - libc_a-ctype_ (noflash) - libc_a-toupper (noflash) - libc_a-tolower (noflash) - libc_a-toascii (noflash) - libc_a-strupr (noflash) - libc_a-bzero (noflash) - libc_a-isalnum (noflash) - libc_a-isalpha (noflash) - libc_a-isascii (noflash) - libc_a-isblank (noflash) - libc_a-iscntrl (noflash) - libc_a-isdigit (noflash) - libc_a-isgraph (noflash) - libc_a-islower (noflash) - libc_a-isprint (noflash) - libc_a-ispunct (noflash) - libc_a-isspace (noflash) - libc_a-isupper (noflash) - else: - lib_a-ctype_ (noflash) - lib_a-toupper (noflash) - lib_a-tolower (noflash) - lib_a-toascii (noflash) - lib_a-strupr (noflash) - lib_a-bzero (noflash) - lib_a-isalnum (noflash) - lib_a-isalpha (noflash) - lib_a-isascii (noflash) - lib_a-isblank (noflash) - lib_a-iscntrl (noflash) - lib_a-isdigit (noflash) - lib_a-isgraph (noflash) - lib_a-islower (noflash) - lib_a-isprint (noflash) - lib_a-ispunct (noflash) - lib_a-isspace (noflash) - lib_a-isupper (noflash) + libc_a-ctype_ (noflash) + libc_a-toupper (noflash) + libc_a-tolower (noflash) + libc_a-toascii (noflash) + libc_a-strupr (noflash) + libc_a-bzero (noflash) + libc_a-isalnum (noflash) + libc_a-isalpha (noflash) + libc_a-isascii (noflash) + libc_a-isblank (noflash) + libc_a-iscntrl (noflash) + libc_a-isdigit (noflash) + libc_a-isgraph (noflash) + libc_a-islower (noflash) + libc_a-isprint (noflash) + libc_a-ispunct (noflash) + libc_a-isspace (noflash) + libc_a-isupper (noflash) if SPIRAM_CACHE_LIBMEM_IN_IRAM = y: - if IDF_TOOLCHAIN = "gcc": - libc_a-memccpy (noflash) - libc_a-memchr (noflash) - libc_a-memmove (noflash) - libc_a-memrchr (noflash) - else: - lib_a-memccpy (noflash) - lib_a-memchr (noflash) - lib_a-memmove (noflash) - lib_a-memrchr (noflash) + libc_a-memccpy (noflash) + libc_a-memchr (noflash) + libc_a-memmove (noflash) + libc_a-memrchr (noflash) if SPIRAM_CACHE_LIBSTR_IN_IRAM = y: - if IDF_TOOLCHAIN = "gcc": - libc_a-strcasecmp (noflash) - libc_a-strcasestr (noflash) - libc_a-strchr (noflash) - libc_a-strcoll (noflash) - libc_a-strcpy (noflash) - libc_a-strcspn (noflash) - libc_a-strdup (noflash) - libc_a-strdup_r (noflash) - libc_a-strlcat (noflash) - libc_a-strlcpy (noflash) - libc_a-strlwr (noflash) - libc_a-strncasecmp (noflash) - libc_a-strncat (noflash) - libc_a-strncmp (noflash) - libc_a-strncpy (noflash) - libc_a-strndup (noflash) - libc_a-strndup_r (noflash) - libc_a-strnlen (noflash) - libc_a-strrchr (noflash) - libc_a-strsep (noflash) - libc_a-strspn (noflash) - libc_a-strstr (noflash) - libc_a-strtok_r (noflash) - libc_a-strupr (noflash) - else: - lib_a-strcasecmp (noflash) - lib_a-strcasestr (noflash) - lib_a-strchr (noflash) - lib_a-strcoll (noflash) - lib_a-strcpy (noflash) - lib_a-strcspn (noflash) - lib_a-strdup (noflash) - lib_a-strdup_r (noflash) - lib_a-strlcat (noflash) - lib_a-strlcpy (noflash) - lib_a-strlwr (noflash) - lib_a-strncasecmp (noflash) - lib_a-strncat (noflash) - lib_a-strncmp (noflash) - lib_a-strncpy (noflash) - lib_a-strndup (noflash) - lib_a-strndup_r (noflash) - lib_a-strnlen (noflash) - lib_a-strrchr (noflash) - lib_a-strsep (noflash) - lib_a-strspn (noflash) - lib_a-strstr (noflash) - lib_a-strtok_r (noflash) - lib_a-strupr (noflash) + libc_a-strcasecmp (noflash) + libc_a-strcasestr (noflash) + libc_a-strchr (noflash) + libc_a-strcoll (noflash) + libc_a-strcpy (noflash) + libc_a-strcspn (noflash) + libc_a-strdup (noflash) + libc_a-strdup_r (noflash) + libc_a-strlcat (noflash) + libc_a-strlcpy (noflash) + libc_a-strlwr (noflash) + libc_a-strncasecmp (noflash) + libc_a-strncat (noflash) + libc_a-strncmp (noflash) + libc_a-strncpy (noflash) + libc_a-strndup (noflash) + libc_a-strndup_r (noflash) + libc_a-strnlen (noflash) + libc_a-strrchr (noflash) + libc_a-strsep (noflash) + libc_a-strspn (noflash) + libc_a-strstr (noflash) + libc_a-strtok_r (noflash) + libc_a-strupr (noflash) if SPIRAM_CACHE_LIBRAND_IN_IRAM = y: - if IDF_TOOLCHAIN = "gcc": - libc_a-srand (noflash) - libc_a-rand (noflash) - libc_a-rand_r (noflash) - else: - lib_a-srand (noflash) - lib_a-rand (noflash) - lib_a-rand_r (noflash) + libc_a-srand (noflash) + libc_a-rand (noflash) + libc_a-rand_r (noflash) if SPIRAM_CACHE_LIBENV_IN_IRAM = y: - if IDF_TOOLCHAIN = "gcc": - libc_a-environ (noflash) - libc_a-envlock (noflash) - libc_a-getenv_r (noflash) - else: - lib_a-environ (noflash) - lib_a-envlock (noflash) - lib_a-getenv_r (noflash) + libc_a-environ (noflash) + libc_a-envlock (noflash) + libc_a-getenv_r (noflash) if SPIRAM_CACHE_LIBFILE_IN_IRAM = y: lock (noflash) isatty (noflash) creat (noflash) - if IDF_TOOLCHAIN = "gcc": - libc_a-fclose (noflash) - libc_a-open (noflash) - libc_a-close (noflash) - libc_a-creat (noflash) - libc_a-read (noflash) - libc_a-rshift (noflash) - libc_a-sbrk (noflash) - libc_a-stdio (noflash) - libc_a-syssbrk (noflash) - libc_a-sysclose (noflash) - libc_a-sysopen (noflash) - libc_a-sysread (noflash) - libc_a-syswrite (noflash) - libc_a-impure (noflash) - libc_a-fwalk (noflash) - libc_a-findfp (noflash) - else: - lib_a-fclose (noflash) - lib_a-open (noflash) - lib_a-close (noflash) - lib_a-creat (noflash) - lib_a-read (noflash) - lib_a-rshift (noflash) - lib_a-sbrk (noflash) - lib_a-stdio (noflash) - lib_a-syssbrk (noflash) - lib_a-sysclose (noflash) - lib_a-sysopen (noflash) - lib_a-sysread (noflash) - lib_a-syswrite (noflash) - lib_a-impure (noflash) - lib_a-fwalk (noflash) - lib_a-findfp (noflash) + libc_a-fclose (noflash) + libc_a-open (noflash) + libc_a-close (noflash) + libc_a-creat (noflash) + libc_a-read (noflash) + libc_a-rshift (noflash) + libc_a-sbrk (noflash) + libc_a-stdio (noflash) + libc_a-syssbrk (noflash) + libc_a-sysclose (noflash) + libc_a-sysopen (noflash) + libc_a-sysread (noflash) + libc_a-syswrite (noflash) + libc_a-impure (noflash) + libc_a-fwalk (noflash) + libc_a-findfp (noflash) if SPIRAM_CACHE_LIBMISC_IN_IRAM = y: - if IDF_TOOLCHAIN = "gcc": - libc_a-raise (noflash) - libc_a-system (noflash) - else: - lib_a-raise (noflash) - lib_a-system (noflash) + libc_a-raise (noflash) + libc_a-system (noflash) diff --git a/components/newlib/getentropy.c b/components/newlib/getentropy.c index e375cb9763..0dfc661b1d 100644 --- a/components/newlib/getentropy.c +++ b/components/newlib/getentropy.c @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: 2023 Espressif Systems (Shanghai) CO LTD + * SPDX-FileCopyrightText: 2023-2024 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 */ @@ -28,3 +28,8 @@ int getentropy(void *buffer, size_t length) return 0; } + +void newlib_include_getentropy_impl(void) +{ + // Linker hook, exists for no other purpose +} diff --git a/components/newlib/newlib_init.c b/components/newlib/newlib_init.c index 362e2a80f3..72506d130b 100644 --- a/components/newlib/newlib_init.c +++ b/components/newlib/newlib_init.c @@ -136,13 +136,8 @@ void esp_newlib_init(void) syscall_table_ptr = &s_stub_table; #endif -#if __NEWLIB__ > 4 || ( __NEWLIB__ == 4 && __NEWLIB_MINOR__ > 1 ) /* TODO: IDF-8134 */ memset(&__sglue, 0, sizeof(__sglue)); _global_impure_ptr = _GLOBAL_REENT; -#else - static struct _reent s_reent; - _GLOBAL_REENT = &s_reent; -#endif /* Ensure that the initialization of sfp is prevented until esp_newlib_init_global_stdio() is explicitly invoked. */ _GLOBAL_REENT->__cleanup = esp_cleanup_r; diff --git a/components/newlib/platform_include/sys/reent.h b/components/newlib/platform_include/sys/reent.h index 64f4795414..504f288ac2 100644 --- a/components/newlib/platform_include/sys/reent.h +++ b/components/newlib/platform_include/sys/reent.h @@ -1,23 +1,14 @@ /* - * SPDX-FileCopyrightText: 2020-2023 Espressif Systems (Shanghai) CO LTD + * SPDX-FileCopyrightText: 2020-2024 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 */ #pragma once -#if __NEWLIB__ > 4 || ( __NEWLIB__ == 4 && __NEWLIB_MINOR__ > 1 ) /* TODO: IDF-8134 */ #define _REENT_BACKWARD_BINARY_COMPAT #define _REENT_SDIDINIT(_ptr) ((_ptr)->_reserved_0) #define _REENT_SGLUE(_ptr) (__sglue) -#else -#define _REENT_CLEANUP(_ptr) ((_ptr)->__cleanup) -#define _REENT_STDIN(_ptr) ((_ptr)->_stdin) -#define _REENT_STDOUT(_ptr) ((_ptr)->_stdout) -#define _REENT_STDERR(_ptr) ((_ptr)->_stderr) -#define _REENT_SDIDINIT(_ptr) ((_ptr)->__sdidinit) -#define _REENT_SGLUE(_ptr) ((_ptr)->__sglue) -#endif #include_next @@ -25,23 +16,11 @@ extern "C" { #endif -#if __NEWLIB__ > 4 || ( __NEWLIB__ == 4 && __NEWLIB_MINOR__ > 1 ) /* TODO: IDF-8134 */ - extern void __sinit(struct _reent *); extern struct _glue __sglue; extern struct _reent * _global_impure_ptr; -#else /* __NEWLIB__ > 4 || ( __NEWLIB__ == 4 && __NEWLIB_MINOR__ > 1 ) */ - -/* This function is not part of the newlib API, it is defined in libc/stdio/local.h - * There is no nice way to get __cleanup member populated while avoiding __sinit, - * so extern declaration is used here. - */ -extern void _cleanup_r(struct _reent *); - -#endif /* __NEWLIB__ > 4 || ( __NEWLIB__ == 4 && __NEWLIB_MINOR__ > 1 ) */ - #ifdef __cplusplus } #endif diff --git a/components/xtensa/include/xtensa/core-macros.h b/components/xtensa/include/xtensa/core-macros.h index 7eef4173ee..3b47296340 100644 --- a/components/xtensa/include/xtensa/core-macros.h +++ b/components/xtensa/include/xtensa/core-macros.h @@ -337,16 +337,9 @@ # define XTHAL_GET_INTERRUPT() ({ int __interrupt; \ __asm__ __volatile__("rsr.interrupt %0" : "=a"(__interrupt)); \ __interrupt; }) -#ifdef __clang__ -// TODO: LLVM-195. Currently clang does not support INTSET alias for INTERRUPT special reg -# define XTHAL_SET_INTSET(v) do { int __interrupt = (int)(v); \ - __asm__ __volatile__("wsr.interrupt %0" :: "a"(__interrupt):"memory"); \ - } while(0) -#else # define XTHAL_SET_INTSET(v) do { int __interrupt = (int)(v); \ __asm__ __volatile__("wsr.intset %0" :: "a"(__interrupt):"memory"); \ } while(0) -#endif # define XTHAL_SET_INTCLEAR(v) do { int __interrupt = (int)(v); \ __asm__ __volatile__("wsr.intclear %0" :: "a"(__interrupt):"memory"); \ } while(0) @@ -376,7 +369,7 @@ # define XTHAL_SET_CCOMPARE(n,v) do {/*nothing*/} while(0) #endif -/* New functions added to accomodate XEA3 and allow deprecation of older +/* New functions added to accommodate XEA3 and allow deprecation of older functions. For this release they just map to the older ones. */ /* Enables the specified interrupt. */ @@ -440,7 +433,7 @@ static inline unsigned XTHAL_COMPARE_AND_SET( int *addr, int testval, int setva : "=a"(result) : "0" (setval), "a" (testval), "a" (addr) : "memory"); #elif XCHAL_HAVE_INTERRUPTS - int tmp = 0; // clang complains on unitialized var + int tmp = 0; // clang complains on uninitialized var __asm__ __volatile__ ( " rsil %4, 15 \n" // %4 == saved ps " l32i %0, %3, 0 \n" // %0 == value to test, return val diff --git a/tools/cmake/toolchain-clang-esp32.cmake b/tools/cmake/toolchain-clang-esp32.cmake index 2c9e2e4a11..2ca9540dcd 100644 --- a/tools/cmake/toolchain-clang-esp32.cmake +++ b/tools/cmake/toolchain-clang-esp32.cmake @@ -5,12 +5,14 @@ set(CMAKE_SYSTEM_NAME Generic) set(CMAKE_C_COMPILER clang) set(CMAKE_CXX_COMPILER clang++) set(CMAKE_ASM_COMPILER clang) +set(CMAKE_LINKER xtensa-esp32-elf-clang-ld) set(CMAKE_AR llvm-ar) set(CMAKE_RANLIB llvm-ranlib) -set(CMAKE_OBJDUMP xtensa-esp32-elf-objdump) +set(CMAKE_OBJDUMP xtensa-esp32-elf-clang-objdump) -remove_duplicated_flags("--target=xtensa-esp-elf -mcpu=esp32 ${CMAKE_C_FLAGS}" +remove_duplicated_flags("--target=xtensa-esp-elf -mcpu=esp32 \ + ${CMAKE_C_FLAGS}" UNIQ_CMAKE_C_FLAGS) set(CMAKE_C_FLAGS "${UNIQ_CMAKE_C_FLAGS}" CACHE STRING "C Compiler Base Flags" @@ -23,8 +25,16 @@ set(CMAKE_CXX_FLAGS "${UNIQ_CMAKE_CXX_FLAGS}" CACHE STRING "C++ Compiler Base Flags" FORCE) -remove_duplicated_flags("--target=xtensa-esp-elf -mcpu=esp32 -Xassembler --longcalls ${CMAKE_ASM_FLAGS}" +remove_duplicated_flags("--target=xtensa-esp-elf -mcpu=esp32 -Xassembler --longcalls \ + ${CMAKE_ASM_FLAGS}" UNIQ_CMAKE_ASM_FLAGS) set(CMAKE_ASM_FLAGS "${UNIQ_CMAKE_ASM_FLAGS}" CACHE STRING "Assembler Base Flags" FORCE) + +remove_duplicated_flags("--ld-path=xtensa-esp32-elf-clang-ld -z noexecstack \ + ${CMAKE_EXE_LINKER_FLAGS}" + UNIQ_CMAKE_EXE_LINKER_FLAGS) +set(CMAKE_EXE_LINKER_FLAGS "${UNIQ_CMAKE_EXE_LINKER_FLAGS}" + CACHE STRING "Linker Base Flags" + FORCE) diff --git a/tools/cmake/toolchain-clang-esp32c2.cmake b/tools/cmake/toolchain-clang-esp32c2.cmake index 420c99a3a3..55771686e0 100644 --- a/tools/cmake/toolchain-clang-esp32c2.cmake +++ b/tools/cmake/toolchain-clang-esp32c2.cmake @@ -5,28 +5,36 @@ set(CMAKE_SYSTEM_NAME Generic) set(CMAKE_C_COMPILER clang) set(CMAKE_CXX_COMPILER clang++) set(CMAKE_ASM_COMPILER clang) +set(CMAKE_LINKER riscv32-esp-elf-clang-ld) set(CMAKE_AR llvm-ar) set(CMAKE_RANLIB llvm-ranlib) -set(CMAKE_OBJDUMP riscv32-esp-elf-objdump) +set(CMAKE_OBJDUMP riscv32-esp-elf-clang-objdump) -remove_duplicated_flags("--target=riscv32-esp-elf -march=rv32imc -mabi=ilp32 \ +remove_duplicated_flags("--target=riscv32-esp-elf -march=rv32imc_zicsr_zifencei -mabi=ilp32 -no-integrated-as \ ${CMAKE_C_FLAGS}" UNIQ_CMAKE_C_FLAGS) set(CMAKE_C_FLAGS "${UNIQ_CMAKE_C_FLAGS}" CACHE STRING "C Compiler Base Flags" FORCE) -remove_duplicated_flags("--target=riscv32-esp-elf -march=rv32imc -mabi=ilp32 \ +remove_duplicated_flags("--target=riscv32-esp-elf -march=rv32imc_zicsr_zifencei -mabi=ilp32 -no-integrated-as \ ${CMAKE_CXX_FLAGS}" UNIQ_CMAKE_CXX_FLAGS) set(CMAKE_CXX_FLAGS "${UNIQ_CMAKE_CXX_FLAGS}" CACHE STRING "C++ Compiler Base Flags" FORCE) -remove_duplicated_flags("--target=riscv32-esp-elf -march=rv32imc -mabi=ilp32 \ +remove_duplicated_flags("--target=riscv32-esp-elf -march=rv32imc_zicsr_zifencei -mabi=ilp32 -no-integrated-as \ ${CMAKE_ASM_FLAGS}" UNIQ_CMAKE_ASM_FLAGS) set(CMAKE_ASM_FLAGS "${UNIQ_CMAKE_ASM_FLAGS}" CACHE STRING "Assembler Base Flags" FORCE) + +remove_duplicated_flags("--ld-path=riscv32-esp-elf-clang-ld -z noexecstack \ + ${CMAKE_EXE_LINKER_FLAGS}" + UNIQ_CMAKE_EXE_LINKER_FLAGS) +set(CMAKE_EXE_LINKER_FLAGS "${UNIQ_CMAKE_EXE_LINKER_FLAGS}" + CACHE STRING "Linker Base Flags" + FORCE) diff --git a/tools/cmake/toolchain-clang-esp32c3.cmake b/tools/cmake/toolchain-clang-esp32c3.cmake index 420c99a3a3..55771686e0 100644 --- a/tools/cmake/toolchain-clang-esp32c3.cmake +++ b/tools/cmake/toolchain-clang-esp32c3.cmake @@ -5,28 +5,36 @@ set(CMAKE_SYSTEM_NAME Generic) set(CMAKE_C_COMPILER clang) set(CMAKE_CXX_COMPILER clang++) set(CMAKE_ASM_COMPILER clang) +set(CMAKE_LINKER riscv32-esp-elf-clang-ld) set(CMAKE_AR llvm-ar) set(CMAKE_RANLIB llvm-ranlib) -set(CMAKE_OBJDUMP riscv32-esp-elf-objdump) +set(CMAKE_OBJDUMP riscv32-esp-elf-clang-objdump) -remove_duplicated_flags("--target=riscv32-esp-elf -march=rv32imc -mabi=ilp32 \ +remove_duplicated_flags("--target=riscv32-esp-elf -march=rv32imc_zicsr_zifencei -mabi=ilp32 -no-integrated-as \ ${CMAKE_C_FLAGS}" UNIQ_CMAKE_C_FLAGS) set(CMAKE_C_FLAGS "${UNIQ_CMAKE_C_FLAGS}" CACHE STRING "C Compiler Base Flags" FORCE) -remove_duplicated_flags("--target=riscv32-esp-elf -march=rv32imc -mabi=ilp32 \ +remove_duplicated_flags("--target=riscv32-esp-elf -march=rv32imc_zicsr_zifencei -mabi=ilp32 -no-integrated-as \ ${CMAKE_CXX_FLAGS}" UNIQ_CMAKE_CXX_FLAGS) set(CMAKE_CXX_FLAGS "${UNIQ_CMAKE_CXX_FLAGS}" CACHE STRING "C++ Compiler Base Flags" FORCE) -remove_duplicated_flags("--target=riscv32-esp-elf -march=rv32imc -mabi=ilp32 \ +remove_duplicated_flags("--target=riscv32-esp-elf -march=rv32imc_zicsr_zifencei -mabi=ilp32 -no-integrated-as \ ${CMAKE_ASM_FLAGS}" UNIQ_CMAKE_ASM_FLAGS) set(CMAKE_ASM_FLAGS "${UNIQ_CMAKE_ASM_FLAGS}" CACHE STRING "Assembler Base Flags" FORCE) + +remove_duplicated_flags("--ld-path=riscv32-esp-elf-clang-ld -z noexecstack \ + ${CMAKE_EXE_LINKER_FLAGS}" + UNIQ_CMAKE_EXE_LINKER_FLAGS) +set(CMAKE_EXE_LINKER_FLAGS "${UNIQ_CMAKE_EXE_LINKER_FLAGS}" + CACHE STRING "Linker Base Flags" + FORCE) diff --git a/tools/cmake/toolchain-clang-esp32c5.cmake b/tools/cmake/toolchain-clang-esp32c5.cmake new file mode 100644 index 0000000000..22bcacd1e7 --- /dev/null +++ b/tools/cmake/toolchain-clang-esp32c5.cmake @@ -0,0 +1,40 @@ +include($ENV{IDF_PATH}/tools/cmake/utilities.cmake) + +set(CMAKE_SYSTEM_NAME Generic) + +set(CMAKE_C_COMPILER clang) +set(CMAKE_CXX_COMPILER clang++) +set(CMAKE_ASM_COMPILER clang) +set(CMAKE_LINKER riscv32-esp-elf-clang-ld) + +set(CMAKE_AR llvm-ar) +set(CMAKE_RANLIB llvm-ranlib) +set(CMAKE_OBJDUMP riscv32-esp-elf-clang-objdump) + +remove_duplicated_flags("--target=riscv32-esp-elf -march=rv32imac_zicsr_zifencei -mabi=ilp32 -no-integrated-as \ + ${CMAKE_C_FLAGS}" + UNIQ_CMAKE_C_FLAGS) +set(CMAKE_C_FLAGS "${UNIQ_CMAKE_C_FLAGS}" + CACHE STRING "C Compiler Base Flags" + FORCE) + +remove_duplicated_flags("--target=riscv32-esp-elf -march=rv32imac_zicsr_zifencei -mabi=ilp32 -no-integrated-as \ + ${CMAKE_CXX_FLAGS}" + UNIQ_CMAKE_CXX_FLAGS) +set(CMAKE_CXX_FLAGS "${UNIQ_CMAKE_CXX_FLAGS}" + CACHE STRING "C++ Compiler Base Flags" + FORCE) + +remove_duplicated_flags("--target=riscv32-esp-elf -march=rv32imac_zicsr_zifencei -mabi=ilp32 -no-integrated-as \ + ${CMAKE_ASM_FLAGS}" + UNIQ_CMAKE_ASM_FLAGS) +set(CMAKE_ASM_FLAGS "${UNIQ_CMAKE_ASM_FLAGS}" + CACHE STRING "Assembler Base Flags" + FORCE) + +remove_duplicated_flags("--ld-path=riscv32-esp-elf-clang-ld -z noexecstack \ + ${CMAKE_EXE_LINKER_FLAGS}" + UNIQ_CMAKE_EXE_LINKER_FLAGS) +set(CMAKE_EXE_LINKER_FLAGS "${UNIQ_CMAKE_EXE_LINKER_FLAGS}" + CACHE STRING "Linker Base Flags" + FORCE) diff --git a/tools/cmake/toolchain-clang-esp32c6.cmake b/tools/cmake/toolchain-clang-esp32c6.cmake index cf73255130..22bcacd1e7 100644 --- a/tools/cmake/toolchain-clang-esp32c6.cmake +++ b/tools/cmake/toolchain-clang-esp32c6.cmake @@ -5,28 +5,36 @@ set(CMAKE_SYSTEM_NAME Generic) set(CMAKE_C_COMPILER clang) set(CMAKE_CXX_COMPILER clang++) set(CMAKE_ASM_COMPILER clang) +set(CMAKE_LINKER riscv32-esp-elf-clang-ld) set(CMAKE_AR llvm-ar) set(CMAKE_RANLIB llvm-ranlib) -set(CMAKE_OBJDUMP riscv32-esp-elf-objdump) +set(CMAKE_OBJDUMP riscv32-esp-elf-clang-objdump) -remove_duplicated_flags("--target=riscv32-esp-elf -march=rv32imac -mabi=ilp32 \ +remove_duplicated_flags("--target=riscv32-esp-elf -march=rv32imac_zicsr_zifencei -mabi=ilp32 -no-integrated-as \ ${CMAKE_C_FLAGS}" UNIQ_CMAKE_C_FLAGS) set(CMAKE_C_FLAGS "${UNIQ_CMAKE_C_FLAGS}" CACHE STRING "C Compiler Base Flags" FORCE) -remove_duplicated_flags("--target=riscv32-esp-elf -march=rv32imac -mabi=ilp32 \ +remove_duplicated_flags("--target=riscv32-esp-elf -march=rv32imac_zicsr_zifencei -mabi=ilp32 -no-integrated-as \ ${CMAKE_CXX_FLAGS}" UNIQ_CMAKE_CXX_FLAGS) set(CMAKE_CXX_FLAGS "${UNIQ_CMAKE_CXX_FLAGS}" CACHE STRING "C++ Compiler Base Flags" FORCE) -remove_duplicated_flags("--target=riscv32-esp-elf -march=rv32imac -mabi=ilp32 \ +remove_duplicated_flags("--target=riscv32-esp-elf -march=rv32imac_zicsr_zifencei -mabi=ilp32 -no-integrated-as \ ${CMAKE_ASM_FLAGS}" UNIQ_CMAKE_ASM_FLAGS) set(CMAKE_ASM_FLAGS "${UNIQ_CMAKE_ASM_FLAGS}" CACHE STRING "Assembler Base Flags" FORCE) + +remove_duplicated_flags("--ld-path=riscv32-esp-elf-clang-ld -z noexecstack \ + ${CMAKE_EXE_LINKER_FLAGS}" + UNIQ_CMAKE_EXE_LINKER_FLAGS) +set(CMAKE_EXE_LINKER_FLAGS "${UNIQ_CMAKE_EXE_LINKER_FLAGS}" + CACHE STRING "Linker Base Flags" + FORCE) diff --git a/tools/cmake/toolchain-clang-esp32c61.cmake b/tools/cmake/toolchain-clang-esp32c61.cmake new file mode 100644 index 0000000000..22bcacd1e7 --- /dev/null +++ b/tools/cmake/toolchain-clang-esp32c61.cmake @@ -0,0 +1,40 @@ +include($ENV{IDF_PATH}/tools/cmake/utilities.cmake) + +set(CMAKE_SYSTEM_NAME Generic) + +set(CMAKE_C_COMPILER clang) +set(CMAKE_CXX_COMPILER clang++) +set(CMAKE_ASM_COMPILER clang) +set(CMAKE_LINKER riscv32-esp-elf-clang-ld) + +set(CMAKE_AR llvm-ar) +set(CMAKE_RANLIB llvm-ranlib) +set(CMAKE_OBJDUMP riscv32-esp-elf-clang-objdump) + +remove_duplicated_flags("--target=riscv32-esp-elf -march=rv32imac_zicsr_zifencei -mabi=ilp32 -no-integrated-as \ + ${CMAKE_C_FLAGS}" + UNIQ_CMAKE_C_FLAGS) +set(CMAKE_C_FLAGS "${UNIQ_CMAKE_C_FLAGS}" + CACHE STRING "C Compiler Base Flags" + FORCE) + +remove_duplicated_flags("--target=riscv32-esp-elf -march=rv32imac_zicsr_zifencei -mabi=ilp32 -no-integrated-as \ + ${CMAKE_CXX_FLAGS}" + UNIQ_CMAKE_CXX_FLAGS) +set(CMAKE_CXX_FLAGS "${UNIQ_CMAKE_CXX_FLAGS}" + CACHE STRING "C++ Compiler Base Flags" + FORCE) + +remove_duplicated_flags("--target=riscv32-esp-elf -march=rv32imac_zicsr_zifencei -mabi=ilp32 -no-integrated-as \ + ${CMAKE_ASM_FLAGS}" + UNIQ_CMAKE_ASM_FLAGS) +set(CMAKE_ASM_FLAGS "${UNIQ_CMAKE_ASM_FLAGS}" + CACHE STRING "Assembler Base Flags" + FORCE) + +remove_duplicated_flags("--ld-path=riscv32-esp-elf-clang-ld -z noexecstack \ + ${CMAKE_EXE_LINKER_FLAGS}" + UNIQ_CMAKE_EXE_LINKER_FLAGS) +set(CMAKE_EXE_LINKER_FLAGS "${UNIQ_CMAKE_EXE_LINKER_FLAGS}" + CACHE STRING "Linker Base Flags" + FORCE) diff --git a/tools/cmake/toolchain-clang-esp32h2.cmake b/tools/cmake/toolchain-clang-esp32h2.cmake index 420c99a3a3..55771686e0 100644 --- a/tools/cmake/toolchain-clang-esp32h2.cmake +++ b/tools/cmake/toolchain-clang-esp32h2.cmake @@ -5,28 +5,36 @@ set(CMAKE_SYSTEM_NAME Generic) set(CMAKE_C_COMPILER clang) set(CMAKE_CXX_COMPILER clang++) set(CMAKE_ASM_COMPILER clang) +set(CMAKE_LINKER riscv32-esp-elf-clang-ld) set(CMAKE_AR llvm-ar) set(CMAKE_RANLIB llvm-ranlib) -set(CMAKE_OBJDUMP riscv32-esp-elf-objdump) +set(CMAKE_OBJDUMP riscv32-esp-elf-clang-objdump) -remove_duplicated_flags("--target=riscv32-esp-elf -march=rv32imc -mabi=ilp32 \ +remove_duplicated_flags("--target=riscv32-esp-elf -march=rv32imc_zicsr_zifencei -mabi=ilp32 -no-integrated-as \ ${CMAKE_C_FLAGS}" UNIQ_CMAKE_C_FLAGS) set(CMAKE_C_FLAGS "${UNIQ_CMAKE_C_FLAGS}" CACHE STRING "C Compiler Base Flags" FORCE) -remove_duplicated_flags("--target=riscv32-esp-elf -march=rv32imc -mabi=ilp32 \ +remove_duplicated_flags("--target=riscv32-esp-elf -march=rv32imc_zicsr_zifencei -mabi=ilp32 -no-integrated-as \ ${CMAKE_CXX_FLAGS}" UNIQ_CMAKE_CXX_FLAGS) set(CMAKE_CXX_FLAGS "${UNIQ_CMAKE_CXX_FLAGS}" CACHE STRING "C++ Compiler Base Flags" FORCE) -remove_duplicated_flags("--target=riscv32-esp-elf -march=rv32imc -mabi=ilp32 \ +remove_duplicated_flags("--target=riscv32-esp-elf -march=rv32imc_zicsr_zifencei -mabi=ilp32 -no-integrated-as \ ${CMAKE_ASM_FLAGS}" UNIQ_CMAKE_ASM_FLAGS) set(CMAKE_ASM_FLAGS "${UNIQ_CMAKE_ASM_FLAGS}" CACHE STRING "Assembler Base Flags" FORCE) + +remove_duplicated_flags("--ld-path=riscv32-esp-elf-clang-ld -z noexecstack \ + ${CMAKE_EXE_LINKER_FLAGS}" + UNIQ_CMAKE_EXE_LINKER_FLAGS) +set(CMAKE_EXE_LINKER_FLAGS "${UNIQ_CMAKE_EXE_LINKER_FLAGS}" + CACHE STRING "Linker Base Flags" + FORCE) diff --git a/tools/cmake/toolchain-clang-esp32h4.cmake b/tools/cmake/toolchain-clang-esp32h4.cmake index 420c99a3a3..55771686e0 100644 --- a/tools/cmake/toolchain-clang-esp32h4.cmake +++ b/tools/cmake/toolchain-clang-esp32h4.cmake @@ -5,28 +5,36 @@ set(CMAKE_SYSTEM_NAME Generic) set(CMAKE_C_COMPILER clang) set(CMAKE_CXX_COMPILER clang++) set(CMAKE_ASM_COMPILER clang) +set(CMAKE_LINKER riscv32-esp-elf-clang-ld) set(CMAKE_AR llvm-ar) set(CMAKE_RANLIB llvm-ranlib) -set(CMAKE_OBJDUMP riscv32-esp-elf-objdump) +set(CMAKE_OBJDUMP riscv32-esp-elf-clang-objdump) -remove_duplicated_flags("--target=riscv32-esp-elf -march=rv32imc -mabi=ilp32 \ +remove_duplicated_flags("--target=riscv32-esp-elf -march=rv32imc_zicsr_zifencei -mabi=ilp32 -no-integrated-as \ ${CMAKE_C_FLAGS}" UNIQ_CMAKE_C_FLAGS) set(CMAKE_C_FLAGS "${UNIQ_CMAKE_C_FLAGS}" CACHE STRING "C Compiler Base Flags" FORCE) -remove_duplicated_flags("--target=riscv32-esp-elf -march=rv32imc -mabi=ilp32 \ +remove_duplicated_flags("--target=riscv32-esp-elf -march=rv32imc_zicsr_zifencei -mabi=ilp32 -no-integrated-as \ ${CMAKE_CXX_FLAGS}" UNIQ_CMAKE_CXX_FLAGS) set(CMAKE_CXX_FLAGS "${UNIQ_CMAKE_CXX_FLAGS}" CACHE STRING "C++ Compiler Base Flags" FORCE) -remove_duplicated_flags("--target=riscv32-esp-elf -march=rv32imc -mabi=ilp32 \ +remove_duplicated_flags("--target=riscv32-esp-elf -march=rv32imc_zicsr_zifencei -mabi=ilp32 -no-integrated-as \ ${CMAKE_ASM_FLAGS}" UNIQ_CMAKE_ASM_FLAGS) set(CMAKE_ASM_FLAGS "${UNIQ_CMAKE_ASM_FLAGS}" CACHE STRING "Assembler Base Flags" FORCE) + +remove_duplicated_flags("--ld-path=riscv32-esp-elf-clang-ld -z noexecstack \ + ${CMAKE_EXE_LINKER_FLAGS}" + UNIQ_CMAKE_EXE_LINKER_FLAGS) +set(CMAKE_EXE_LINKER_FLAGS "${UNIQ_CMAKE_EXE_LINKER_FLAGS}" + CACHE STRING "Linker Base Flags" + FORCE) diff --git a/tools/cmake/toolchain-clang-esp32p4.cmake b/tools/cmake/toolchain-clang-esp32p4.cmake new file mode 100644 index 0000000000..b7121244bf --- /dev/null +++ b/tools/cmake/toolchain-clang-esp32p4.cmake @@ -0,0 +1,40 @@ +include($ENV{IDF_PATH}/tools/cmake/utilities.cmake) + +set(CMAKE_SYSTEM_NAME Generic) + +set(CMAKE_C_COMPILER clang) +set(CMAKE_CXX_COMPILER clang++) +set(CMAKE_ASM_COMPILER clang) +set(CMAKE_LINKER riscv32-esp-elf-clang-ld) + +set(CMAKE_AR llvm-ar) +set(CMAKE_RANLIB llvm-ranlib) +set(CMAKE_OBJDUMP riscv32-esp-elf-clang-objdump) + +remove_duplicated_flags("--target=riscv32-esp-elf -march=rv32imafc_zicsr_zifencei -mabi=ilp32f -no-integrated-as \ + ${CMAKE_C_FLAGS}" + UNIQ_CMAKE_C_FLAGS) +set(CMAKE_C_FLAGS "${UNIQ_CMAKE_C_FLAGS}" + CACHE STRING "C Compiler Base Flags" + FORCE) + +remove_duplicated_flags("--target=riscv32-esp-elf -march=rv32imafc_zicsr_zifencei -mabi=ilp32f -no-integrated-as \ + ${CMAKE_CXX_FLAGS}" + UNIQ_CMAKE_CXX_FLAGS) +set(CMAKE_CXX_FLAGS "${UNIQ_CMAKE_CXX_FLAGS}" + CACHE STRING "C++ Compiler Base Flags" + FORCE) + +remove_duplicated_flags("--target=riscv32-esp-elf -march=rv32imafc_zicsr_zifencei -mabi=ilp32f -no-integrated-as \ + ${CMAKE_ASM_FLAGS}" + UNIQ_CMAKE_ASM_FLAGS) +set(CMAKE_ASM_FLAGS "${UNIQ_CMAKE_ASM_FLAGS}" + CACHE STRING "Assembler Base Flags" + FORCE) + +remove_duplicated_flags("--ld-path=riscv32-esp-elf-clang-ld -z noexecstack \ + ${CMAKE_EXE_LINKER_FLAGS}" + UNIQ_CMAKE_EXE_LINKER_FLAGS) +set(CMAKE_EXE_LINKER_FLAGS "${UNIQ_CMAKE_EXE_LINKER_FLAGS}" + CACHE STRING "Linker Base Flags" + FORCE) diff --git a/tools/cmake/toolchain-clang-esp32s2.cmake b/tools/cmake/toolchain-clang-esp32s2.cmake index 0dbda4aa8b..2ac8029825 100644 --- a/tools/cmake/toolchain-clang-esp32s2.cmake +++ b/tools/cmake/toolchain-clang-esp32s2.cmake @@ -5,13 +5,14 @@ set(CMAKE_SYSTEM_NAME Generic) set(CMAKE_C_COMPILER clang) set(CMAKE_CXX_COMPILER clang++) set(CMAKE_ASM_COMPILER clang) - +set(CMAKE_LINKER xtensa-esp32s2-elf-clang-ld) set(CMAKE_AR llvm-ar) set(CMAKE_RANLIB llvm-ranlib) -set(CMAKE_OBJDUMP xtensa-esp32s2-elf-objdump) +set(CMAKE_OBJDUMP xtensa-esp32s2-elf-clang-objdump) -remove_duplicated_flags("--target=xtensa-esp-elf -mcpu=esp32s2 ${CMAKE_C_FLAGS}" +remove_duplicated_flags("--target=xtensa-esp-elf -mcpu=esp32s2 \ + ${CMAKE_C_FLAGS}" UNIQ_CMAKE_C_FLAGS) set(CMAKE_C_FLAGS "${UNIQ_CMAKE_C_FLAGS}" CACHE STRING "C Compiler Base Flags" @@ -24,8 +25,16 @@ set(CMAKE_CXX_FLAGS "${UNIQ_CMAKE_CXX_FLAGS}" CACHE STRING "C++ Compiler Base Flags" FORCE) -remove_duplicated_flags("--target=xtensa-esp-elf -mcpu=esp32s2 -Xassembler --longcalls ${CMAKE_ASM_FLAGS}" +remove_duplicated_flags("--target=xtensa-esp-elf -mcpu=esp32s2 -Xassembler --longcalls \ + ${CMAKE_ASM_FLAGS}" UNIQ_CMAKE_ASM_FLAGS) set(CMAKE_ASM_FLAGS "${UNIQ_CMAKE_ASM_FLAGS}" CACHE STRING "Assembler Base Flags" FORCE) + +remove_duplicated_flags("--ld-path=xtensa-esp32s2-elf-clang-ld -z noexecstack \ + ${CMAKE_EXE_LINKER_FLAGS}" + UNIQ_CMAKE_EXE_LINKER_FLAGS) +set(CMAKE_EXE_LINKER_FLAGS "${UNIQ_CMAKE_EXE_LINKER_FLAGS}" + CACHE STRING "Linker Base Flags" + FORCE) diff --git a/tools/cmake/toolchain-clang-esp32s3.cmake b/tools/cmake/toolchain-clang-esp32s3.cmake index a420bfc50c..753e35a7a0 100644 --- a/tools/cmake/toolchain-clang-esp32s3.cmake +++ b/tools/cmake/toolchain-clang-esp32s3.cmake @@ -5,12 +5,14 @@ set(CMAKE_SYSTEM_NAME Generic) set(CMAKE_C_COMPILER clang) set(CMAKE_CXX_COMPILER clang++) set(CMAKE_ASM_COMPILER clang) +set(CMAKE_LINKER xtensa-esp32s3-elf-clang-ld) set(CMAKE_AR llvm-ar) set(CMAKE_RANLIB llvm-ranlib) -set(CMAKE_OBJDUMP xtensa-esp32s3-elf-objdump) +set(CMAKE_OBJDUMP xtensa-esp32s3-elf-clang-objdump) -remove_duplicated_flags("--target=xtensa-esp-elf -mcpu=esp32s3 ${CMAKE_C_FLAGS}" +remove_duplicated_flags("--target=xtensa-esp-elf -mcpu=esp32s3 \ + ${CMAKE_C_FLAGS}" UNIQ_CMAKE_C_FLAGS) set(CMAKE_C_FLAGS "${UNIQ_CMAKE_C_FLAGS}" CACHE STRING "C Compiler Base Flags" @@ -23,8 +25,16 @@ set(CMAKE_CXX_FLAGS "${UNIQ_CMAKE_CXX_FLAGS}" CACHE STRING "C++ Compiler Base Flags" FORCE) -remove_duplicated_flags("--target=xtensa-esp-elf -mcpu=esp32s3 -Xassembler --longcalls ${CMAKE_ASM_FLAGS}" +remove_duplicated_flags("--target=xtensa-esp-elf -mcpu=esp32s3 -Xassembler --longcalls \ + ${CMAKE_ASM_FLAGS}" UNIQ_CMAKE_ASM_FLAGS) set(CMAKE_ASM_FLAGS "${UNIQ_CMAKE_ASM_FLAGS}" CACHE STRING "Assembler Base Flags" FORCE) + +remove_duplicated_flags("--ld-path=xtensa-esp32s3-elf-clang-ld -z noexecstack \ + ${CMAKE_EXE_LINKER_FLAGS}" + UNIQ_CMAKE_EXE_LINKER_FLAGS) +set(CMAKE_EXE_LINKER_FLAGS "${UNIQ_CMAKE_EXE_LINKER_FLAGS}" + CACHE STRING "Linker Base Flags" + FORCE) diff --git a/tools/test_apps/system/.build-test-rules.yml b/tools/test_apps/system/.build-test-rules.yml index d2d874915c..90468165c8 100644 --- a/tools/test_apps/system/.build-test-rules.yml +++ b/tools/test_apps/system/.build-test-rules.yml @@ -19,7 +19,7 @@ tools/test_apps/system/cxx_no_except: tools/test_apps/system/cxx_pthread_bluetooth: enable: - - if: IDF_TARGET in ["esp32", "esp32c2", "esp32c3", "esp32s2", "esp32s3"] + - if: IDF_TARGET in ["esp32", "esp32s2", "esp32s3", "esp32c2", "esp32c3", "esp32c5", "esp32c6", "esp32h2", "esp32p4"] temporary: true reason: the other targets are not supported yet diff --git a/tools/test_apps/system/cxx_pthread_bluetooth/README.md b/tools/test_apps/system/cxx_pthread_bluetooth/README.md index 9aff432d9f..5620cb083f 100644 --- a/tools/test_apps/system/cxx_pthread_bluetooth/README.md +++ b/tools/test_apps/system/cxx_pthread_bluetooth/README.md @@ -1,5 +1,5 @@ -| Supported Targets | ESP32 | ESP32-C2 | ESP32-C3 | ESP32-S2 | ESP32-S3 | -| ----------------- | ----- | -------- | -------- | -------- | -------- | +| Supported Targets | ESP32 | ESP32-C2 | ESP32-C3 | ESP32-C5 | ESP32-C6 | ESP32-H2 | ESP32-P4 | ESP32-S2 | ESP32-S3 | +| ----------------- | ----- | -------- | -------- | -------- | -------- | -------- | -------- | -------- | -------- | # C++ pthread Example diff --git a/tools/tools.json b/tools/tools.json index 70515fe35d..94837cb6a5 100644 --- a/tools/tools.json +++ b/tools/tools.json @@ -257,41 +257,40 @@ "clang", "--version" ], - "version_regex": "version\\s*([0-9\\.]+)\\s*\\([^\\s]+\\s*(\\w{10}).+\\)", - "version_regex_replace": "\\1-\\2", + "version_regex": "\\([^\\s]+\\s+([0-9a-zA-Z\\.\\-_]+)\\)", "versions": [ { "linux-amd64": { - "sha256": "3dbd8dd290913a93e8941da8a451ecd49f9798cc2d74bb9b63ef5cf5c4fee37f", - "size": 215176120, - "url": "https://github.com/espressif/llvm-project/releases/download/esp-16.0.0-20230516/llvm-esp-16.0.0-20230516-linux-amd64.tar.xz" + "sha256": "c4d4bef40532b777907bdf35cf10d91432a4c6b8351ee0a21cf3332fc9aabdb1", + "size": 296940300, + "url": "https://github.com/espressif/llvm-project/releases/download/esp-17.0.1_20240419/clang-esp-17.0.1_20240419-x86_64-linux-gnu.tar.xz" }, "linux-arm64": { - "sha256": "4b115af6ddd04a9bffc1908fc05837998ee71d450891d741c446186f2aa9b961", - "size": 222261932, - "url": "https://github.com/espressif/llvm-project/releases/download/esp-16.0.0-20230516/llvm-esp-16.0.0-20230516-linux-arm64.tar.xz" + "sha256": "200d12bca443f8c751dfdd8e0abdc388832820ca8ebfff86952302146b972cf9", + "size": 286403588, + "url": "https://github.com/espressif/llvm-project/releases/download/esp-17.0.1_20240419/clang-esp-17.0.1_20240419-aarch64-linux-gnu.tar.xz" }, "linux-armhf": { - "sha256": "935082bb0704420c5ca42b35038bba8702135348a50cac454ae2fb55af0b4c32", - "size": 214888520, - "url": "https://github.com/espressif/llvm-project/releases/download/esp-16.0.0-20230516/llvm-esp-16.0.0-20230516-linux-armhf.tar.xz" + "sha256": "9731b04ef704748a2579ead5960a556e85ffd536d69b41022cbf2d5e59fa178c", + "size": 286907980, + "url": "https://github.com/espressif/llvm-project/releases/download/esp-17.0.1_20240419/clang-esp-17.0.1_20240419-arm-linux-gnueabihf.tar.xz" }, "macos": { - "sha256": "d9824acafd3e7b1d17ace084243b82a95bbdcb149a26b085bba487ab3d3716d7", - "size": 182440672, - "url": "https://github.com/espressif/llvm-project/releases/download/esp-16.0.0-20230516/llvm-esp-16.0.0-20230516-macos.tar.xz" + "sha256": "02ebf1c3efc8b3514b774a5c02c51a5cdd23d6d35769c1a1698006bb41e25a97", + "size": 272744196, + "url": "https://github.com/espressif/llvm-project/releases/download/esp-17.0.1_20240419/clang-esp-17.0.1_20240419-x86_64-apple-darwin.tar.xz" }, "macos-arm64": { - "sha256": "ed5621396dc3e48413e14e8b6caed8e2993e7f2ab5fca1410081f40c940a1060", - "size": 171912324, - "url": "https://github.com/espressif/llvm-project/releases/download/esp-16.0.0-20230516/llvm-esp-16.0.0-20230516-macos-arm64.tar.xz" + "sha256": "c422ebe6c497182020e9bb9e5896f415d3bc7635b4d996c7f16fb060124c28c2", + "size": 252779444, + "url": "https://github.com/espressif/llvm-project/releases/download/esp-17.0.1_20240419/clang-esp-17.0.1_20240419-aarch64-apple-darwin.tar.xz" }, - "name": "16.0.1-fe4f10a809", + "name": "esp-17.0.1_20240419", "status": "recommended", "win64": { - "sha256": "598c8241c8bf10fd1be8bd21845307cfc404e127041b4ba4e828350a88692883", - "size": 243979484, - "url": "https://github.com/espressif/llvm-project/releases/download/esp-16.0.0-20230516/llvm-esp-16.0.0-20230516-win64.tar.xz" + "sha256": "341d3eed6881fbea19910fee5254a2f9c5406d2948bf0814a1c567d8c65dadcb", + "size": 410784492, + "url": "https://github.com/espressif/llvm-project/releases/download/esp-17.0.1_20240419/clang-esp-17.0.1_20240419-x86_64-w64-mingw32.tar.xz" } } ]