build: Make bitmap object files position independent to silence linker warnings

Finally addresses the "warning: creating DT_TEXTREL in a shared object" warnings
seen when linking plugins that reference bitmaps.

This currently only happens with simulator builds using recent-ish
toolchains (GCC >= 12 IIRC).  However, binutils 2.46 promotes this
warning to an error, so it's finally tracked down and addressed.

Change-Id: I4b4926c14f7c0047496892c55009c26da2a4756d
This commit is contained in:
Solomon Peachy 2026-05-02 13:22:51 -04:00
parent 88d4903d10
commit 0dc670d25c
2 changed files with 16 additions and 0 deletions

View file

@ -50,3 +50,11 @@ $(BUILDDIR)/apps/bitmaps/remote_mono/%.c: $(ROOTDIR)/apps/bitmaps/remote_mono/%.
$(BUILDDIR)/apps/bitmaps/remote_native/%.c: $(ROOTDIR)/apps/bitmaps/remote_native/%.bmp $(TOOLSDIR)/bmp2rb
$(SILENT)mkdir -p $(dir $@) $(BMPINCDIR)
$(call PRINTS,BMP2RB $(<F))$(BMP2RB_REMOTENATIVE) -b -h $(BMPINCDIR) $< > $@
ifdef APP_TYPE
# Bitmaps must be explicitly Position independent to avoid linker warnings
$(BUILDDIR)/apps/bitmaps/native/%.o: CFLAGS += -fPIC
$(BUILDDIR)/apps/bitmaps/mono/%.o: CFLAGS += -fPIC
$(BUILDDIR)/apps/bitmaps/remote_mono/%.o: CFLAGS += -fPIC
$(BUILDDIR)/apps/bitmaps/remote_native/%.o: CFLAGS += -fPIC
endif

View file

@ -58,4 +58,12 @@ $(BUILDDIR)/apps/plugins/bitmaps/remote_native/%.c: $(ROOTDIR)/apps/plugins/bitm
$(SILENT)mkdir -p $(dir $@) $(PBMPINCDIR)
$(call PRINTS,BMP2RB $(<F))$(BMP2RB_REMOTENATIVE) -b -h $(PBMPINCDIR) $< > $@
ifdef APP_TYPE
# Bitmaps must be explicitly Position independent to avoid linker warnings
$(BUILDDIR)/apps/plugins/bitmaps/native/%.o: CFLAGS += -fPIC
$(BUILDDIR)/apps/plugins/bitmaps/mono/%.o: CFLAGS += -fPIC
$(BUILDDIR)/apps/plugins/bitmaps/remote_mono/%.o: CFLAGS += -fPIC
$(BUILDDIR)/apps/plugins/bitmaps/remote_native/%.o: CFLAGS += -fPIC
endif
endif