- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have a library that is configured with CMake. During the configuration phase, CMake's test (via check_ipo_supported) for IPO optimization support of ifx fails, stating that the compiler (ifx) does not support IPO optimization. If I enforce IPO explicitly with ifx compiler flags, I get the following LLVM errors during the linking phase:
ld: /tmp/lto-llvm-ecd5af.o:(.rodata.strlit.1.llvm.0+0x0): multiple definition of `strlit.1.llvm.0'; /tmp/lto-llvm-6a50da.o:(.rodata.strlit.1.llvm.0+0x0): first defined here
ld: /tmp/lto-llvm-bd59f7.o:(.rodata.str1.16+0x30): multiple definition of `strlit.16.llvm.0'; /tmp/lto-llvm-58bd2a.o:(.rodata.strlit.16.llvm.0+0x0): first defined here
ld: /tmp/lto-llvm-e20798.o:(.rodata.strlit.1.llvm.0+0x0): multiple definition of `strlit.1.llvm.0'; /tmp/lto-llvm-6a50da.o:(.rodata.strlit.1.llvm.0+0x0): first defined here
ld: /tmp/lto-llvm-e20798.o:(.rodata.strlit.llvm.0+0x0): multiple definition of `strlit.llvm.0'; /tmp/lto-llvm-281b67.o:(.rodata.strlit.llvm.0+0x0): first defined here
ld: /tmp/lto-llvm-8a56ed.o:(.rodata.strlit.1.llvm.0+0x0): multiple definition of `strlit.1.llvm.0'; /tmp/lto-llvm-6a50da.o:(.rodata.strlit.1.llvm.0+0x0): first defined here
ld: /tmp/lto-llvm-bc72e5.o:(.rodata.strlit.6.llvm.0+0x0): multiple definition of `strlit.6.llvm.0'; /tmp/lto-llvm-8a56ed.o:(.rodata.strlit.6.llvm.0+0x0): first defined here
ld: /tmp/lto-llvm-bc72e5.o:(.rodata.strlit.5.llvm.0+0x0): multiple definition of `strlit.5.llvm.0'; /tmp/lto-llvm-8a56ed.o:(.rodata.strlit.5.llvm.0+0x0): first defined here
ld: /tmp/lto-llvm-f75a37.o:(.rodata.strlit.17.llvm.0+0x0): multiple definition of `strlit.17.llvm.0'; /tmp/lto-llvm-58bd2a.o:(.rodata.strlit.17.llvm.0+0x0): first defined here
ld: /tmp/lto-llvm-f75a37.o:(.rodata.strlit.22.llvm.0+0x0): multiple definition of `strlit.22.llvm.0'; /tmp/lto-llvm-58bd2a.o:(.rodata.cst4+0x14): first defined here
ld: /tmp/lto-llvm-f75a37.o:(.rodata.strlit.1.llvm.0+0x0): multiple definition of `strlit.1.llvm.0'; /tmp/lto-llvm-6a50da.o:(.rodata.strlit.1.llvm.0+0x0): first defined hereAny ideas why such an error may be happening?
The IFX compiler flags explicitly passed are the following:
-O3 -fPIC -nologo -threads -standard-semantics -integer-size 32 -static-intel -unroll -finline-functions -ftz -inline-forceinline -flto=thin -heap-arraysThe IFX linker flags explicitly passed are the following:
-fPIC -O3 -nologo -threads -standard-semantics -integer-size 32 -diag-disable=7025 -diag-disable=5268 -diag-disable=10346 -diag-disable=10448 -static-intel -O3 -unroll -diag-disable=10397 -finline-functions -ftz -qopt-report=2 -inline-forceinline -flto=thin -fpic -shared -qopenmp-link=static -static -static-libstdc++ -static-libgcc -shared -nofor-main
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
After extensive investigation, it turns out that passing the `--allow-multiple-definition` flag to the linker resolves the issue. But I consider it only a temporary solution. I still appreciate any permanent fix to the above compilation error. The platform is Microsoft WSL Ubuntu.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Do you have a small reproducer showing this problem?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Unfortunately, I do not have a minimal reproducible example yet. The flag I mentioned above (`--allow-multiple-definition`) has temporarily bypassed the issue, although I suppose that is not a permanent solution. I will work on a minimal reproducer to share here as soon as other obligations allow.
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page