Error: linking with 'cc' failed: exit code: 1

I got this error message when running
[ec2-user@ip-172-31-40-246 libra]$ ./scripts/cli/start_cli_testnet.sh
Building and running client in debug mode.
Compiling client v0.1.0 (/home/ec2-user/libra/client)
Building [=====================================================> ] 460/461: client(bin)

error: linking with cc failed: exit code: 1
|
= note: “cc” “-Wl,–as-needed” “-Wl,-z,noexecstack” “-m64” “-L” “/home/ec2-user/.rustup/toolchains/nightly-2019-05-22-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib” “/home/ec2-user/libra/target/debug/deps/client-660f4b58bcda33f2.11p9ib01weplspni.rcgu.o” “/home/ec2-user/libra/target/debug/deps/client-660f4b58bcda33f2.17eh1i05h96j5hsm.rcgu.o” “/home/ec2-user/libra/target/debug/deps/client-660f4b58bcda33f2.19cyxqz746sj0lag.rcgu.o” “/home/ec2-user/.rustup/toolchains/nightly-2019-05-22-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/liblibc-42e5ad7e7a0cb73c.rlib” “/home/ec2-user/.rustup/toolchains/nightly-2019-05-22-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/liballoc-da67c1aba5bef9b1.rlib” “/home/ec2-user/.rustup/toolchains/nightly-2019-05-22-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_std_workspace_core-a01c4b87c4503fad.rlib” “/home/ec2-user/.rustup/toolchains/nightly-2019-05-22-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcore-e6b0ad9835323d10.rlib” “-Wl,–end-group” “/home/ec2-user/.rustup/toolchains/nightly-2019-05-22-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcompiler_builtins-9f017ec8fa4a83a1.rlib” “-Wl,-Bdynamic” “-lstdc++” “-lutil” “-lutil” “-ldl” “-lrt” “-lpthread” “-lgcc_s” “-lc” “-lm” “-lrt” “-lpthread” “-lutil” “-lutil”
= note: collect2: fatal error: ld terminated with signal 11 [Segmentation fault]
compilation terminated.
/usr/bin/ld: error: /home/ec2-user/libra/target/debug/deps/client-660f4b58bcda33f2.3pjprj8but587cvy.rcgu.o(.text.ZN4core3str21$LT$impl$u20$str$GT$18trim_start_matches17h641e82d7591aabd2E) is too large (0x1b9 bytes)
/usr/bin/ld: error: /home/ec2-user/libra/target/debug/deps/client-660f4b58bcda33f2.3pym9vfbgvy7ggp7.rcgu.o(.eh_frame) is too large (0xa8 bytes)
/usr/bin/ld: error: /home/ec2-user/libra/target/debug/deps/client-660f4b58bcda33f2.3t2i181nfid95nqo.rcgu.o(.text.ZN4core3str6traits54$LT$impl$u20$core…cmp…PartialEq$u20$for$u20$str$GT$2eq17h696d7b2ad7990c2fE) is too large (0xbe bytes)
/usr/bin/ld: error: /home/ec2-user/libra/target/debug/deps/client-660f4b58bcda33f2.3tt4dm7bghpmsyks.rcgu.o(.text._ZN13unicode_width6tables9charwidth25bsearch_range_value_table17h3ab4575b87b71223E) is too large (0xff bytes)
/usr/bin/ld: error: /home/ec2-user/libra/target/debug/deps/client-660f4b58bcda33f2.3xn4hg0crfr405ya.rcgu.o(.text._ZN4core5alloc6Layout9for_value17h6d21cd8fae9c13adE) is too large (0xca bytes)
/usr/bin/ld: error: /home/ec2-user/libra/target/debug/deps/client-660f4b58bcda33f2.3zrwd4jkj2ejvki2.rcgu.o(.text._ZN4core6option15Option$LT$T$GT$14unwrap_or_else17h50e9836594e648fdE) is too large (0x10a bytes)
/usr/bin/ld: error: /home/ec2-user/libra/target/debug/deps/client-660f4b58bcda33f2.42ykimmy32rpf118.rcgu.o(.text._ZN9rustyline7history7History3add17h9f80babaab01495bE) is too large (0x323 bytes)
/usr/bin/ld: error: /home/ec2-user/libra/target/debug/deps/client-660f4b58bcda33f2.45dzzlylfic1sp84.rcgu.o(.text._ZN9hashbrown3raw17RawTable$LT$T$GT$3new17h1a71b26915639de0E) is too large (0xa3 bytes)
/usr/bin/ld: error: /home/ec2-user/libra/target/debug/deps/client-660f4b58bcda33f2.47kjto6lmp7ssxri.rcgu.o(.text._ZN20unicode_segmentation8grapheme13new_graphemes17hb81d512b758d643dE) is too large (0x107 bytes)
/usr/bin/ld: error: /home/ec2-user/libra/target/debug/deps/client-660f4b58bcda33f2.47tiru3a5awfo67o.rcgu.o(.text._ZN5alloc2rc11Rc$LT$T$GT$3new17h036680cb8cc7d911E) is too large (0xd1 bytes)
/usr/bin/ld: error: /home/ec2-user/libra/target/debug/deps/client-660f4b58bcda33f2.4dpw588zanxcumwq.rcgu.o(.text._ZN9rustyline10completion21longest_common_prefix17h5fa1bc02ab55f7c1E) is too large (0x761 bytes)

      /usr/bin/ld: error: /home/ec2-user/libra/target/debug/deps/libnix-d4b9c122da188ddc.rlib(nix-d4b9c122da188ddc.nix.86r7htty-cgu.12.rcgu.o)(.eh_frame) is too large (0x9c8 bytes)
      /usr/bin/ld: error: /home/ec2-user/libra/target/debug/deps/libnix-d4b9c122da188ddc.rlib(nix-d4b9c122da188ddc.nix.86r7htty-cgu.14.rcgu.o)(.eh_frame) is too large (0x850 bytes)
      /usr/bin/ld: error: /home/ec2-user/libra/target/debug/deps/libnix-d4b9c122da188ddc.rlib(nix-d4b9c122da188ddc.nix.86r7htty-cgu.15.rcgu.o)(.text._ZN4core5slice13Iter$LT$T$GT$8as_slice17h1718f736844e7b03E) is too large (0xe4 bytes)
      /usr/bin/ld: error: /home/ec2-user/libra/target/debug/deps/libnix-d4b9c122da188ddc.rlib(nix-d4b9c122da188ddc.nix.86r7htty-cgu.2.rcgu.o)(.text._ZN4core3str6traits54_$LT$impl$u20$core..cmp..PartialEq$u20$for$u20$str$GT$2eq17hb3f90fdea2ff7d73E) is too large (0xbe bytes)
      /usr/bin/ld: error: /home/ec2-user/libra/target/debug/deps/libnix-d4b9c122da188ddc.rlib(nix-d4b9c122da188ddc.nix.86r7htty-cgu.3.rcgu.o)(.eh_frame) is too large (0x988 bytes)
      /usr/bin/ld: error: /home/ec2-user/libra/target/debug/deps/libnix-d4b9c122da188ddc.rlib(nix-d4b9c122da188ddc.nix.86r7htty-cgu.4.rcgu.o)(.text._ZN3nix4poll6PollFd3new17h059e69e088c2ec15E) is too large (0x71 bytes)
      /usr/bin/ld: error: /home/ec2-user/libra/target/debug/deps/libnix-d4b9c122da188ddc.rlib(nix-d4b9c122da188ddc.nix.86r7htty-cgu.5.rcgu.o)(.eh_frame) is too large (0x710 bytes)
      /usr/bin/ld: error: /home/ec2-user/libra/target/debug/deps/libnix-d4b9c122da188ddc.rlib(nix-d4b9c122da188ddc.nix.86r7htty-cgu.6.rcgu.o)(.eh_frame) is too large (0xa38 bytes)
      /usr/bin/ld: error: /home/ec2-user/libra/target/debug/deps/libnix-d4b9c122da188ddc.rlib(nix-d4b9c122da188ddc.nix.86r7htty-cgu.7.rcgu.o)(.text._ZN109_$LT$alloc..vec..Vec$LT$T$GT$$u20$as$u20$alloc..vec..SpecExtend$LT$$RF$T$C$core..slice..Iter$LT$T$GT$$GT$$GT$11spec_extend17h923cccd56374cf4bE) is too large (0x11d bytes)
      /usr/bin/ld: error: /home/ec2-user/libra/target/debug/deps/libnix-d4b9c122da188ddc.rlib(nix-d4b9c122da188ddc.nix.86r7htty-cgu.8.rcgu.o)(.text._ZN4core4cell13Cell$LT$T$GT$7replace17h17ea9b6e43cd3e61E) is too large (0x7d bytes)
      /usr/bin/ld: error: /home/ec2-user/libra/target/debug/deps/libnix-d4b9c122da188ddc.rlib(nix-d4b9c122da188ddc.nix.86r7htty-cgu.9.rcgu.o)(.text._ZN103_$LT$core..ops..range..RangeFrom$LT$usize$GT$$u20$as$u20$core..slice..SliceIndex$LT$$u5b$T$u5d$$GT$$GT$17get_unchecked_mut17hcdce793d0eeb6248E) is too large (0x77 bytes)
      /usr/bin/ld: error: /home/ec2-user/libra/target/debug/deps/libnix-d4b9c122da188ddc.rlib(nix-d4b9c122da188ddc.nix.86r7htty-cgu.13.rcgu.o)(.eh_frame) is too large (0x8f8 bytes)
      /usr/bin/ld: error: /home/ec2-user/libra/target/debug/deps/libclient-ed7c741366847c7f.rlib(client-ed7c741366847c7f.1fpvzritvu3g6n7h.rcgu.o)(.text._ZN4core5slice14from_raw_parts17h3b802c0cad3219d7E) is too large (0x122 bytes)
      /usr/bin/ld: error: /home/ec2-user/libra/target/debug/deps/libclient-ed7c741366847c7f.rlib(client-ed7c741366847c7f.1nyh8gjoye5kfciy.rcgu.o)(.text._ZN75_$LT$hashbrown..raw..RawTable$LT$T$GT$$u20$as$u20$core..ops..drop..Drop$GT$4drop17h0f3d70d0f0e31ac5E) is too large (0x11d bytes)
      /usr/bin/ld: error: /home/ec2-user/libra/target/debug/deps/libclient-ed7c741366847c7f.rlib(client-ed7c741366847c7f.1olhqlk5h8n2sjjx.rcgu.o)(.text._ZN4core3mem7replace17h72434dd696b88aacE) is too large (0x7b bytes)
      /usr/bin/ld: error: /home/ec2-user/libra/target/debug/deps/libclient-ed7c741366847c7f.rlib(client-ed7c741366847c7f.1wnw04asmfr6nsxv.rcgu.o)(.text._ZN4core3ptr33_$LT$impl$u20$$BP$const$u20$T$GT$11offset_from17h5498ecdda4912436E) is too large (0xaf bytes)
      /usr/bin/ld: error: /home/ec2-user/libra/target/debug/deps/libclient-ed7c741366847c7f.rlib(client-ed7c741366847c7f.20gej2e88fk3kmlm.rcgu.o)(.text._ZN59_$LT$alloc..alloc..Global$u20$as$u20$core..alloc..Alloc$GT$7realloc17h924c140591d0ce54E) is too large (0x75 bytes)
      /usr/bin/ld: error: /home/ec2-user/libra/target/debug/deps/libclient-ed7c741366847c7f.rlib(client-ed7c741366847c7f.27xx22tcdcmvjyu7.rcgu.o)(.text._ZN4core3ptr18real_drop_in_place17h16251ef92f8b4a45E) is too large (0x86 bytes)
      /usr/bin/ld: error: /home/ec2-user/libra/target/debug/deps/libclient-ed7c741366847c7f.rlib(client-ed7c741366847c7f.2roe003p4kw3b2yq.rcgu.o)(.text._ZN7futures4sync7oneshot14Inner$LT$T$GT$3new17he9d1b560188ba7b2E) is too large (0x179 bytes)
      /usr/bin/ld: error: /home/ec2-user/libra/target/debug/deps/libclient-ed7c741366847c7f.rlib(client-ed7c741366847c7f.2z6zpr6htgzzo9e4.rcgu.o)(.text._ZN4core3num21_$LT$impl$u20$u64$GT$11checked_add17h48954ddf9cfca368E) is too large (0x6f bytes)
      /usr/bin/ld: error: /home/ec2-user/libra/target/debug/deps/libclient-ed7c741366847c7f.rlib(client-ed7c741366847c7f.33wdnwcilmnvxujr.rcgu.o)(.text._ZN4core3ptr23swap_nonoverlapping_one17h012b8ed74665a554E) is too large (0x127 bytes)
      /usr/bin/ld: error: /home/ec2-user/libra/target/debug/deps/libclient-ed7c741366847c7f.rlib(client-ed7c741366847c7f.371q5oky0erxecvz.rcgu.o)(.eh_frame) is too large (0x108 bytes)

error: aborting due to previous error

error: Could not compile client.

xcode-select –install

I have the same issue running this on Ubuntu… anyone can help?

error: linking with `cc` failed: exit code: 1
error: aborting due to previous error

error: Could not compile `client`.

Okay problem solved. Looks like it is due to the fact that I didn’t allocate sufficient memory and CPU power to the VM to complete the build.

1 Like

Yes I tried in my own Ubuntu, it’s solved. I didn’t expect testnet need so much memory and CPU power.