[odb-users] Linker error building odb on mac 12

Cunliffe, Sam s.cunliffe at ucl.ac.uk
Wed Sep 21 07:01:19 EDT 2022


Hello Boris,

Thanks a lot for the tips!

So, for completeness: I was using Xcode/CLT 14 w/ clang 14.0.0. And I had tried both gcc at 12 and gcc at 11 (same error).

But your suspicions...

> Also, your error looks very similar to the Xcode 14 ld bug mentioned,
> for example[2]. So maybe also try downgrading Xcode/CLT.
>
> [1] https://github.com/Homebrew/homebrew-core/issues/110673
> [2] https://github.com/open-source-parsers/jsoncpp/issues/1434

seem to be correct. I've just downgraded Xcode/CLT to 13.4 and have successfully compiled odb (both gcc at 11 and gcc at 12 ... for good measure).

Thanks again,
Sam.

________________________________________
From: Boris Kolpackov <boris at codesynthesis.com>
Sent: 20 September 2022 16:21
To: Cunliffe, Sam
Cc: odb-users at codesynthesis.com
Subject: Re: [odb-users] Linker error building odb on mac 12

⚠ Caution: External sender


Cunliffe, Sam <s.cunliffe at ucl.ac.uk> writes:

> > g++-12 --version
> g++-12 (Homebrew GCC 12.2.0) 12.2.0

For completeness, what version of Xcode/Command Line Tools do you have?
If you don't know, `clang --version` output should be sufficient to trace
it back.


> > bpkg build odb at https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fpkg.cppget.org%2F1%2Fbeta&amp;data=05%7C01%7Cs.cunliffe%40ucl.ac.uk%7C942253185b234017719808da9b1bc157%7C1faf88fea9984c5b93c9210a11d9a5c2%7C0%7C0%7C637992840752371766%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=kiLhIONF7U1wLlHlEv7Aeg7yJDBsS7yKvzo79EulaEs%3D&amp;reserved=0
> ### full output pasted below but the errors are... ###
> ld: warning: -undefined dynamic_lookup may not work with chained fixups
> 0  0x1022241a0  __assert_rtn + 140
> 1  0x1020aba8c  mach_o::relocatable::Parser<arm64>::parse(mach_o::relocatable::ParserOptions const&) + 4536
> 2  0x10207dd38  mach_o::relocatable::Parser<arm64>::parse(unsigned char const*, unsigned long long, char const*, long, ld::File::Ordinal, mach_o::relocatable::ParserOptions const&) + 148
> 3  0x1020c8180  archive::File<arm64>::makeObjectFileForMember(archive::File<arm64>::Entry const*) const + 1084
> 4  0x1020c7ac8  archive::File<arm64>::File(unsigned char const*, unsigned long long, char const*, long, ld::File::Ordinal, archive::ParserOptions const&) + 856
> 5  0x1020c002c  archive::parse(unsigned char const*, unsigned long long, char const*, long, ld::File::Ordinal, archive::ParserOptions const&) + 388
> 6  0x1020e66d0  ld::tool::InputFiles::makeFile(Options::FileInfo const&, bool) + 2016
> 7  0x1020e9360  ___ZN2ld4tool10InputFilesC2ER7Options_block_invoke + 56
> 8  0x1b81741f4  _dispatch_client_callout2 + 20
> 9  0x1b8187954  _dispatch_apply_invoke + 224
> 10  0x1b81741b4  _dispatch_client_callout + 20
> 11  0x1b8185a04  _dispatch_root_queue_drain + 680
> 12  0x1b8186104  _dispatch_worker_thread2 + 164
> 13  0x1b8334324  _pthread_wqthread + 228
> A linker snapshot was created at:
>       /tmp/odb.so-2022-09-20-153316.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
> info: failed to update dir{odb-2.5.0-b.23/}
>
> build2 seemed to install fine, and I have tried adding paths to homebrew
> libs and includes (as suggested).

GCC 12.2.0 seems to be quite buggy on Mac OS[1] so one thing to try is
GCC 11 (`brew install gcc at 11`).

Also, your error looks very similar to the Xcode 14 ld bug mentioned,
for example[2]. So maybe also try downgrading Xcode/CLT.

[1] https://github.com/Homebrew/homebrew-core/issues/110673
[2] https://github.com/open-source-parsers/jsoncpp/issues/1434



More information about the odb-users mailing list