This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Hi
I would like to build Bluetopia stack.
Host is Linux x86_64. Target is Linux on ARM 32 bit.
Toolchain is 10.3-2021.07 from arm developer.
The problem occurs in the following step during compilation:
LN BTPMSRVR_S.o libBTPM_S.a libBTPM_HAL_S.a libSS1BTAUD.a libSS1BTGAV.a libSS1BTAVC.a libSS1BTAVR.a libSS1SBC.a libSS1BTFTP.a libSS1BTHDP.a libSS1BTHDS.a libSS1BTHIDH.a libSS1BTHID.a libSS1BTPBA.a libSS1BTHFR.a libSS1BTMAP.a libSS1BTOPP.a libSS1BTCTS.a libSS1BTNDCS.a libSS1BTRTUS.a libSS1BTDIS.a libSS1BTGAT.a libSS1BTGAPS.a libSS1BTHIDS.a libSS1BTNDC.a libSS1BTRTU.a libSS1BTIAS.a libSS1BTHRS.a libSS1BTSCP.a libSS1BTLLS.a libSS1BTBAS.a libSS1BTTPS.a libBTPS.a libBTPS_PLA.a libBTPS_OSA.a -o SS1BTPM
The problem is:
/opt/arm-buildroot-linux-gnueabihf_sdk-buildroot/opt/ext-toolchain/bin/../lib/gcc/arm-none-linux-gnueabihf/10.3.1/../../../../arm-none-linux-gnueabihf/bin/ld: ../BluetopiaPM/lib/libBTPM_S.a(BTPMMAIN_S.o): relocation R_ARM_MOVW_ABS_NC against `a local symbol' can not be used when making a shared object; recompile with -fPIC
... many similar logs
/opt/arm-buildroot-linux-gnueabihf_sdk-buildroot/opt/ext-toolchain/bin/../lib/gcc/arm-none-linux-gnueabihf/10.3.1/../../../../arm-none-linux-gnueabihf/bin/ld: ../BluetopiaPM/Bluetopia/lib/libBTPS.a(LOCKFILE.o): relocation R_ARM_MOVW_ABS_NC against `a local symbol' can not be used when making a shared object; recompile with -fPIC
collect2: fatal error: ld terminated with signal 11 [Segmentation fault], core dumped
compilation terminated.
proj/plat-rules.mak:101: recipe for target '../BluetopiaPM/bin/SS1BTPM' failed
make: *** [../BluetopiaPM/bin/SS1BTPM] Error 1
I have set the -fPIC flag for compiler. But the same issue still occurs.
Could someone help me? Thank you in advance!
With best regards,
Milan
We are not sure about this. looks like a conflict between the tool chains.
Can you try using the default tool chain (from the SDK)?
The reason I am using the toolchain 10.3-2021.07 from arm developer is that the same toolchain is used for building GNU/Linux OS. And it will be used to build other stacks and applications. I assume your toolchain will work. But, is it possible to build Bluetopia with other/my toolchain as well? How to achieve that?
Depending on the compilation flags the existing libraries should work with your compiler.
What is the exact arm processor in your system?
Can you compile your code with "-fno-pic"?
It is ARM Cortex-A7. The flag -fno-pic did not help.
These are the CFLAGS from toolchain-defs.mak
CFLAGS+=-march=armv7-a -marm -mthumb -mfloat-abi=hard -mfpu=neon -mtune=cortex-a7 --sysroot=$(TOOLCHAIN_PATH_TARGET) -I$(TOOLCHAIN_PATH_TARGET)/usr/include
Plus the the suggested flag from platform.mak
CFLAGS += -fno-pic
Are you trying to link the the library as a shared object? (if so, please make it static)
can you provide the command line for the linker?
We are still trying to find a solution that can work with the exiting build.