> One way to solve this would be to set DEB_BUILD_OPTIONS=optimize=-lto, to > exclude the LTO flags specifically so that they don't leak into the target > builds. Another thought I had was to use the dpkg-buildflags for armhf as a > target architecture, since there could be other per-arch flags in the future > that cause further problems. I've tried the latter approach in the attached > patch, which fixes the problem of lto being incorrectly used for the > arm-none-eabi target. I've verified that the resulting libstdc++ is usable > again with this change.
Yeah, neither of these is really appropriate; we're not building Debian code here. As 'rules' already sets the complete CFLAGS and CXXFLAGS values save the necessary flags for a reproducible build, how about I just add `-ffile-prefix-map=$(TOP_DIR)=.` manually and stop using /usr/share/dpkg/buildflags.mk? @@ -10,7 +10,6 @@ MULTILIB_LIST="--with-multilib-list=rmprofile" GCC_PACKAGE=gcc-arm-none-eabi include /usr/share/dpkg/pkg-info.mk -include /usr/share/dpkg/buildflags.mk SVERSION := $(shell dpkg-query -W -f="\$${Version}\n" $(GCC_PACKAGE)-source) DVERSION := $(SVERSION)+$(DEB_VERSION) @@ -29,6 +28,9 @@ BUILD_PICOLIBC_RELEASE_DIR=$(TOP_DIR)/build_picolibc_release/libstdc++ PNEWLIB=libstdc\+\+-arm-none-eabi-newlib PPICOLIBC=libstdc\+\+-arm-none-eabi-picolibc +CFLAGS := -ffile-prefix-map=$(TOP_DIR)=. -Wformat -Werror=format-security +CXXFLAGS := $(CFLAGS) + BUILDFLAGS=CFLAGS="$(CFLAGS) -g -O2 -ffunction-sections -fdata-sections" CXXFLAGS="$(CXXFLAGS) -g -O2 -ffunction-sections -fdata-sections" LDFLAGS="$(LDFLAGS)" BUILDFLAGS_NANO=CFLAGS="$(CFLAGS) -g -Os -ffunction-sections -fdata-sections -fno-exceptions" CXXFLAGS="$(CXXFLAGS) -g -Os -ffunction-sections -fdata-sections -fno-exceptions" LDFLAGS="$(LDFLAGS)" BUILDFLAGS_PICOLIBC=CFLAGS="--specs=picolibc.specs $(CFLAGS) -g -Os -ffunction-sections -fdata-sections" CXXFLAGS="--specs=picolibcpp.specs $(CXXFLAGS) -g -Os -ffunction-sections -fdata-sections" LDFLAGS="--specs=picolibc.specs $(LDFLAGS)" -- -keith
signature.asc
Description: PGP signature