Browse Source

bfin: fix compile and linking errors with gcc 14.2.0

ld.so must be compiled with -ffreestanding to avoid emits of
memset/memcpy from gcc.
Disable some extra warnings for Blackfin to avoid a compile
error.
Waldemar Brodkorb 3 weeks ago
parent
commit
b996cd610e
2 changed files with 8 additions and 0 deletions
  1. 3 0
      Rules.mak
  2. 5 0
      ldso/ldso/Makefile.in

+ 3 - 0
Rules.mak

@@ -668,6 +668,9 @@ endif
 ifeq ($(TARGET_ARCH),i386)
 CFLAGS += -fno-omit-frame-pointer
 endif
+ifeq ($(TARGET_ARCH),bfin)
+CFLAGS += -Wno-implicit-function-declaration
+endif
 ifneq ($(strip $(UCLIBC_EXTRA_LDFLAGS)),"")
 LDFLAGS += $(call qstrip,$(UCLIBC_EXTRA_LDFLAGS))
 endif

+ 5 - 0
ldso/ldso/Makefile.in

@@ -19,6 +19,11 @@ ifeq ($(TARGET_ARCH),arm)
 CFLAGS-rtld += -fno-unwind-tables -fno-asynchronous-unwind-tables
 endif
 
+ifeq ($(TARGET_ARCH),bfin)
+# for gcc 10.5.0 and above we need to use -ffreestanding
+CFLAGS-rtld += -ffreestanding
+endif
+
 CFLAGS-rtld += -I$(top_srcdir)ldso/ldso/$(TARGET_ARCH) -I$(top_srcdir)ldso/include -I$(top_srcdir)ldso/ldso
 CFLAGS-rtld += -DUCLIBC_RUNTIME_PREFIX=\"$(RUNTIME_PREFIX)\" -DUCLIBC_LDSO=\"$(UCLIBC_LDSO)\"