Hello, On Thu, Aug 26, 2021 at 1:06 AM Mahyar Shokraeian via Gcc-help < gcc-help@xxxxxxxxxxx> wrote: > why gcc won't support FDPIC in thumb mode? > > I'm trying to build a toolchain for my mmu-less cortex m7 cpu that is > running the latest release of the mainline linux kernel using crosstool-ng. > I've set the instruction-set to thumb because cortex m doesn't support ARM > ISA (it's a thumb only processor). > > because I use shared libraries, I need FDPIC ELF instead of flat BFLT > executables. so, I choosed FDPIC in the crosstool-ng configuration > menuconfig. > > when I build the toolchain, it throws a very strange error. > > cc1: sorry, unimplemented: FDPIC mode is not supported in Thumb-1 mode > > I'm so confused! FDPIC ELF format is mainly designed for mmu-less > architectures such as cortex-m and cortex-r that are thumb only processors. > so why it is saying that FDPIC mode is not supported in Thumb-1 mode? > Even I've set -mcpu=cortex-m7 and -march=armv7e-m in my toolchain > configuration but still I see the error. > At which point exactly do you see this error? I run daily builds of arm-none-uclinuxfdpiceabi for cortex-m4, which is similar to cortex-m7 from FDPIC perspective. Both support thumb-2, so it should be OK. Note that FDPIC support has not been ported to thumb-1, as indicated by the error message you are seeing. Maybe you are facing the problem when building multilibs for thumb1? Christophe these are some useful sources about fdpic format on ARM MCUs: > > > https://static.linaro.org/connect/sfo15/Presentations/09-24-Thursday/SFO15-406-%20ARM%20FDPIC%20Toolchains.pdf > > https://gcc.gnu.org/legacy-ml/gcc-patches/2019-09/msg00098.html > > https://gcc.gnu.org/legacy-ml/gcc-patches/2019-09/msg00533.html > > > https://www.google.com/url?sa=t&source=web&rct=j&url=https://ntnuopen.ntnu.no/ntnu-xmlui/bitstream/handle/11250/250748/347817_FULLTEXT01.pdf%3Fsequence%3D3&ved=2ahUKEwiztaiqgMbyAhUFwKQKHeeGAGQ4ChAWegQIHRAB&usg=AOvVaw3SLe1u323I7JjkoqBipoXH > > > Sent from Mail<https://go.microsoft.com/fwlink/?LinkId=550986> for Windows > >