Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 858329 - dev-util/cargo-c-0.9.9 fails to compile (lto): undefined reference to git_repository_open
Summary: dev-util/cargo-c-0.9.9 fails to compile (lto): undefined reference to git_rep...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Luca Barbato
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: lto
  Show dependency tree
 
Reported: 2022-07-16 09:09 UTC by Agostino Sarubbo
Modified: 2024-03-04 04:40 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
build.log (build.log,448.49 KB, text/plain)
2022-07-16 09:09 UTC, Agostino Sarubbo
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Agostino Sarubbo gentoo-dev 2022-07-16 09:09:31 UTC
https://blogs.gentoo.org/ago/2020/07/04/gentoo-tinderbox/

Issue: dev-util/cargo-c-0.9.9 fails to compile (lto).
Discovered on: amd64 (internal ref: lto_tinderbox)

NOTE:
This machine uses lto with CFLAGS=-flto -Werror=odr -Werror=lto-type-mismatch -Werror=strict-aliasing
Comment 1 Agostino Sarubbo gentoo-dev 2022-07-16 09:09:33 UTC
Created attachment 791687 [details]
build.log

build log and emerge --info
Comment 2 Agostino Sarubbo gentoo-dev 2022-07-16 09:09:36 UTC
Error(s) that match a know pattern in addition to what has been reported in the summary:


          /usr/lib/gcc/x86_64-pc-linux-gnu/12.1.1/../../../../x86_64-pc-linux-gnu/bin/ld: /var/tmp/portage/dev-util/cargo-c-0.9.9/work/cargo-c-0.9.9/target/release/deps/libgit2-b22498032669e40e.rlib(git2-b22498032669e40e.git2.dfc785a2-cgu.14.rcgu.o): in function `git2::error::Error::last_error':
          /usr/lib/gcc/x86_64-pc-linux-gnu/12.1.1/../../../../x86_64-pc-linux-gnu/bin/ld: git2.dfc785a2-cgu.0:(.text._ZN4git24repo10Repository10submodules17h38f0c8707afd235dE+0xfa): undefined reference to `git_submodule_free'
          /usr/lib/gcc/x86_64-pc-linux-gnu/12.1.1/../../../../x86_64-pc-linux-gnu/bin/ld: git2.dfc785a2-cgu.0:(.text._ZN4git24repo10Repository5reset17hb46c09171719b5ddE+0x11c): undefined reference to `git_reset'
          /usr/lib/gcc/x86_64-pc-linux-gnu/12.1.1/../../../../x86_64-pc-linux-gnu/bin/ld: git2.dfc785a2-cgu.0:(.text._ZN4git24repo10Repository8statuses17hdf5e610ab626bddbE+0x5a): undefined reference to `git_status_list_new'
          /usr/lib/gcc/x86_64-pc-linux-gnu/12.1.1/../../../../x86_64-pc-linux-gnu/bin/ld: git2.dfc785a2-cgu.11:(.text._ZN4git24blob4Blob7content17hd78c270c349def55E+0x18): undefined reference to `git_blob_rawsize'
          /usr/lib/gcc/x86_64-pc-linux-gnu/12.1.1/../../../../x86_64-pc-linux-gnu/bin/ld: git2.dfc785a2-cgu.14:(.text._ZN4git25error5Error10last_error17h4380a61cf223d146E+0x10e): undefined reference to `git_error_last'
          /usr/lib/gcc/x86_64-pc-linux-gnu/12.1.1/../../../../x86_64-pc-linux-gnu/bin/ld: git2.dfc785a2-cgu.14:(.text._ZN4git25error5Error10last_error17h4380a61cf223d146E+0x165): undefined reference to `git_error_clear'
          /usr/lib/gcc/x86_64-pc-linux-gnu/12.1.1/../../../../x86_64-pc-linux-gnu/bin/ld: git2.dfc785a2-cgu.2:(.text._ZN4git26config6Config10get_string17hdca0c8fb1d79f3b5E+0x310): undefined reference to `git_buf_dispose'
          /usr/lib/gcc/x86_64-pc-linux-gnu/12.1.1/../../../../x86_64-pc-linux-gnu/bin/ld: git2.dfc785a2-cgu.3:(.text._ZN4git25build11RepoBuilder5clone17hefe34af53de46b9fE+0x451): undefined reference to `git_clone'
          /usr/lib/gcc/x86_64-pc-linux-gnu/12.1.1/../../../../x86_64-pc-linux-gnu/bin/ld: git2.dfc785a2-cgu.4:(.text._ZN4git26object6Object8short_id17had10d38531529f13E+0xf0): undefined reference to `git_buf_dispose'
          /usr/lib/gcc/x86_64-pc-linux-gnu/12.1.1/../../../../x86_64-pc-linux-gnu/bin/ld: libgit2_sys.cffc4506-cgu.1:(.text._ZN3std4sync4once4Once9call_once28_$u7b$$u7b$closure$u7d$$u7d$17hedc60c82294cbb8fE.llvm.15914636265310777690+0x53): undefined reference to `git_error_last'
          cargo.42a7e8a3-cgu.3:(.text._ZN4git24repo10Repository4open17h978ca3d42a5fb651E+0x7a): undefined reference to `git_repository_open'
          cargo.42a7e8a3-cgu.3:(.text._ZN4git24repo10Repository4open17hdf4ec69fc03f38e6E+0x7e): undefined reference to `git_repository_open'
          cargo.42a7e8a3-cgu.3:(.text._ZN4git24repo10Repository8discover17h6fe1f6fbece33d3eE+0x93): undefined reference to `git_repository_discover'
          cargo.42a7e8a3-cgu.3:(.text._ZN4git24repo10Repository9init_opts17h3c9a6bb8b16815beE+0x98): undefined reference to `git_repository_init_ext'
          cargo.42a7e8a3-cgu.3:(.text._ZN4git26remote6Remote5fetch17h77603ef701a5f645E+0x1ae): undefined reference to `git_remote_fetch'
          git2.dfc785a2-cgu.0:(.text._ZN4core3ptr47drop_in_place$LT$git2..submodule..Submodule$GT$17h47b2eda61cab4489E+0x5): undefined reference to `git_submodule_free'
          git2.dfc785a2-cgu.0:(.text._ZN4core3ptr70drop_in_place$LT$alloc..vec..Vec$LT$git2..submodule..Submodule$GT$$GT$17hbe97827b69e7dd9fE+0x1a): undefined reference to `git_submodule_free'
          git2.dfc785a2-cgu.0:(.text._ZN4git24repo10Repository10submodules17h38f0c8707afd235dE+0x3f): undefined reference to `git_submodule_foreach'
          git2.dfc785a2-cgu.0:(.text._ZN4git24repo10Repository10submodules6append17hb95fddb9055b4328E+0x23): undefined reference to `git_submodule_lookup'
          git2.dfc785a2-cgu.0:(.text._ZN4git24repo10Repository11find_branch17hc0585cb114ef12eeE+0x10a): undefined reference to `git_branch_lookup'
          git2.dfc785a2-cgu.0:(.text._ZN4git24repo10Repository11find_commit17h77da65b9aaabce7bE+0x1b): undefined reference to `git_commit_lookup'
          git2.dfc785a2-cgu.0:(.text._ZN4git24repo10Repository11find_object17h5bcc079ef04b6141E+0x31): undefined reference to `git_object_lookup'
          git2.dfc785a2-cgu.0:(.text._ZN4git24repo10Repository13refname_to_id17h5c5974bd7df10914E+0x106): undefined reference to `git_reference_name_to_id'
          git2.dfc785a2-cgu.0:(.text._ZN4git24repo10Repository14find_submodule17hfe2594948eaa9b55E+0xff): undefined reference to `git_submodule_lookup'
          git2.dfc785a2-cgu.0:(.text._ZN4git24repo10Repository15revparse_single17h6a88d079c0651f1bE+0xff): undefined reference to `git_revparse_single'
          git2.dfc785a2-cgu.0:(.text._ZN4git24repo10Repository16remote_anonymous17hf4558b8394b172e1E+0xff): undefined reference to `git_remote_create_anonymous'
          git2.dfc785a2-cgu.0:(.text._ZN4git24repo10Repository4head17h085cfd069788b0a9E+0x1b): undefined reference to `git_repository_head'
          git2.dfc785a2-cgu.0:(.text._ZN4git24repo10Repository4path17h2bcadbfeeb7ce04cE+0x6): undefined reference to `git_repository_path'
          git2.dfc785a2-cgu.0:(.text._ZN4git24repo10Repository5index17h61765b0b735df0eaE+0x1b): undefined reference to `git_repository_index'
          git2.dfc785a2-cgu.0:(.text._ZN4git24repo10Repository5reset17hb46c09171719b5ddE+0x71): undefined reference to `git_checkout_init_options'
          git2.dfc785a2-cgu.0:(.text._ZN4git24repo10Repository6config17h9d12bcf8493f5cb3E+0x1b): undefined reference to `git_repository_config'
          git2.dfc785a2-cgu.0:(.text._ZN4git24repo10Repository7workdir17ha95aa1fbfd3bb202E+0x6): undefined reference to `git_repository_workdir'
          git2.dfc785a2-cgu.0:(.text._ZN4git24repo10Repository8statuses17hdf5e610ab626bddbE+0x30): undefined reference to `git_status_list_new'
          git2.dfc785a2-cgu.0:(.text._ZN4git24repo21RepositoryInitOptions3raw17hcdb983a5b9648f84E+0x2a): undefined reference to `git_repository_init_init_options'
          git2.dfc785a2-cgu.0:(.text._ZN64_$LT$git2..repo..Repository$u20$as$u20$core..ops..drop..Drop$GT$4drop17h506d66578fe923d8E+0x5): undefined reference to `git_repository_free'
          git2.dfc785a2-cgu.10:(.text._ZN4git24cred4Cred18ssh_key_from_agent17he23b839daf607200E+0x116): undefined reference to `git_cred_ssh_key_from_agent'
          git2.dfc785a2-cgu.10:(.text._ZN4git24cred4Cred18userpass_plaintext17hddf99e96730cd6d6E+0x20a): undefined reference to `git_cred_userpass_plaintext_new'
          git2.dfc785a2-cgu.10:(.text._ZN4git24cred4Cred7default17h9bec4293e3f1d74fE+0x2f): undefined reference to `git_cred_default_new'
          git2.dfc785a2-cgu.10:(.text._ZN4git24cred4Cred8username17h8b2627dc70d04164E+0x116): undefined reference to `git_cred_username_new'
          git2.dfc785a2-cgu.11:(.text._ZN4git23tag3Tag9target_id17ha844d5feb9222f94E+0x9): undefined reference to `git_tag_target_id'
          git2.dfc785a2-cgu.11:(.text._ZN4git24blob4Blob7content17hd78c270c349def55E+0xc): undefined reference to `git_blob_rawcontent'
          git2.dfc785a2-cgu.11:(.text._ZN4git24tree4Tree8get_path17he184b256a16d967cE+0x6e): undefined reference to `git_tree_entry_bypath'
          git2.dfc785a2-cgu.11:(.text._ZN4git24tree9TreeEntry9to_object17h917496312b93a5a5E+0x21): undefined reference to `git_tree_entry_to_object'
          git2.dfc785a2-cgu.11:(.text._ZN58_$LT$git2..tree..Tree$u20$as$u20$core..ops..drop..Drop$GT$4drop17heb26124b8b023eabE+0x5): undefined reference to `git_tree_free'
          git2.dfc785a2-cgu.11:(.text._ZN63_$LT$git2..tree..TreeEntry$u20$as$u20$core..ops..drop..Drop$GT$4drop17h27a881a043da96d8E+0xb): undefined reference to `git_tree_entry_free'
          git2.dfc785a2-cgu.12:(.text._ZN4core3ptr47drop_in_place$LT$git2..submodule..Submodule$GT$17h47b2eda61cab4489E.llvm.11616750304128302497+0x5): undefined reference to `git_submodule_free'
          git2.dfc785a2-cgu.12:(.text._ZN62_$LT$git2..remote..Remote$u20$as$u20$core..ops..drop..Drop$GT$4drop17hf396da2d7b001bcaE+0x5): undefined reference to `git_remote_free'
          git2.dfc785a2-cgu.12:(.text._ZN66_$LT$git2..remote..FetchOptions$u20$as$u20$git2..util..Binding$GT$3raw17hcea8ded5eedc1f9dE+0x1f1): undefined reference to `git_remote_init_callbacks'
          git2.dfc785a2-cgu.14:(.text._ZN4git25error5Error10last_error17h4380a61cf223d146E+0x2d): undefined reference to `git_error_last'
          git2.dfc785a2-cgu.15:(.text._ZN4git29submodule9Submodule3url17h1c8d5bec4e17651eE+0xa): undefined reference to `git_submodule_url'
          git2.dfc785a2-cgu.15:(.text._ZN4git29submodule9Submodule4init17hdebdc6a04bb21a36E+0xf): undefined reference to `git_submodule_init'
          git2.dfc785a2-cgu.15:(.text._ZN4git29submodule9Submodule4name17h3c3c07a204ea9906E+0xa): undefined reference to `git_submodule_name'
          git2.dfc785a2-cgu.15:(.text._ZN4git29submodule9Submodule4open17h348a7ef532536646E+0x1b): undefined reference to `git_submodule_open'
          git2.dfc785a2-cgu.15:(.text._ZN4git29submodule9Submodule4path17h2258ec516db913f6E+0x6): undefined reference to `git_submodule_path'
          git2.dfc785a2-cgu.15:(.text._ZN4git29submodule9Submodule7head_id17h6b35c0d1df582540E+0x9): undefined reference to `git_submodule_head_id'
          git2.dfc785a2-cgu.15:(.text._ZN56_$LT$git2..buf..Buf$u20$as$u20$core..ops..drop..Drop$GT$4drop17h7cf1c32e190186dcE+0x2): undefined reference to `git_buf_dispose'
          git2.dfc785a2-cgu.15:(.text._ZN68_$LT$git2..submodule..Submodule$u20$as$u20$core..ops..drop..Drop$GT$4drop17h91305ba0a2edbbdeE+0x5): undefined reference to `git_submodule_free'
          git2.dfc785a2-cgu.2:(.text._ZN4core3ptr35drop_in_place$LT$git2..buf..Buf$GT$17hf6b1f3a0fcfc877eE+0x2): undefined reference to `git_buf_dispose'
          git2.dfc785a2-cgu.2:(.text._ZN4git26config6Config10get_string17hdca0c8fb1d79f3b5E+0x134): undefined reference to `git_config_get_string_buf'
          git2.dfc785a2-cgu.2:(.text._ZN4git26config6Config12open_default17h20ffbc36523f8af5E+0x2f): undefined reference to `git_config_open_default'
          git2.dfc785a2-cgu.2:(.text._ZN4git26config6Config3new17h66f3f9b0c978b720E+0x2f): undefined reference to `git_config_new'
          git2.dfc785a2-cgu.2:(.text._ZN4git26config6Config8get_bool17h2bad48549a37eb94E+0xfb): undefined reference to `git_config_get_bool'
          git2.dfc785a2-cgu.2:(.text._ZN4git26config6Config8set_bool17h5ef84c362dc66416E+0xed): undefined reference to `git_config_set_bool'
          git2.dfc785a2-cgu.2:(.text._ZN62_$LT$git2..config..Config$u20$as$u20$core..ops..drop..Drop$GT$4drop17h517b6996c7578a0eE+0x5): undefined reference to `git_config_free'
          git2.dfc785a2-cgu.3:(.text._ZN4core3ptr43drop_in_place$LT$git2..repo..Repository$GT$17h0fca37b5590269fcE+0x5): undefined reference to `git_repository_free'
          git2.dfc785a2-cgu.3:(.text._ZN4git25build11RepoBuilder5clone17hefe34af53de46b9fE+0x47): undefined reference to `git_clone_init_options'
          git2.dfc785a2-cgu.3:(.text._ZN4git29reference9Reference6target17h4bcf2943bf2961b2E+0x9): undefined reference to `git_reference_target'
          git2.dfc785a2-cgu.3:(.text._ZN68_$LT$git2..reference..Reference$u20$as$u20$core..ops..drop..Drop$GT$4drop17hd51d43300eeb8ceaE+0x5): undefined reference to `git_reference_free'
          git2.dfc785a2-cgu.4:(.text._ZN4core3ptr35drop_in_place$LT$git2..buf..Buf$GT$17hf6b1f3a0fcfc877eE+0x2): undefined reference to `git_buf_dispose'
          git2.dfc785a2-cgu.4:(.text._ZN4git26commit6Commit4tree17h86ca7cf2c7dbb7c0E+0x1b): undefined reference to `git_commit_tree'
          git2.dfc785a2-cgu.4:(.text._ZN4git26object6Object2id17h894a09a2b0b041c4E+0x9): undefined reference to `git_object_id'
          git2.dfc785a2-cgu.4:(.text._ZN4git26object6Object4peel17ha86d798fbeb3bef5E+0x29): undefined reference to `git_object_peel'
          git2.dfc785a2-cgu.4:(.text._ZN4git26object6Object6as_tag17hb45d951bf8b1e9faE+0x9): undefined reference to `git_object_type'
          git2.dfc785a2-cgu.4:(.text._ZN4git26object6Object7as_blob17h55dc0871cda8bd91E+0x9): undefined reference to `git_object_type'
          git2.dfc785a2-cgu.4:(.text._ZN4git26object6Object8short_id17had10d38531529f13E+0x3f): undefined reference to `git_object_short_id'
          git2.dfc785a2-cgu.4:(.text._ZN62_$LT$git2..commit..Commit$u20$as$u20$core..ops..drop..Drop$GT$4drop17hed7f8b6e8d1d488cE+0x5): undefined reference to `git_commit_free'
          git2.dfc785a2-cgu.4:(.text._ZN62_$LT$git2..object..Object$u20$as$u20$core..ops..drop..Drop$GT$4drop17hb66b5a5ffb7a6069E+0x5): undefined reference to `git_object_free'
          git2.dfc785a2-cgu.5:(.text._ZN4git23oid3Oid8from_str17h6af8a994fb825a8fE+0x46): undefined reference to `git_oid_fromstrn'
          git2.dfc785a2-cgu.5:(.text._ZN4git25index5Index4iter17h16313561c5931d7aE+0xf): undefined reference to `git_index_entrycount'
          git2.dfc785a2-cgu.5:(.text._ZN4git25index5Index8get_path17h65660611d16481bfE+0x55): undefined reference to `git_index_get_bypath'
          git2.dfc785a2-cgu.5:(.text._ZN4git26status13StatusOptions3new17h8b2465a14f36184eE+0x26): undefined reference to `git_status_init_options'
          git2.dfc785a2-cgu.5:(.text._ZN4git26status8Statuses4iter17ha65dc052d6343279E+0xf): undefined reference to `git_status_list_entrycount'
          git2.dfc785a2-cgu.5:(.text._ZN53_$LT$git2..oid..Oid$u20$as$u20$core..fmt..Display$GT$3fmt17hd4347646b1cac602E+0x26): undefined reference to `git_oid_tostr'
          git2.dfc785a2-cgu.5:(.text._ZN55_$LT$git2..oid..Oid$u20$as$u20$core..cmp..PartialEq$GT$2eq17he876891beaff2a40E+0x3): undefined reference to `git_oid_equal'
          git2.dfc785a2-cgu.5:(.text._ZN60_$LT$git2..index..Index$u20$as$u20$core..ops..drop..Drop$GT$4drop17h156b50fb7ae2d210E+0x5): undefined reference to `git_index_free'
          git2.dfc785a2-cgu.5:(.text._ZN64_$LT$git2..status..Statuses$u20$as$u20$core..ops..drop..Drop$GT$4drop17h115158f27bbe905bE+0x5): undefined reference to `git_status_list_free'
          git2.dfc785a2-cgu.5:(.text._ZN83_$LT$git2..status..StatusIter$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17hf09fb32a485ec5a6E+0x1b): undefined reference to `git_status_byindex'
          git2.dfc785a2-cgu.5:(.text._ZN84_$LT$git2..index..IndexEntries$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h35a55b09a571d4e5E+0x31): undefined reference to `git_index_get_byindex'
          git2.dfc785a2-cgu.6:(.text._ZN3std9panicking3try17h23a0e7ed854670d8E+0x208): undefined reference to `git_error_set_str'
          git2.dfc785a2-cgu.7:(.text._ZN79_$LT$git2..remote_callbacks..RemoteCallbacks$u20$as$u20$git2..util..Binding$GT$3raw17h7dfc0605b3a0af34E+0x3a): undefined reference to `git_remote_init_callbacks'
          libgit2_sys.cffc4506-cgu.1:(.text._ZN3std4sync4once4Once9call_once28_$u7b$$u7b$closure$u7d$$u7d$17hedc60c82294cbb8fE.llvm.15914636265310777690+0x21): undefined reference to `git_libgit2_init'
error: linking with `x86_64-pc-linux-gnu-gcc` failed: exit status: 1
Comment 3 Luca Barbato gentoo-dev 2022-07-27 20:50:19 UTC
The problem seems in either libgit2 or cargo itself, if you opened one for cargo this can be marked as duplicated of it.
Comment 4 Klaus Kusche 2023-05-13 09:47:42 UTC
This seems to be a more general problem:
I get exactly the same git2 and libgit2 link errors
when emerging media-video/rav1e-0.6.5 with lto
although my cargo is built non-lto.

Any news on this error?
Comment 5 Klaus Kusche 2023-05-13 10:18:21 UTC
(In reply to Klaus Kusche from comment #4)
> when emerging media-video/rav1e-0.6.5 with lto

Emerging rav1e non-lto works, the link errors are gone.
Comment 6 Eli Schwartz 2024-03-03 05:02:18 UTC
Apparently fixed by cargo.eclass, cannot reproduce anymore.
Comment 7 Klaus Kusche 2024-03-03 13:56:19 UTC
Yes, current version of cargo-c also works here.