Tag_ABI_PCS_GOT_use属性值“2”与之前看到的属性值不同(“1”);合并不兼容的文件

Tag_ABI_PCS_GOT_use attribute value of "2" that is different than one previously seen ("1"); combining incompatible files

提问人:kowshik 提问时间:6/27/2023 最后编辑:kowshik 更新时间:7/7/2023 访问量:39

问:

我使用适用于 ARM Cortex-R5 CPU 的 TIARMCLANG 编译器从头开始编译了 OpenCV 库,构建完成后,我尝试链接到 CCS Studio IDE(适用于 TI MCU 的 IDE)中的简单 CPP 项目,然后出现多重错误,如下所示

Description Resource    Path    Location    Type
#16004-D file "/home/kowshik/Desktop/opencv_porting/opencv_with_tiarmclang/build/lib/libopencv_core.a<alloc.cpp.obj>" has a Tag_ABI_PCS_GOT_use attribute value of "2" that is different than one previously seen ("1"); combining incompatible files   opencv_test_code            C/C++ Problem
#16004-D file "/home/kowshik/Desktop/opencv_porting/opencv_with_tiarmclang/build/lib/libopencv_core.a<alloc.cpp.obj>" has a Tag_ABI_PCS_RO_data attribute value of "1" that is different than one previously seen ("0"); combining incompatible files   opencv_test_code            C/C++ Problem
#16004-D file "/home/kowshik/Desktop/opencv_porting/opencv_with_tiarmclang/build/lib/libopencv_core.a<alloc.cpp.obj>" has a Tag_ABI_PCS_RW_data attribute value of "1" that is different than one previously seen ("0"); combining incompatible files   opencv_test_code            C/C++ Problem
#16004-D file "/home/kowshik/Desktop/opencv_porting/opencv_with_tiarmclang/build/lib/libopencv_core.a<arithm.cpp.obj>" has a Tag_ABI_PCS_GOT_use attribute value of "2" that is different than one previously seen ("1"); combining incompatible files  opencv_test_code            C/C++ Problem
#16004-D file "/home/kowshik/Desktop/opencv_porting/opencv_with_tiarmclang/build/lib/libopencv_core.a<arithm.cpp.obj>" has a Tag_ABI_PCS_RO_data attribute value of "1" that is different than one previously seen ("0"); combining incompatible files  opencv_test_code            C/C++ Problem
#16004-D file "/home/kowshik/Desktop/opencv_porting/opencv_with_tiarmclang/build/lib/libopencv_core.a<arithm.cpp.obj>" has a Tag_ABI_PCS_RW_data attribute value of "1" that is different than one previously seen ("0"); combining incompatible files  opencv_test_code            C/C++ Problem
#16004-D file "/home/kowshik/Desktop/opencv_porting/opencv_with_tiarmclang/build/lib/libopencv_core.a<arithm.dispatch.cpp.obj>" has a Tag_ABI_PCS_GOT_use attribute value of "2" that is different than one previously seen ("1"); combining incompatible files opencv_test_code            C/C++ Problem
#16004-D file "/home/kowshik/Desktop/opencv_porting/opencv_with_tiarmclang/build/lib/libopencv_core.a<arithm.dispatch.cpp.obj>" has a Tag_ABI_PCS_RO_data attribute value of "1" that is different than one previously seen ("0"); combining incompatible files opencv_test_code            C/C++ Problem
#16004-D file "/home/kowshik/Desktop/opencv_porting/opencv_with_tiarmclang/build/lib/libopencv_core.a<arithm.dispatch.cpp.obj>" has a Tag_ABI_PCS_RW_data attribute value of "1" that is different than one previously seen ("0"); combining incompatible files opencv_test_code            C/C++ Problem

以下是我的编译器标志和我用于编译这些 CPP 文件的命令。

/home/kowshik/ti/ti-cgt-armllvm_3.0.0.STS//bin/tiarmclang -DOPENCV_HAVE_FILESYSTEM_SUPPORT=0 -I/home/kowshik/Desktop/opencv_porting/opencv_with_tiarmclang/build -I/home/kowshik/Desktop/opencv_porting/opencv_with_tiarmclang/build/3rdparty/ade/ade-0.1.2a/sources/ade/include -w --specs=nosys.specs -frtti -fshort-enums -fshort-wchar -Wno-unknown-warning-option -Wno-unused-command-line-argument -Wno-suggest-override -mfpu=vfpv3-d16 -mabi=aapcs -Wno-narrowing -fno-pie -fno-pic -fexceptions -fpermissive -mcpu=cortex-r5 -mthumb -mfloat-abi=hard --std=c++11 -I/home/kowshik/Desktop/opencv_porting/opencv_with_tiarmclang/fake_root_test/include   -fsigned-char -W -Wall -Wreturn-type -Wnon-virtual-dtor -Waddress -Wsequence-point -Wformat -Wformat-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Winconsistent-missing-override -Wno-delete-non-virtual-dtor -Wno-unnamed-type-template-args -Wno-comment -Wno-deprecated-enum-enum-conversion -Wno-deprecated-anon-enum-enum-conversion -fdiagnostics-show-option -Qunused-arguments -ffunction-sections -fdata-sections  -fvisibility=hidden -fvisibility-inlines-hidden -Ofast   -DNDEBUG -fPIC -std=c++11 -o CMakeFiles/ade.dir/3rdparty/ade/ade-0.1.2a/sources/ade/source/alloc.cpp.obj -c /home/kowshik/Desktop/opencv_porting/opencv_with_tiarmclang/build/3rdparty/ade/ade-0.1.2a/sources/ade/source/alloc.cpp

我的 C 和 C++ 标志附在下面

SET(CMAKE_C_FLAGS   "-w --specs=nosys.specs -frtti -fshort-enums -fshort-wchar -Wno-unknown-warning-option -Wno-unused-command-line-argument -Wno-suggest-override -mfpu=vfpv3-d16 -Wno-narrowing -fno-pie -fno-pic -fexceptions -fpermissive -mcpu=cortex-r5 -mthumb -mfloat-abi=hard -mfpu=vfpv3-d16 -I/home/kowshik/Desktop/opencv_porting/opencv_with_tiarmclang/fake_root_test/include" CACHE STRING "c compiler flags")
SET(CMAKE_CXX_FLAGS "-w --specs=nosys.specs -frtti -fshort-enums -fshort-wchar -Wno-unknown-warning-option -Wno-unused-command-line-argument -Wno-suggest-override -mfpu=vfpv3-d16 -mabi=aapcs -Wno-narrowing -fno-pie -fno-pic -fexceptions -fpermissive -mcpu=cortex-r5 -mthumb -mfloat-abi=hard --std=c++11 -I/home/kowshik/Desktop/opencv_porting/opencv_with_tiarmclang/fake_root_test/include" CACHE STRING "cxx compiler flags")
编译 链接器错误 armclang

评论


答:

0赞 kowshik 7/7/2023 #1

上述错误主要是由于启用了 PIC 功能(与位置无关的代码)引起的。有些编译器可能支持此功能,有些可能不支持。因此,在我的构建系统中,我禁用了 PIC 选项,这些选项消失了。

请注意,即使您在编译器标志中传递 -fno-pic,如果启用了 -fPIC,它仍然不会覆盖。所以请小心这一点。