From s.cunliffe at ucl.ac.uk Tue Sep 20 10:40:54 2022 From: s.cunliffe at ucl.ac.uk (Cunliffe, Sam) Date: Tue Sep 20 11:02:00 2022 Subject: [odb-users] Linker error building odb on mac 12 Message-ID: Hello, I'm following along with these https://codesynthesis.com/products/odb/doc/install-build2.xhtml#macos-odb ...instructions. I am at the build odb step 3.2 and I get a linker error. > sw_vers ProductName: macOS ProductVersion: 12.6 BuildVersion: 21G115 > arch arm64 > bpkg --version bpkg 0.15.0 libbpkg 0.15.0 libbutl 0.15.0 Copyright (c) 2014-2022 the build2 authors. This is free software released under the MIT license. > g++-12 --version g++-12 (Homebrew GCC 12.2.0) 12.2.0 Copyright (C) 2022 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. > bpkg build odb@https://pkg.cppget.org/1/beta ### 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::parse(mach_o::relocatable::ParserOptions const&) + 4536 2 0x10207dd38 mach_o::relocatable::Parser::parse(unsigned char const*, unsigned long long, char const*, long, ld::File::Ordinal, mach_o::relocatable::ParserOptions const&) + 148 3 0x1020c8180 archive::File::makeObjectFileForMember(archive::File::Entry const*) const + 1084 4 0x1020c7ac8 archive::File::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). Anything I'm missing? Thanks a lot, Sam. ----//----- Here's the full output from the building. > bpkg build odb@https://pkg.cppget.org/1/beta added pkg:cppget.org/beta fetching pkg:cppget.org/beta warning: authenticity of the certificate for repository pkg:cppget.org/beta cannot be established certificate is for **cppget.org, "Code Synthesis" certificate SHA256 fingerprint: 70:64:FE:E4:E0:F3:60:F1:B4:51:E1:FA:12:5C:E0:B3:DB:DF:96:33:39:B9:2E:E5:C2:68:63:4C:A6:47:39:43 trust this certificate? [y/n] y fetching pkg:cppget.org/testing (complements pkg:cppget.org/beta) fetching pkg:cppget.org/stable (complements pkg:cppget.org/testing) new libstudxml/1.1.0-b.10 (required by odb) new libcutl/1.11.0-b.9 (required by odb) new odb/2.5.0-b.23 continue? [Y/n] y libstudxml-1.1.0-b.10.tar.gz: ##################################################################################################################################################### 100.0% fetched libstudxml/1.1.0-b.10 unpacked libstudxml/1.1.0-b.10 libcutl-1.11.0-b.9.tar.gz: ##################################################################################################################################################### 100.0% fetched libcutl/1.11.0-b.9 unpacked libcutl/1.11.0-b.9 odb-2.5.0-b.23.tar.gz: ##################################################################################################################################################### 100.0% fetched odb/2.5.0-b.23 unpacked odb/2.5.0-b.23 configured libstudxml/1.1.0-b.10 configured libcutl/1.11.0-b.9 configured odb/2.5.0-b.23 version.in libstudxml-1.1.0-b.10/libstudxml/version.hxx.in version.in libcutl-1.11.0-b.9/libcutl/version.hxx.in c++ odb-2.5.0-b.23/odb/cxx{odb} c++ odb-2.5.0-b.23/odb/cxx{common-query} c++ odb-2.5.0-b.23/odb/relational/pgsql/cxx{schema} c++ odb-2.5.0-b.23/odb/cxx{include} c++ odb-2.5.0-b.23/odb/relational/cxx{model} c++ odb-2.5.0-b.23/odb/relational/oracle/cxx{model} c++ odb-2.5.0-b.23/odb/relational/cxx{validator} c++ odb-2.5.0-b.23/odb/relational/cxx{common-query} c++ odb-2.5.0-b.23/odb/relational/oracle/cxx{inline} c++ odb-2.5.0-b.23/odb/relational/oracle/cxx{header} c++ odb-2.5.0-b.23/odb/relational/oracle/cxx{context} c++ odb-2.5.0-b.23/odb/relational/oracle/cxx{schema} c++ odb-2.5.0-b.23/odb/relational/oracle/cxx{source} c++ odb-2.5.0-b.23/odb/relational/oracle/cxx{common} c++ odb-2.5.0-b.23/odb/relational/mssql/cxx{context} c++ odb-2.5.0-b.23/odb/relational/sqlite/cxx{model} c++ odb-2.5.0-b.23/odb/relational/sqlite/cxx{inline} c++ odb-2.5.0-b.23/odb/relational/sqlite/cxx{header} c++ odb-2.5.0-b.23/odb/relational/sqlite/cxx{context} c++ odb-2.5.0-b.23/odb/cxx{lookup} c++ odb-2.5.0-b.23/odb/relational/sqlite/cxx{schema} c++ odb-2.5.0-b.23/odb/cxx{instance} c++ odb-2.5.0-b.23/odb/relational/sqlite/cxx{source} c++ odb-2.5.0-b.23/odb/relational/sqlite/cxx{common} c++ odb-2.5.0-b.23/odb/relational/cxx{inline} c++ odb-2.5.0-b.23/odb/cxx{cxx-lexer} c++ odb-2.5.0-b.23/odb/relational/mysql/cxx{model} c++ odb-2.5.0-b.23/odb/relational/mysql/cxx{inline} c++ odb-2.5.0-b.23/odb/semantics/relational/cxx{key} c++ odb-2.5.0-b.23/odb/semantics/relational/cxx{deferrable} c++ odb-2.5.0-b.23/odb/semantics/relational/cxx{model} c++ odb-2.5.0-b.23/odb/relational/mysql/cxx{header} c++ odb-2.5.0-b.23/odb/relational/mysql/cxx{context} c++ odb-2.5.0-b.23/odb/relational/mysql/cxx{schema} c++ odb-2.5.0-b.23/odb/relational/mysql/cxx{source} c++ odb-2.5.0-b.23/odb/semantics/relational/cxx{changelog} c++ odb-2.5.0-b.23/odb/relational/mysql/cxx{common} c++ odb-2.5.0-b.23/odb/semantics/relational/cxx{column} c++ odb-2.5.0-b.23/odb/relational/cxx{header} c++ odb-2.5.0-b.23/odb/relational/cxx{processor} c++ odb-2.5.0-b.23/odb/relational/cxx{context} c++ odb-2.5.0-b.23/odb/semantics/cxx{fundamental} c++ odb-2.5.0-b.23/odb/relational/pgsql/cxx{model} c++ odb-2.5.0-b.23/odb/relational/pgsql/cxx{inline} c++ odb-2.5.0-b.23/odb/semantics/cxx{enum} c++ odb-2.5.0-b.23/odb/relational/pgsql/cxx{header} c++ odb-2.5.0-b.23/odb/semantics/cxx{union-template} c++ odb-2.5.0-b.23/odb/semantics/cxx{elements} c++ odb-2.5.0-b.23/odb/relational/pgsql/cxx{context} c++ odb-2.5.0-b.23/odb/relational/pgsql/cxx{source} c++ odb-2.5.0-b.23/odb/relational/pgsql/cxx{common} c++ odb-2.5.0-b.23/odb/relational/cxx{schema-source} c++ odb-2.5.0-b.23/odb/relational/cxx{changelog} c++ odb-2.5.0-b.23/odb/cxx{diagnostics} c++ odb-2.5.0-b.23/odb/cxx{location} c++ odb-2.5.0-b.23/odb/relational/cxx{schema} c++ odb-2.5.0-b.23/odb/traversal/relational/cxx{changelog} c++ odb-2.5.0-b.23/odb/relational/cxx{source} c++ odb-2.5.0-b.23/odb/relational/cxx{common} c++ odb-2.5.0-b.23/odb/relational/mssql/cxx{model} c++ odb-2.5.0-b.23/odb/traversal/cxx{enum} c++ odb-2.5.0-b.23/odb/relational/mssql/cxx{inline} c++ odb-2.5.0-b.23/odb/traversal/cxx{elements} c++ odb-2.5.0-b.23/odb/relational/mssql/cxx{header} c++ odb-2.5.0-b.23/odb/relational/mssql/cxx{schema} c++ odb-2.5.0-b.23/odb/cxx{processor} c++ odb-2.5.0-b.23/odb/relational/mssql/cxx{source} c++ odb-2.5.0-b.23/odb/relational/mssql/cxx{common} c++ odb-2.5.0-b.23/odb/cxx{parser} c++ odb-2.5.0-b.23/odb/cxx{validator} c++ odb-2.5.0-b.23/odb/cxx{option-functions} c++ odb-2.5.0-b.23/odb/cxx{plugin} c++ odb-2.5.0-b.23/odb/cxx{pragma} c++ odb-2.5.0-b.23/odb/cxx{sql-token} c++ odb-2.5.0-b.23/odb/semantics/relational/cxx{index} c++ libstudxml-1.1.0-b.10/libstudxml/cxx{serializer} c++ odb-2.5.0-b.23/odb/semantics/relational/cxx{primary-key} c++ odb-2.5.0-b.23/odb/semantics/relational/cxx{changeset} c libstudxml-1.1.0-b.10/libstudxml/details/expat/c{xmlparse} c++ odb-2.5.0-b.23/odb/semantics/relational/cxx{foreign-key} c++ odb-2.5.0-b.23/odb/semantics/relational/cxx{table} c++ odb-2.5.0-b.23/odb/semantics/relational/cxx{elements} c++ odb-2.5.0-b.23/odb/semantics/relational/cxx{name} c libstudxml-1.1.0-b.10/libstudxml/details/genx/c{char-props} c libstudxml-1.1.0-b.10/libstudxml/details/genx/c{genx} c++ odb-2.5.0-b.23/odb/semantics/cxx{class} c++ odb-2.5.0-b.23/odb/semantics/cxx{class-template} c++ odb-2.5.0-b.23/odb/semantics/cxx{derived} c libstudxml-1.1.0-b.10/libstudxml/details/expat/c{xmltok} c++ odb-2.5.0-b.23/odb/semantics/cxx{unit} c++ odb-2.5.0-b.23/odb/semantics/cxx{namespace} c++ odb-2.5.0-b.23/odb/semantics/cxx{template} c++ odb-2.5.0-b.23/odb/semantics/cxx{union} c++ odb-2.5.0-b.23/odb/cxx{option-types} c libstudxml-1.1.0-b.10/libstudxml/details/expat/c{xmlrole} c++ odb-2.5.0-b.23/odb/cxx{inline} c++ odb-2.5.0-b.23/odb/cxx{profile} c++ odb-2.5.0-b.23/odb/traversal/relational/cxx{key} c++ libstudxml-1.1.0-b.10/libstudxml/cxx{qname} c++ odb-2.5.0-b.23/odb/traversal/cxx{class} c++ odb-2.5.0-b.23/odb/traversal/cxx{class-template} c++ libstudxml-1.1.0-b.10/libstudxml/cxx{value-traits} c++ odb-2.5.0-b.23/odb/traversal/cxx{derived} c++ libstudxml-1.1.0-b.10/libstudxml/cxx{parser} c++ odb-2.5.0-b.23/odb/traversal/cxx{union-template} c++ odb-2.5.0-b.23/odb/traversal/cxx{template} c++ odb-2.5.0-b.23/odb/cxx{header} c++ odb-2.5.0-b.23/odb/cxx{context} ld libstudxml-1.1.0-b.10/libstudxml/libs{studxml} c++ odb-2.5.0-b.23/odb/cxx{emitter} c++ odb-2.5.0-b.23/odb/cxx{sql-lexer} c++ libcutl-1.11.0-b.9/libcutl/re/cxx{re} c++ odb-2.5.0-b.23/odb/cxx{source} c++ odb-2.5.0-b.23/odb/cxx{common} c++ odb-2.5.0-b.23/odb/cxx{generator} c++ odb-2.5.0-b.23/odb/cxx{options} c++ libcutl-1.11.0-b.9/libcutl/shared-ptr/cxx{base} c++ libcutl-1.11.0-b.9/libcutl/cxx{exception} c++ libcutl-1.11.0-b.9/libcutl/fs/cxx{path} c++ libcutl-1.11.0-b.9/libcutl/fs/cxx{exception} c++ libcutl-1.11.0-b.9/libcutl/fs/cxx{auto-remove} c++ libcutl-1.11.0-b.9/libcutl/compiler/cxx{type-info} c++ libcutl-1.11.0-b.9/libcutl/compiler/cxx{cxx-indenter} c++ libcutl-1.11.0-b.9/libcutl/compiler/cxx{context} ld libcutl-1.11.0-b.9/libcutl/libs{cutl} ar odb-2.5.0-b.23/odb/libus{odb} ld odb-2.5.0-b.23/odb/plugin{odb} ld: warning: -undefined dynamic_lookup may not work with chained fixups 0 0x1022241a0 __assert_rtn + 140 1 0x1020aba8c mach_o::relocatable::Parser::parse(mach_o::relocatable::ParserOptions const&) + 4536 2 0x10207dd38 mach_o::relocatable::Parser::parse(unsigned char const*, unsigned long long, char const*, long, ld::File::Ordinal, mach_o::relocatable::ParserOptions const&) + 148 3 0x1020c8180 archive::File::makeObjectFileForMember(archive::File::Entry const*) const + 1084 4 0x1020c7ac8 archive::File::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/} From boris at codesynthesis.com Tue Sep 20 11:21:08 2022 From: boris at codesynthesis.com (Boris Kolpackov) Date: Tue Sep 20 11:15:37 2022 Subject: [odb-users] Linker error building odb on mac 12 In-Reply-To: References: Message-ID: Cunliffe, Sam 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@https://pkg.cppget.org/1/beta > ### 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::parse(mach_o::relocatable::ParserOptions const&) + 4536 > 2 0x10207dd38 mach_o::relocatable::Parser::parse(unsigned char const*, unsigned long long, char const*, long, ld::File::Ordinal, mach_o::relocatable::ParserOptions const&) + 148 > 3 0x1020c8180 archive::File::makeObjectFileForMember(archive::File::Entry const*) const + 1084 > 4 0x1020c7ac8 archive::File::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@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 From s.cunliffe at ucl.ac.uk Wed Sep 21 07:01:19 2022 From: s.cunliffe at ucl.ac.uk (Cunliffe, Sam) Date: Wed Sep 21 09:06:34 2022 Subject: [odb-users] Linker error building odb on mac 12 In-Reply-To: References: Message-ID: 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@12 and gcc@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@11 and gcc@12 ... for good measure). Thanks again, Sam. ________________________________________ From: Boris Kolpackov Sent: 20 September 2022 16:21 To: Cunliffe, Sam Cc: odb-users@codesynthesis.com Subject: Re: [odb-users] Linker error building odb on mac 12 ? Caution: External sender Cunliffe, Sam 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@https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fpkg.cppget.org%2F1%2Fbeta&data=05%7C01%7Cs.cunliffe%40ucl.ac.uk%7C942253185b234017719808da9b1bc157%7C1faf88fea9984c5b93c9210a11d9a5c2%7C0%7C0%7C637992840752371766%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=kiLhIONF7U1wLlHlEv7Aeg7yJDBsS7yKvzo79EulaEs%3D&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::parse(mach_o::relocatable::ParserOptions const&) + 4536 > 2 0x10207dd38 mach_o::relocatable::Parser::parse(unsigned char const*, unsigned long long, char const*, long, ld::File::Ordinal, mach_o::relocatable::ParserOptions const&) + 148 > 3 0x1020c8180 archive::File::makeObjectFileForMember(archive::File::Entry const*) const + 1084 > 4 0x1020c7ac8 archive::File::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@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