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 issue in GCC 12 (Linker bug) #84

Open
yafshar opened this issue Oct 8, 2022 · 1 comment
Open

linking issue in GCC 12 (Linker bug) #84

yafshar opened this issue Oct 8, 2022 · 1 comment

Comments

@yafshar
Copy link
Member

yafshar commented Oct 8, 2022

@ellio167 I have encountered a linking issue using C++ in the GCC 12 (12.2.0) release.

[ 52%] Linking CXX shared library libkim-api.dylib
...
0  0x10fc07ffa  __assert_rtn + 139
1  0x10fa3b28d  mach_o::relocatable::Parser<x86_64>::parse(mach_o::relocatable::ParserOptions const&) + 4989
2  0x10fa2bf8f  mach_o::relocatable::Parser<x86_64>::parse(unsigned char const*, unsigned long long, char const*, long, ld::File::Ordinal, mach_o::relocatable::ParserOptions const&) + 207
3  0x10faa29d4  ld::tool::InputFiles::makeFile(Options::FileInfo const&, bool) + 2036
4  0x10faa5fa0  ___ZN2ld4tool10InputFilesC2ER7Options_block_invoke + 48
5  0x7ff80714634a  _dispatch_client_callout2 + 8
6  0x7ff8071578f5  _dispatch_apply_invoke + 213
7  0x7ff807146317  _dispatch_client_callout + 8
8  0x7ff807155c0c  _dispatch_root_queue_drain + 673
9  0x7ff80715625c  _dispatch_worker_thread2 + 160
10  0x7ff8072f9f8a  _pthread_wqthread + 256
A linker snapshot was created at:
	/tmp/libkim-api.2.3.0.dylib-2022-10-08-133230.ld-snapshot
ld: Assertion failed: (_file->_atomsArrayCount == computedAtomCount && "more atoms allocated than expected"), function parse, file macho_relocatable_file.cpp, line 2061.
collect2: error: ld returned 1 exit status
make[2]: *** [libkim-api.2.3.0.dylib] Error 1
make[1]: *** [CMakeFiles/kim-api.dir/all] Error 2
make: *** [all] Error 2

I did not dig into the issue and used a simple workaround by enabling the C++11 feature with -DCMAKE_CXX_STANDARD=11.
@ellio167, in case someone has the same issue, this is a simple workaround for now.

@yafshar yafshar changed the title linking issue in GCC 12 linking issue in GCC 12 (Linker bug) Oct 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant