Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Linking fails with UB sanitizer unless it's Debug mode #5161

Open
kimden opened this issue Aug 22, 2024 · 0 comments
Open

Linking fails with UB sanitizer unless it's Debug mode #5161

kimden opened this issue Aug 22, 2024 · 0 comments

Comments

@kimden
Copy link
Contributor

kimden commented Aug 22, 2024

Compiling with cmake .. -DCMAKE_BUILD_TYPE=???? -DNO_SHADERC=OFF -DUSE_USAN=ON -DUSE_ASAN=OFF fails at the stage of linking with both RelWithDebInfo (1) and Release (2) with the following similar errors:

(1)

/usr/bin/ld: lib/bullet/libbulletcollision.a(btSimpleBroadphase.cpp.o): warning: relocation against `gOverlappingPairs' in read-only section `.text'
/usr/bin/ld: lib/bullet/libbulletcollision.a(btSimpleBroadphase.cpp.o): in function `btSimpleBroadphase::calculateOverlappingPairs(btDispatcher*)':
/folder/lib/bullet/src/BulletCollision/BroadphaseCollision/btSimpleBroadphase.cpp:318:(.text+0x72ce): undefined reference to `gOverlappingPairs'
/usr/bin/ld: /folder/lib/bullet/src/BulletCollision/BroadphaseCollision/btSimpleBroadphase.cpp:318:(.text+0x72e6): undefined reference to `gOverlappingPairs'
/usr/bin/ld: warning: creating DT_TEXTREL in a PIE
collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/supertuxkart.dir/build.make:7149: bin/supertuxkart] Error 1
make[1]: *** [CMakeFiles/Makefile2:273: CMakeFiles/supertuxkart.dir/all] Error 2
make: *** [Makefile:136: all] Error 2

(2)

/usr/bin/ld: lib/bullet/libbulletcollision.a(btSimpleBroadphase.cpp.o): warning: relocation against `gOverlappingPairs' in read-only section `.text'
/usr/bin/ld: lib/bullet/libbulletcollision.a(btSimpleBroadphase.cpp.o): in function `btSimpleBroadphase::calculateOverlappingPairs(btDispatcher*)':
btSimpleBroadphase.cpp:(.text+0x86ec): undefined reference to `gOverlappingPairs'
/usr/bin/ld: btSimpleBroadphase.cpp:(.text+0x8702): undefined reference to `gOverlappingPairs'
/usr/bin/ld: warning: creating DT_TEXTREL in a PIE
collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/supertuxkart.dir/build.make:7149: bin/supertuxkart] Error 1
make[1]: *** [CMakeFiles/Makefile2:273: CMakeFiles/supertuxkart.dir/all] Error 2
make: *** [Makefile:136: all] Error 2

Configuration

STK release version: latest git 88cd5cf

System: Ubuntu 23.10

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants