Skip to content

Commit

Permalink
Disable implicit-function-declaration error for newlib
Browse files Browse the repository at this point in the history
GCC14 will treat implicit-function-declaration as an error by default.
See https://gcc.gnu.org/gcc-14/porting_to.html for details.

Some libc function like __trap34 are defined in assembly and break this GCC diagnostic.

Signed-off-by: Nik Konyuchenko <spaun2002mobile@gmail.com>
  • Loading branch information
nikkon-dev authored and cpackham committed May 18, 2024
1 parent 360a483 commit 3cb85fb
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions scripts/build/libc/newlib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,9 @@ ENABLE_TARGET_OPTSPACE:target-optspace
[ "${CT_LIBC_NEWLIB_LTO}" = "y" ] && \
CT_LIBC_NEWLIB_TARGET_CFLAGS="${CT_LIBC_NEWLIB_TARGET_CFLAGS} -flto"

[ "${CT_GCC_14_or_later}" = "y" ] && \
CT_LIBC_NEWLIB_TARGET_CFLAGS="${CT_LIBC_NEWLIB_TARGET_CFLAGS} -Wno-error=implicit-function-declaration -Wno-implicit-int"

cflags_for_target="${CT_ALL_TARGET_CFLAGS} ${CT_LIBC_NEWLIB_TARGET_CFLAGS}"

# Note: newlib handles the build/host/target a little bit differently
Expand Down

0 comments on commit 3cb85fb

Please sign in to comment.