Skip to content
This repository has been archived by the owner on Feb 28, 2023. It is now read-only.

Trying to build - zlib is not available #12

Open
gmorenz opened this issue Apr 14, 2018 · 22 comments
Open

Trying to build - zlib is not available #12

gmorenz opened this issue Apr 14, 2018 · 22 comments

Comments

@gmorenz
Copy link
Contributor

gmorenz commented Apr 14, 2018

Update: See comment at bottom of issue.

I'm trying to build this, following the instructions in the readme.

I'm running a completely up to date version of Arch Linux (as of Fri April 13 - 10:00pm est). I also just updated rust (default rustc is nightly from 2018-04-11), and just used cargo to install xargo and bootimage.

I get the following error on bootimage build and I'm not sure what to do next

Building kernel
    Finished dev [unoptimized + debuginfo] target(s) in 0.0 secs
Building bootloader
   Compiling bootloader v0.2.0-alpha-002 (file:///home/normal/.cargo/git/checkouts/bootloader-f95646382f09cfb3/72dbed8)
error: linking with `ld.bfd` failed: exit code: 1
  |
  = note: "ld.bfd" "--script=linker.ld" "-L" "/home/normal/.xargo/lib/rustlib/x86_64-bootloader/lib" "/home/normal/.cargo/git/checkouts/bootloader-f95646382f09cfb3/72dbed8/target/x86_64-bootloader/release/deps/bootloader-11d490a507aceb7c.bootloader0-dfe96c7e06f11de46a1a343cce7b0783.rs.rcgu.o" "/home/normal/.cargo/git/checkouts/bootloader-f95646382f09cfb3/72dbed8/target/x86_64-bootloader/release/deps/bootloader-11d490a507aceb7c.bootloader1-dfe96c7e06f11de46a1a343cce7b0783.rs.rcgu.o" "/home/normal/.cargo/git/checkouts/bootloader-f95646382f09cfb3/72dbed8/target/x86_64-bootloader/release/deps/bootloader-11d490a507aceb7c.bootloader10-dfe96c7e06f11de46a1a343cce7b0783.rs.rcgu.o" "/home/normal/.cargo/git/checkouts/bootloader-f95646382f09cfb3/72dbed8/target/x86_64-bootloader/release/deps/bootloader-11d490a507aceb7c.bootloader11-dfe96c7e06f11de46a1a343cce7b0783.rs.rcgu.o" "/home/normal/.cargo/git/checkouts/bootloader-f95646382f09cfb3/72dbed8/target/x86_64-bootloader/release/deps/bootloader-11d490a507aceb7c.bootloader12-dfe96c7e06f11de46a1a343cce7b0783.rs.rcgu.o" "/home/normal/.cargo/git/checkouts/bootloader-f95646382f09cfb3/72dbed8/target/x86_64-bootloader/release/deps/bootloader-11d490a507aceb7c.bootloader13-dfe96c7e06f11de46a1a343cce7b0783.rs.rcgu.o" "/home/normal/.cargo/git/checkouts/bootloader-f95646382f09cfb3/72dbed8/target/x86_64-bootloader/release/deps/bootloader-11d490a507aceb7c.bootloader14-dfe96c7e06f11de46a1a343cce7b0783.rs.rcgu.o" "/home/normal/.cargo/git/checkouts/bootloader-f95646382f09cfb3/72dbed8/target/x86_64-bootloader/release/deps/bootloader-11d490a507aceb7c.bootloader15-dfe96c7e06f11de46a1a343cce7b0783.rs.rcgu.o" "/home/normal/.cargo/git/checkouts/bootloader-f95646382f09cfb3/72dbed8/target/x86_64-bootloader/release/deps/bootloader-11d490a507aceb7c.bootloader2-dfe96c7e06f11de46a1a343cce7b0783.rs.rcgu.o" "/home/normal/.cargo/git/checkouts/bootloader-f95646382f09cfb3/72dbed8/target/x86_64-bootloader/release/deps/bootloader-11d490a507aceb7c.bootloader3-dfe96c7e06f11de46a1a343cce7b0783.rs.rcgu.o" "/home/normal/.cargo/git/checkouts/bootloader-f95646382f09cfb3/72dbed8/target/x86_64-bootloader/release/deps/bootloader-11d490a507aceb7c.bootloader4-dfe96c7e06f11de46a1a343cce7b0783.rs.rcgu.o" "/home/normal/.cargo/git/checkouts/bootloader-f95646382f09cfb3/72dbed8/target/x86_64-bootloader/release/deps/bootloader-11d490a507aceb7c.bootloader5-dfe96c7e06f11de46a1a343cce7b0783.rs.rcgu.o" "/home/normal/.cargo/git/checkouts/bootloader-f95646382f09cfb3/72dbed8/target/x86_64-bootloader/release/deps/bootloader-11d490a507aceb7c.bootloader6-dfe96c7e06f11de46a1a343cce7b0783.rs.rcgu.o" "/home/normal/.cargo/git/checkouts/bootloader-f95646382f09cfb3/72dbed8/target/x86_64-bootloader/release/deps/bootloader-11d490a507aceb7c.bootloader7-dfe96c7e06f11de46a1a343cce7b0783.rs.rcgu.o" "/home/normal/.cargo/git/checkouts/bootloader-f95646382f09cfb3/72dbed8/target/x86_64-bootloader/release/deps/bootloader-11d490a507aceb7c.bootloader8-dfe96c7e06f11de46a1a343cce7b0783.rs.rcgu.o" "/home/normal/.cargo/git/checkouts/bootloader-f95646382f09cfb3/72dbed8/target/x86_64-bootloader/release/deps/bootloader-11d490a507aceb7c.bootloader9-dfe96c7e06f11de46a1a343cce7b0783.rs.rcgu.o" "-o" "/home/normal/.cargo/git/checkouts/bootloader-f95646382f09cfb3/72dbed8/target/x86_64-bootloader/release/deps/bootloader-11d490a507aceb7c" "--gc-sections" "-L" "/home/normal/.cargo/git/checkouts/bootloader-f95646382f09cfb3/72dbed8/target/x86_64-bootloader/release/deps" "-L" "/home/normal/.cargo/git/checkouts/bootloader-f95646382f09cfb3/72dbed8/target/release/deps" "-L" "/home/normal/.xargo/lib/rustlib/x86_64-bootloader/lib" "-Bstatic" "/home/normal/.cargo/git/checkouts/bootloader-f95646382f09cfb3/72dbed8/target/x86_64-bootloader/release/deps/libfixedvec-eef5c962e21d7d31.rlib" "/home/normal/.cargo/git/checkouts/bootloader-f95646382f09cfb3/72dbed8/target/x86_64-bootloader/release/deps/libxmas_elf-aae6628194c68fd2.rlib" "/home/normal/.cargo/git/checkouts/bootloader-f95646382f09cfb3/72dbed8/target/x86_64-bootloader/release/deps/libzero-1fa9bbc977edfd3f.rlib" "/home/normal/.cargo/git/checkouts/bootloader-f95646382f09cfb3/72dbed8/target/x86_64-bootloader/release/deps/libos_bootinfo-419fc6a33544577f.rlib" "/home/normal/.cargo/git/checkouts/bootloader-f95646382f09cfb3/72dbed8/target/x86_64-bootloader/release/deps/libx86_64-9c59656970daf926.rlib" "/home/normal/.cargo/git/checkouts/bootloader-f95646382f09cfb3/72dbed8/target/x86_64-bootloader/release/deps/libux-0ae475bb5d2e810b.rlib" "/home/normal/.cargo/git/checkouts/bootloader-f95646382f09cfb3/72dbed8/target/x86_64-bootloader/release/deps/libusize_conversions-69f45d4a93267169.rlib" "/home/normal/.cargo/git/checkouts/bootloader-f95646382f09cfb3/72dbed8/target/x86_64-bootloader/release/deps/libbit_field-936384338c359944.rlib" "/home/normal/.cargo/git/checkouts/bootloader-f95646382f09cfb3/72dbed8/target/x86_64-bootloader/release/deps/libbitflags-c83f02e4e62272ec.rlib" "/home/normal/.xargo/lib/rustlib/x86_64-bootloader/lib/libcore-9fcd61144beb7713.rlib" "/home/normal/.xargo/lib/rustlib/x86_64-bootloader/lib/libcompiler_builtins-22484532506719c0.rlib" "-Bdynamic"
  = note: /home/normal/.cargo/git/checkouts/bootloader-f95646382f09cfb3/72dbed8/target/x86_64-bootloader/release/deps/bootloader-11d490a507aceb7c.bootloader2-dfe96c7e06f11de46a1a343cce7b0783.rs.rcgu.o: In function `bootloader::printer::Printer::clear_screen':
          /home/normal/.cargo/git/checkouts/bootloader-f95646382f09cfb3/72dbed8/src/printer.rs:16: undefined reference to `memset'
          /home/normal/.cargo/git/checkouts/bootloader-f95646382f09cfb3/72dbed8/target/x86_64-bootloader/release/deps/bootloader-11d490a507aceb7c.bootloader2-dfe96c7e06f11de46a1a343cce7b0783.rs.rcgu.o: In function `load_elf':
          /home/normal/.cargo/git/checkouts/bootloader-f95646382f09cfb3/72dbed8/src/main.rs:81: undefined reference to `memset'
          /home/normal/.cargo/git/checkouts/bootloader-f95646382f09cfb3/72dbed8/src/main.rs:193: undefined reference to `memcpy'
          /home/normal/.cargo/git/checkouts/bootloader-f95646382f09cfb3/72dbed8/target/x86_64-bootloader/release/deps/bootloader-11d490a507aceb7c.bootloader2-dfe96c7e06f11de46a1a343cce7b0783.rs.rcgu.o: In function `core::ptr::write':
          /home/normal/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/src/libcore/ptr.rs:364: undefined reference to `memmove'
          /home/normal/.cargo/git/checkouts/bootloader-f95646382f09cfb3/72dbed8/target/x86_64-bootloader/release/deps/bootloader-11d490a507aceb7c.bootloader0-dfe96c7e06f11de46a1a343cce7b0783.rs.rcgu.o: In function `core::ptr::write':
          /home/normal/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/src/libcore/ptr.rs:364: undefined reference to `memmove'
          /home/normal/.cargo/git/checkouts/bootloader-f95646382f09cfb3/72dbed8/target/x86_64-bootloader/release/deps/bootloader-11d490a507aceb7c.bootloader6-dfe96c7e06f11de46a1a343cce7b0783.rs.rcgu.o: In function `bootloader::boot_info::create_from':
          /home/normal/.cargo/git/checkouts/bootloader-f95646382f09cfb3/72dbed8/src/boot_info.rs:32: undefined reference to `memcpy'
          /home/normal/.cargo/git/checkouts/bootloader-f95646382f09cfb3/72dbed8/target/x86_64-bootloader/release/deps/libos_bootinfo-419fc6a33544577f.rlib(os_bootinfo-419fc6a33544577f.os_bootinfo9-a31185fa43d6bcd9ab151b1ecc3db8b2.rs.rcgu.o): In function `os_bootinfo::BootInfo::new':
          /home/normal/.cargo/registry/src/github.com-1ecc6299db9ec823/os_bootinfo-0.2.0-alpha-011/src/lib.rs:24: undefined reference to `memcpy'
          /home/normal/.cargo/git/checkouts/bootloader-f95646382f09cfb3/72dbed8/target/x86_64-bootloader/release/deps/libx86_64-9c59656970daf926.rlib(x86_64-9c59656970daf926.x86_645-68c15daa91a26318d3f94196ac62320.rs.rcgu.o): In function `x86_64::structures::paging::page_table::PageTableEntry::set_unused':
          /home/normal/.cargo/registry/src/github.com-1ecc6299db9ec823/x86_64-0.2.0-alpha-016/src/structures/paging/page_table.rs:28: undefined reference to `memset'
          /home/normal/.xargo/lib/rustlib/x86_64-bootloader/lib/libcore-9fcd61144beb7713.rlib(core-9fcd61144beb7713.core12-19102d68c068b964c87f95c8c783893f.rs.rcgu.o): In function `<str as core::str::StrExt>::find':
          core12-19102d68c068b964c87f95c8c783893f.rs:(.text._ZN41_$LT$str$u20$as$u20$core..str..StrExt$GT$4find17h65f4c0f3ff3347a0E+0x1a3): undefined reference to `memcmp'
          

error: aborting due to previous error

error: Could not compile `bootloader`.

To learn more, run the command again with --verbose.
@lachlansneff
Copy link
Contributor

Hmm, that's interesting. It looks to me like there's an issue with the bootloader. I'm in the process of upgrading nebulet to use a more up-to-date version of the bootloader and that'll likely end up fixing this issue.

Also, @phil-opp might know something.

@gmorenz
Copy link
Contributor Author

gmorenz commented Apr 14, 2018

That does seem fairly likely to fix it. Trying to build bootloader from master on github works fine, trying to build it from the version in file:///home/normal/.cargo/git/checkouts/bootloader-f95646382f09cfb3/72dbed8 results in 832 errors (all, I think, unecessary qualification, unecessary braces, and trivial casts. Which I presume are warnings promoted to errors).

@phil-opp
Copy link

I think the problem is japaric/xargo#215: xargo interprets nebulets Xargo.toml when building, which does not activate the mem feauture of compiler_builtins.

To work around this, you can remove the [package.metadata.bootimage.bootloader] table from nebulet's Cargo.toml. Then a precompiled bootloader version from crates.io is used by default, which should work because the latest release resembles the master branch.

@gmorenz
Copy link
Contributor Author

gmorenz commented Apr 14, 2018

That lets it build!

After running cargo boot I just get a qemu window that flashes black about once a second and when not black says

SeaBIOS (version 1.11.0-20171110_100015-anatol)

iPXE (http://ipxe.org) 00:03.0 C980 PC12.10 PnP PMM+07F92510+07EF2510 C980


Booting from Hard Disk...
Booting (first stage)...
Booting (second stage)...

I assume this isn't intended behaviour? Particularly since it continues with the flashing black even if I replace the contents of kmain with loop {} (and rebuild everything).

@lachlansneff
Copy link
Contributor

lachlansneff commented Apr 14, 2018

Yes, the issue is that you're trying to boot with a bootloader version that's too new. I'm in the process of updating nebulet for upstream bootloader. That should be finished today, assuming my pr is merged into the upstream x86_64 crate by @phil-opp.

After that, nebulet should boot just fine.

@lachlansneff
Copy link
Contributor

@gmorenz Almost ready! It's just stuck on the new x86_64 crate being published so that the os_bootinfo crate can retrieve the new version.

@lachlansneff
Copy link
Contributor

@gmorenz Nebulet is up and running! Give it a try!

@gmorenz
Copy link
Contributor Author

gmorenz commented Apr 15, 2018

Same error as before, here's the output of a clean build (after pulling changes, and installing a fresh bootimage in case that had been updated too).

I notice that it is using the most recent x86_64 and bootloader.

What environment are you using that it succesfully builds under?

$ bootimage build
Building kernel
   Compiling unicode-xid v0.0.4
   Compiling quote v0.3.15
   Compiling gcc v0.3.54
   Compiling cretonne v0.4.1 (file:///home/normal/apps/nebulet/cretonne/lib/cretonne)
   Compiling hashmap_core v0.1.3 (https://github.com/nebulet/hashmap_core.git#481d2b2f)
   Compiling bitflags v0.7.0
   Compiling bit_field v0.9.0
   Compiling os_bootinfo v0.2.0
   Compiling bitflags v1.0.1
   Compiling spin v0.4.7
   Compiling usize_conversions v0.2.0
   Compiling ux v0.1.0
   Compiling rlibc v1.0.0
   Compiling nebulet_abi v0.1.0 (file:///home/normal/apps/nebulet/nabi)
   Compiling synom v0.11.3
   Compiling wasmparser v0.15.0 (https://github.com/nebulet/wasmparser.rs.git?branch=no_std#97f55165)
   Compiling raw-cpuid v3.0.0
   Compiling lazy_static v1.0.0
   Compiling linked_list_allocator v0.5.0
   Compiling syn v0.11.11
   Compiling synstructure v0.6.1
   Compiling failure_derive v0.1.1
   Compiling failure v0.1.1
   Compiling x86_64 v0.2.0-alpha-019
   Compiling cretonne-frontend v0.4.1 (file:///home/normal/apps/nebulet/cretonne/lib/frontend)
   Compiling cretonne-native v0.4.1 (file:///home/normal/apps/nebulet/cretonne/lib/native)
   Compiling cretonne-wasm v0.4.1 (file:///home/normal/apps/nebulet/cretonne/lib/wasm)
   Compiling nebulet v0.1.0 (file:///home/normal/apps/nebulet)
warning: unused imports: `DerefMut`, `Deref`
 --> src/arch/x64/paging/mod.rs:1:17
  |
1 | use core::ops::{Deref, DerefMut};
  |                 ^^^^^  ^^^^^^^^
  |
  = note: #[warn(unused_imports)] on by default

warning: unused import: `PageSize`
 --> src/arch/x64/paging/mod.rs:2:106
  |
2 | use x86_64::structures::paging::{PageTable, PageTableFlags, RecursivePageTable, PhysFrame, Page, Mapper, PageSize, Size4KB, MapperFlush, MapToError, UnmapError, FlagUpdateError};
  |                                                                                                          ^^^^^^^^

warning: unused imports: `PageTableFlags`, `PageTable`
 --> src/arch/x64/memory/mod.rs:5:34
  |
5 | use x86_64::structures::paging::{PageTable, PageTableFlags, PhysFrame};
  |                                  ^^^^^^^^^  ^^^^^^^^^^^^^^

warning: unused import: `Error`
 --> src/memory/code.rs:8:20
  |
8 | use nabi::{Result, Error};
  |                    ^^^^^

warning: unreachable statement
  --> src/strand/strand.rs:67:5
   |
67 |     unreachable!();
   |     ^^^^^^^^^^^^^^^
   |
   = note: #[warn(unreachable_code)] on by default
   = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)

warning: function is never used: `counter`
  --> src/arch/x64/cpu.rs:59:5
   |
59 |     fn counter() -> u32 {
   |     ^^^^^^^^^^^^^^^^^^^
   |
   = note: #[warn(dead_code)] on by default

warning: field is never used: `module`
  --> src/memory/code.rs:12:5
   |
12 |     module: Module,
   |     ^^^^^^^^^^^^^^

warning: field is never used: `instance`
  --> src/memory/code.rs:13:5
   |
13 |     instance: Instance,
   |     ^^^^^^^^^^^^^^^^^^

warning: field is never used: `region`
  --> src/memory/code.rs:14:5
   |
14 |     region: Region,
   |     ^^^^^^^^^^^^^^

warning: field is never used: `start`
  --> src/memory/sip.rs:15:5
   |
15 |     start: usize,
   |     ^^^^^^^^^^^^

warning: field is never used: `modem_sts`
  --> src/common/devices/uart_16550.rs:33:5
   |
33 |     modem_sts: Port<u8>,
   |     ^^^^^^^^^^^^^^^^^^^

warning: struct is never used: `StrandList`
 --> src/strand/list.rs:8:1
  |
8 | pub struct StrandList {
  | ^^^^^^^^^^^^^^^^^^^^^

warning: method is never used: `new`
  --> src/strand/list.rs:15:5
   |
15 |     pub fn new() -> StrandList {
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^

warning: function is never used: `idle_strand_entry`
  --> src/strand/list.rs:28:1
   |
28 | extern fn idle_strand_entry(_: usize) -> i32 {
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

warning: function is never used: `test_external_func`
  --> src/wasm/runtime/compilation.rs:18:1
   |
18 | extern "C" fn test_external_func(arg: u64) {
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

warning: field is never used: `func`
  --> src/wasm/runtime/mod.rs:54:5
   |
54 |     func: &'func ir::Function,
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^

    Finished dev [unoptimized + debuginfo] target(s) in 43.46 secs
    Updating registry `https://github.com/rust-lang/crates.io-index`
Building bootloader
   Compiling bootloader v0.2.0-alpha-004 (file:///home/normal/.cargo/registry/src/github.com-1ecc6299db9ec823/bootloader-0.2.0-alpha-004)
error: linking with `ld.bfd` failed: exit code: 1
  |
  = note: "ld.bfd" "--script=linker.ld" "-L" "/home/normal/.xargo/lib/rustlib/x86_64-bootloader/lib" "/home/normal/.cargo/registry/src/github.com-1ecc6299db9ec823/bootloader-0.2.0-alpha-004/target/x86_64-bootloader/release/deps/bootloader-3978af8943325dd0.bootloader0-fc10f4a069a3094dc983c974a276b646.rs.rcgu.o" "/home/normal/.cargo/registry/src/github.com-1ecc6299db9ec823/bootloader-0.2.0-alpha-004/target/x86_64-bootloader/release/deps/bootloader-3978af8943325dd0.bootloader1-fc10f4a069a3094dc983c974a276b646.rs.rcgu.o" "/home/normal/.cargo/registry/src/github.com-1ecc6299db9ec823/bootloader-0.2.0-alpha-004/target/x86_64-bootloader/release/deps/bootloader-3978af8943325dd0.bootloader10-fc10f4a069a3094dc983c974a276b646.rs.rcgu.o" "/home/normal/.cargo/registry/src/github.com-1ecc6299db9ec823/bootloader-0.2.0-alpha-004/target/x86_64-bootloader/release/deps/bootloader-3978af8943325dd0.bootloader11-fc10f4a069a3094dc983c974a276b646.rs.rcgu.o" "/home/normal/.cargo/registry/src/github.com-1ecc6299db9ec823/bootloader-0.2.0-alpha-004/target/x86_64-bootloader/release/deps/bootloader-3978af8943325dd0.bootloader12-fc10f4a069a3094dc983c974a276b646.rs.rcgu.o" "/home/normal/.cargo/registry/src/github.com-1ecc6299db9ec823/bootloader-0.2.0-alpha-004/target/x86_64-bootloader/release/deps/bootloader-3978af8943325dd0.bootloader13-fc10f4a069a3094dc983c974a276b646.rs.rcgu.o" "/home/normal/.cargo/registry/src/github.com-1ecc6299db9ec823/bootloader-0.2.0-alpha-004/target/x86_64-bootloader/release/deps/bootloader-3978af8943325dd0.bootloader14-fc10f4a069a3094dc983c974a276b646.rs.rcgu.o" "/home/normal/.cargo/registry/src/github.com-1ecc6299db9ec823/bootloader-0.2.0-alpha-004/target/x86_64-bootloader/release/deps/bootloader-3978af8943325dd0.bootloader15-fc10f4a069a3094dc983c974a276b646.rs.rcgu.o" "/home/normal/.cargo/registry/src/github.com-1ecc6299db9ec823/bootloader-0.2.0-alpha-004/target/x86_64-bootloader/release/deps/bootloader-3978af8943325dd0.bootloader2-fc10f4a069a3094dc983c974a276b646.rs.rcgu.o" "/home/normal/.cargo/registry/src/github.com-1ecc6299db9ec823/bootloader-0.2.0-alpha-004/target/x86_64-bootloader/release/deps/bootloader-3978af8943325dd0.bootloader3-fc10f4a069a3094dc983c974a276b646.rs.rcgu.o" "/home/normal/.cargo/registry/src/github.com-1ecc6299db9ec823/bootloader-0.2.0-alpha-004/target/x86_64-bootloader/release/deps/bootloader-3978af8943325dd0.bootloader4-fc10f4a069a3094dc983c974a276b646.rs.rcgu.o" "/home/normal/.cargo/registry/src/github.com-1ecc6299db9ec823/bootloader-0.2.0-alpha-004/target/x86_64-bootloader/release/deps/bootloader-3978af8943325dd0.bootloader5-fc10f4a069a3094dc983c974a276b646.rs.rcgu.o" "/home/normal/.cargo/registry/src/github.com-1ecc6299db9ec823/bootloader-0.2.0-alpha-004/target/x86_64-bootloader/release/deps/bootloader-3978af8943325dd0.bootloader6-fc10f4a069a3094dc983c974a276b646.rs.rcgu.o" "/home/normal/.cargo/registry/src/github.com-1ecc6299db9ec823/bootloader-0.2.0-alpha-004/target/x86_64-bootloader/release/deps/bootloader-3978af8943325dd0.bootloader7-fc10f4a069a3094dc983c974a276b646.rs.rcgu.o" "/home/normal/.cargo/registry/src/github.com-1ecc6299db9ec823/bootloader-0.2.0-alpha-004/target/x86_64-bootloader/release/deps/bootloader-3978af8943325dd0.bootloader8-fc10f4a069a3094dc983c974a276b646.rs.rcgu.o" "/home/normal/.cargo/registry/src/github.com-1ecc6299db9ec823/bootloader-0.2.0-alpha-004/target/x86_64-bootloader/release/deps/bootloader-3978af8943325dd0.bootloader9-fc10f4a069a3094dc983c974a276b646.rs.rcgu.o" "-o" "/home/normal/.cargo/registry/src/github.com-1ecc6299db9ec823/bootloader-0.2.0-alpha-004/target/x86_64-bootloader/release/deps/bootloader-3978af8943325dd0" "--gc-sections" "-L" "/home/normal/.cargo/registry/src/github.com-1ecc6299db9ec823/bootloader-0.2.0-alpha-004/target/x86_64-bootloader/release/deps" "-L" "/home/normal/.cargo/registry/src/github.com-1ecc6299db9ec823/bootloader-0.2.0-alpha-004/target/release/deps" "-L" "/home/normal/.xargo/lib/rustlib/x86_64-bootloader/lib" "-Bstatic" "/home/normal/.cargo/registry/src/github.com-1ecc6299db9ec823/bootloader-0.2.0-alpha-004/target/x86_64-bootloader/release/deps/libfixedvec-eef5c962e21d7d31.rlib" "/home/normal/.cargo/registry/src/github.com-1ecc6299db9ec823/bootloader-0.2.0-alpha-004/target/x86_64-bootloader/release/deps/libxmas_elf-aae6628194c68fd2.rlib" "/home/normal/.cargo/registry/src/github.com-1ecc6299db9ec823/bootloader-0.2.0-alpha-004/target/x86_64-bootloader/release/deps/libzero-1fa9bbc977edfd3f.rlib" "/home/normal/.cargo/registry/src/github.com-1ecc6299db9ec823/bootloader-0.2.0-alpha-004/target/x86_64-bootloader/release/deps/libx86_64-b5de314d1edfb00d.rlib" "/home/normal/.cargo/registry/src/github.com-1ecc6299db9ec823/bootloader-0.2.0-alpha-004/target/x86_64-bootloader/release/deps/libux-0ae475bb5d2e810b.rlib" "/home/normal/.cargo/registry/src/github.com-1ecc6299db9ec823/bootloader-0.2.0-alpha-004/target/x86_64-bootloader/release/deps/libbit_field-936384338c359944.rlib" "/home/normal/.cargo/registry/src/github.com-1ecc6299db9ec823/bootloader-0.2.0-alpha-004/target/x86_64-bootloader/release/deps/libbitflags-c83f02e4e62272ec.rlib" "/home/normal/.cargo/registry/src/github.com-1ecc6299db9ec823/bootloader-0.2.0-alpha-004/target/x86_64-bootloader/release/deps/libusize_conversions-69f45d4a93267169.rlib" "/home/normal/.cargo/registry/src/github.com-1ecc6299db9ec823/bootloader-0.2.0-alpha-004/target/x86_64-bootloader/release/deps/libos_bootinfo-9b6c48092d4407df.rlib" "/home/normal/.xargo/lib/rustlib/x86_64-bootloader/lib/libcore-9fcd61144beb7713.rlib" "/home/normal/.xargo/lib/rustlib/x86_64-bootloader/lib/libcompiler_builtins-22484532506719c0.rlib" "-Bdynamic"
  = note: /home/normal/.cargo/registry/src/github.com-1ecc6299db9ec823/bootloader-0.2.0-alpha-004/target/x86_64-bootloader/release/deps/bootloader-3978af8943325dd0.bootloader2-fc10f4a069a3094dc983c974a276b646.rs.rcgu.o: In function `bootloader::printer::Printer::clear_screen':
          /home/normal/.cargo/registry/src/github.com-1ecc6299db9ec823/bootloader-0.2.0-alpha-004/src/printer.rs:16: undefined reference to `memset'
          /home/normal/.cargo/registry/src/github.com-1ecc6299db9ec823/bootloader-0.2.0-alpha-004/target/x86_64-bootloader/release/deps/bootloader-3978af8943325dd0.bootloader2-fc10f4a069a3094dc983c974a276b646.rs.rcgu.o: In function `load_elf':
          /home/normal/.cargo/registry/src/github.com-1ecc6299db9ec823/bootloader-0.2.0-alpha-004/src/main.rs:80: undefined reference to `memset'
          /home/normal/.cargo/registry/src/github.com-1ecc6299db9ec823/bootloader-0.2.0-alpha-004/src/main.rs:192: undefined reference to `memcpy'
          /home/normal/.cargo/registry/src/github.com-1ecc6299db9ec823/bootloader-0.2.0-alpha-004/target/x86_64-bootloader/release/deps/bootloader-3978af8943325dd0.bootloader2-fc10f4a069a3094dc983c974a276b646.rs.rcgu.o: In function `core::ptr::write':
          /home/normal/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/src/libcore/ptr.rs:364: undefined reference to `memmove'
          /home/normal/.cargo/registry/src/github.com-1ecc6299db9ec823/bootloader-0.2.0-alpha-004/target/x86_64-bootloader/release/deps/bootloader-3978af8943325dd0.bootloader0-fc10f4a069a3094dc983c974a276b646.rs.rcgu.o: In function `core::ptr::write':
          /home/normal/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/src/libcore/ptr.rs:364: undefined reference to `memmove'
          /home/normal/.cargo/registry/src/github.com-1ecc6299db9ec823/bootloader-0.2.0-alpha-004/target/x86_64-bootloader/release/deps/bootloader-3978af8943325dd0.bootloader6-fc10f4a069a3094dc983c974a276b646.rs.rcgu.o: In function `bootloader::boot_info::create_from':
          /home/normal/.cargo/registry/src/github.com-1ecc6299db9ec823/bootloader-0.2.0-alpha-004/src/boot_info.rs:32: undefined reference to `memcpy'
          /home/normal/.cargo/registry/src/github.com-1ecc6299db9ec823/bootloader-0.2.0-alpha-004/target/x86_64-bootloader/release/deps/libx86_64-b5de314d1edfb00d.rlib(x86_64-b5de314d1edfb00d.x86_640-bfb49d001b1c77b5f6f942aadee0d8d7.rs.rcgu.o): In function `x86_64::structures::paging::page_table::PageTableEntry::set_unused':
          /home/normal/.cargo/registry/src/github.com-1ecc6299db9ec823/x86_64-0.2.0-alpha-019/src/structures/paging/page_table.rs:28: undefined reference to `memset'
          /home/normal/.cargo/registry/src/github.com-1ecc6299db9ec823/bootloader-0.2.0-alpha-004/target/x86_64-bootloader/release/deps/libos_bootinfo-9b6c48092d4407df.rlib(os_bootinfo-9b6c48092d4407df.os_bootinfo7-c6eb3cbc7bcf18ac4fe19913c07372f0.rs.rcgu.o): In function `os_bootinfo::BootInfo::new':
          /home/normal/.cargo/registry/src/github.com-1ecc6299db9ec823/os_bootinfo-0.2.0/src/lib.rs:20: undefined reference to `memcpy'
          /home/normal/.xargo/lib/rustlib/x86_64-bootloader/lib/libcore-9fcd61144beb7713.rlib(core-9fcd61144beb7713.core12-19102d68c068b964c87f95c8c783893f.rs.rcgu.o): In function `<str as core::str::StrExt>::find':
          core12-19102d68c068b964c87f95c8c783893f.rs:(.text._ZN41_$LT$str$u20$as$u20$core..str..StrExt$GT$4find17h65f4c0f3ff3347a0E+0x1a3): undefined reference to `memcmp'
          

error: aborting due to previous error

error: Could not compile `bootloader`.

To learn more, run the command again with --verbose.

@gmorenz
Copy link
Contributor Author

gmorenz commented Apr 15, 2018

Looked at your .travis.yml and one thitng that jumps out at me is that I had to manually install lld while it doesn't. Am I supposed to be using the one that ships with rustc somehow?

Edit: In trying to use rustc's lld I updated nightly to the new one which broke hashmap_core, I see you are already in the process of fixing that so I'll continue with my attempts once that works.

@phil-opp
Copy link

To use the lld shipped with rustc, you have to delete the linker entry in the target json and set the linker-flavor to ld.lld.

@lachlansneff
Copy link
Contributor

Give it another try now.

@gmorenz
Copy link
Contributor Author

gmorenz commented Apr 15, 2018

I got it working by checking out the most recent code and undoing the change to x86_64-nebulet.json (so using system lld) 👍! Presumably this works just because it's not building bootloader but instead using a prebuilt binary. Since I can build bootloader by cloning the repository seperately I guess that's good enough.

Using the new x86_64-nebulet.json I get lld: error: zlib is not available while compiling the nebulet crate... which is odd since it's definitely installed, pkg-config can find it, etc. Full error copied below. I'll poke at it a bit more and see if I can figure out exactly what's going on soon.

Building kernel
   Compiling nebulet v0.1.0 (file:///home/normal/apps/nebulet)
warning: unused imports: `DerefMut`, `Deref`
 --> src/arch/x64/paging/mod.rs:1:17
  |
1 | use core::ops::{Deref, DerefMut};
  |                 ^^^^^  ^^^^^^^^
  |
  = note: #[warn(unused_imports)] on by default

warning: unused import: `PageSize`
 --> src/arch/x64/paging/mod.rs:2:106
  |
2 | use x86_64::structures::paging::{PageTable, PageTableFlags, RecursivePageTable, PhysFrame, Page, Mapper, PageSize, Size4KB, MapperFlush, MapToError, UnmapError, FlagUpdateError};
  |                                                                                                          ^^^^^^^^

warning: unused imports: `PageTableFlags`, `PageTable`
 --> src/arch/x64/memory/mod.rs:5:34
  |
5 | use x86_64::structures::paging::{PageTable, PageTableFlags, PhysFrame};
  |                                  ^^^^^^^^^  ^^^^^^^^^^^^^^

warning: unused import: `Error`
 --> src/memory/code.rs:8:20
  |
8 | use nabi::{Result, Error};
  |                    ^^^^^

warning: unreachable statement
  --> src/strand/strand.rs:67:5
   |
67 |     unreachable!();
   |     ^^^^^^^^^^^^^^^
   |
   = note: #[warn(unreachable_code)] on by default
   = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)

warning: unused variable: `mapper`
  --> src/allocator/mod.rs:34:20
   |
34 | pub unsafe fn init(mapper: &mut PageMapper) {
   |                    ^^^^^^ help: consider using `_mapper` instead
   |
   = note: #[warn(unused_variables)] on by default

warning: unused variable: `offset`
  --> src/allocator/dlmalloc_rs/mod.rs:72:24
   |
72 |     pub unsafe fn init(offset: usize, size: usize) {}
   |                        ^^^^^^ help: consider using `_offset` instead

warning: unused variable: `size`
  --> src/allocator/dlmalloc_rs/mod.rs:72:39
   |
72 |     pub unsafe fn init(offset: usize, size: usize) {}
   |                                       ^^^^ help: consider using `_size` instead

warning: function is never used: `counter`
  --> src/arch/x64/cpu.rs:59:5
   |
59 |     fn counter() -> u32 {
   |     ^^^^^^^^^^^^^^^^^^^
   |
   = note: #[warn(dead_code)] on by default

warning: field is never used: `module`
  --> src/memory/code.rs:12:5
   |
12 |     module: Module,
   |     ^^^^^^^^^^^^^^

warning: field is never used: `instance`
  --> src/memory/code.rs:13:5
   |
13 |     instance: Instance,
   |     ^^^^^^^^^^^^^^^^^^

warning: field is never used: `region`
  --> src/memory/code.rs:14:5
   |
14 |     region: Region,
   |     ^^^^^^^^^^^^^^

warning: field is never used: `start`
  --> src/memory/sip.rs:15:5
   |
15 |     start: usize,
   |     ^^^^^^^^^^^^

warning: field is never used: `modem_sts`
  --> src/common/devices/uart_16550.rs:33:5
   |
33 |     modem_sts: Port<u8>,
   |     ^^^^^^^^^^^^^^^^^^^

warning: method is never used: `new`
   --> src/allocator/dlmalloc_rs/dlmalloc.rs:110:5
    |
110 |     pub fn new() -> Dlmalloc {
    |     ^^^^^^^^^^^^^^^^^^^^^^^^

warning: function is never used: `acquire_global_lock`
  --> src/allocator/dlmalloc_rs/sys.rs:38:1
   |
38 | pub fn acquire_global_lock() {}
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^

warning: function is never used: `release_global_lock`
  --> src/allocator/dlmalloc_rs/sys.rs:40:1
   |
40 | pub fn release_global_lock() {}
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^

warning: method is never used: `new`
  --> src/allocator/dlmalloc_rs/mod.rs:19:5
   |
19 |     pub fn new() -> Dlmalloc {
   |     ^^^^^^^^^^^^^^^^^^^^^^^^

warning: struct is never used: `StrandList`
 --> src/strand/list.rs:8:1
  |
8 | pub struct StrandList {
  | ^^^^^^^^^^^^^^^^^^^^^

warning: method is never used: `new`
  --> src/strand/list.rs:15:5
   |
15 |     pub fn new() -> StrandList {
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^

warning: function is never used: `idle_strand_entry`
  --> src/strand/list.rs:28:1
   |
28 | extern fn idle_strand_entry(_: usize) -> i32 {
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

warning: function is never used: `test_external_func`
  --> src/wasm/runtime/compilation.rs:18:1
   |
18 | extern "C" fn test_external_func(arg: u64) {
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

warning: field is never used: `func`
  --> src/wasm/runtime/mod.rs:54:5
   |
54 |     func: &'func ir::Function,
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^

error: linking with `lld` failed: exit code: 1
  |
  = note: "lld" "-flavor" "gnu" "-L" "/home/normal/.xargo/lib/rustlib/x86_64-nebulet/lib" "/home/normal/apps/nebulet/target/x86_64-nebulet/debug/deps/nebulet-9684cf7767550d56.10vxsr1s0btbpq7x.rcgu.o" "/home/normal/apps/nebulet/target/x86_64-nebulet/debug/deps/nebulet-9684cf7767550d56.12g6umllkgotll3a.rcgu.o" "/home/normal/apps/nebulet/target/x86_64-nebulet/debug/deps/nebulet-9684cf7767550d56.153yty63tbhagxyu.rcgu.o" "/home/normal/apps/nebulet/target/x86_64-nebulet/debug/deps/nebulet-9684cf7767550d56.158wz1xuz2s5vbhj.rcgu.o" "/home/normal/apps/nebulet/target/x86_64-nebulet/debug/deps/nebulet-9684cf7767550d56.16i0u6jlhoj1fwbo.rcgu.o" "/home/normal/apps/nebulet/target/x86_64-nebulet/debug/deps/nebulet-9684cf7767550d56.16u6js6g0l3k1ic6.rcgu.o" "/home/normal/apps/nebulet/target/x86_64-nebulet/debug/deps/nebulet-9684cf7767550d56.18019miod40fok10.rcgu.o" "/home/normal/apps/nebulet/target/x86_64-nebulet/debug/deps/nebulet-9684cf7767550d56.181cuta0v63atwcm.rcgu.o" "/home/normal/apps/nebulet/target/x86_64-nebulet/debug/deps/nebulet-9684cf7767550d56.1bmp2yof8vukwrhv.rcgu.o" "/home/normal/apps/nebulet/target/x86_64-nebulet/debug/deps/nebulet-9684cf7767550d56.1cwvxdondh2mjgsi.rcgu.o" "/home/normal/apps/nebulet/target/x86_64-nebulet/debug/deps/nebulet-9684cf7767550d56.1dqvxks6k2bzkxe.rcgu.o" "/home/normal/apps/nebulet/target/x86_64-nebulet/debug/deps/nebulet-9684cf7767550d56.1eoqieb29fre04rc.rcgu.o" "/home/normal/apps/nebulet/target/x86_64-nebulet/debug/deps/nebulet-9684cf7767550d56.1f77k7zrzvm46r1g.rcgu.o" "/home/normal/apps/nebulet/target/x86_64-nebulet/debug/deps/nebulet-9684cf7767550d56.1gwav539dtqo5mpz.rcgu.o" "/home/normal/apps/nebulet/target/x86_64-nebulet/debug/deps/nebulet-9684cf7767550d56.1i5e4omzc3vzt1vq.rcgu.o" "/home/normal/apps/nebulet/target/x86_64-nebulet/debug/deps/nebulet-9684cf7767550d56.1i8skubfgz6wuno6.rcgu.o" "/home/normal/apps/nebulet/target/x86_64-nebulet/debug/deps/nebulet-9684cf7767550d56.1im38lueib99jsk0.rcgu.o" "/home/normal/apps/nebulet/target/x86_64-nebulet/debug/deps/nebulet-9684cf7767550d56.1jnlhyxj59jycbjv.rcgu.o" "/home/normal/apps/nebulet/target/x86_64-nebulet/debug/deps/nebulet-9684cf7767550d56.1lxv5d5ezx0i3gfl.rcgu.o" "/home/normal/apps/nebulet/target/x86_64-nebulet/debug/deps/nebulet-9684cf7767550d56.1mvmz58owquyropc.rcgu.o" "/home/normal/apps/nebulet/target/x86_64-nebulet/debug/deps/nebulet-9684cf7767550d56.1o1sh7k0fpdf7ic5.rcgu.o" "/home/normal/apps/nebulet/target/x86_64-nebulet/debug/deps/nebulet-9684cf7767550d56.1rg2fezz46s2u7v5.rcgu.o" "/home/normal/apps/nebulet/target/x86_64-nebulet/debug/deps/nebulet-9684cf7767550d56.1sq49gopnsnlxbnd.rcgu.o" "/home/normal/apps/nebulet/target/x86_64-nebulet/debug/deps/nebulet-9684cf7767550d56.1twu16w8872h6ynu.rcgu.o" "/home/normal/apps/nebulet/target/x86_64-nebulet/debug/deps/nebulet-9684cf7767550d56.1vknwfcvvkuauoic.rcgu.o" "/home/normal/apps/nebulet/target/x86_64-nebulet/debug/deps/nebulet-9684cf7767550d56.1w3ammq2ub8e8vho.rcgu.o" "/home/normal/apps/nebulet/target/x86_64-nebulet/debug/deps/nebulet-9684cf7767550d56.1xl7bcihfm2xjojj.rcgu.o" "/home/normal/apps/nebulet/target/x86_64-nebulet/debug/deps/nebulet-9684cf7767550d56.1y0f1d2ywo4h8fck.rcgu.o" "/home/normal/apps/nebulet/target/x86_64-nebulet/debug/deps/nebulet-9684cf7767550d56.1y16o1qfye96o7m0.rcgu.o" "/home/normal/apps/nebulet/target/x86_64-nebulet/debug/deps/nebulet-9684cf7767550d56.1yua5irwh2dbthvz.rcgu.o" "/home/normal/apps/nebulet/target/x86_64-nebulet/debug/deps/nebulet-9684cf7767550d56.1zdvx593zieu402j.rcgu.o" "/home/normal/apps/nebulet/target/x86_64-nebulet/debug/deps/nebulet-9684cf7767550d56.1ze755ccoy5wqg8u.rcgu.o" "/home/normal/apps/nebulet/target/x86_64-nebulet/debug/deps/nebulet-9684cf7767550d56.1zwd8n7bcl3vhvvh.rcgu.o" "/home/normal/apps/nebulet/target/x86_64-nebulet/debug/deps/nebulet-9684cf7767550d56.22u6ul8yecfwousc.rcgu.o" "/home/normal/apps/nebulet/target/x86_64-nebulet/debug/deps/nebulet-9684cf7767550d56.23tqyymcb18u96mb.rcgu.o" "/home/normal/apps/nebulet/target/x86_64-nebulet/debug/deps/nebulet-9684cf7767550d56.251r90zeydtno1mb.rcgu.o" "/home/normal/apps/nebulet/target/x86_64-nebulet/debug/deps/nebulet-9684cf7767550d56.2b2t0jvk1e1po01n.rcgu.o" "/home/normal/apps/nebulet/target/x86_64-nebulet/debug/deps/nebulet-9684cf7767550d56.2cjkqgs9bmk41sh9.rcgu.o" "/home/normal/apps/nebulet/target/x86_64-nebulet/debug/deps/nebulet-9684cf7767550d56.2ckmdtf1ekafwi2l.rcgu.o" "/home/normal/apps/nebulet/target/x86_64-nebulet/debug/deps/nebulet-9684cf7767550d56.2f0hry2t7c05ttdi.rcgu.o" "/home/normal/apps/nebulet/target/x86_64-nebulet/debug/deps/nebulet-9684cf7767550d56.2jqywn86b2gsqohu.rcgu.o" "/home/normal/apps/nebulet/target/x86_64-nebulet/debug/deps/nebulet-9684cf7767550d56.2lyh15q6cjwzy18c.rcgu.o" "/home/normal/apps/nebulet/target/x86_64-nebulet/debug/deps/nebulet-9684cf7767550d56.2oxoroz75ea5i5j6.rcgu.o" "/home/normal/apps/nebulet/target/x86_64-nebulet/debug/deps/nebulet-9684cf7767550d56.2p5w394q1c5t9zye.rcgu.o" "/home/normal/apps/nebulet/target/x86_64-nebulet/debug/deps/nebulet-9684cf7767550d56.2q5257pdh5222n7q.rcgu.o" "/home/normal/apps/nebulet/target/x86_64-nebulet/debug/deps/nebulet-9684cf7767550d56.2ql88ds4ewhlxkci.rcgu.o" "/home/normal/apps/nebulet/target/x86_64-nebulet/debug/deps/nebulet-9684cf7767550d56.2r82puffnvvb8iic.rcgu.o" "/home/normal/apps/nebulet/target/x86_64-nebulet/debug/deps/nebulet-9684cf7767550d56.2tgxoanktztadruv.rcgu.o" "/home/normal/apps/nebulet/target/x86_64-nebulet/debug/deps/nebulet-9684cf7767550d56.2zz5l0bves6yadte.rcgu.o" "/home/normal/apps/nebulet/target/x86_64-nebulet/debug/deps/nebulet-9684cf7767550d56.3185vegbux9csdi5.rcgu.o" "/home/normal/apps/nebulet/target/x86_64-nebulet/debug/deps/nebulet-9684cf7767550d56.31cspaezj4c3mplz.rcgu.o" "/home/normal/apps/nebulet/target/x86_64-nebulet/debug/deps/nebulet-9684cf7767550d56.31v1m3tnn2bw55oo.rcgu.o" "/home/normal/apps/nebulet/target/x86_64-nebulet/debug/deps/nebulet-9684cf7767550d56.340hcms0rqmw1pjh.rcgu.o" "/home/normal/apps/nebulet/target/x86_64-nebulet/debug/deps/nebulet-9684cf7767550d56.34ulnixfsydgmmzp.rcgu.o" "/home/normal/apps/nebulet/target/x86_64-nebulet/debug/deps/nebulet-9684cf7767550d56.34wi0n4ao33isgnu.rcgu.o" "/home/normal/apps/nebulet/target/x86_64-nebulet/debug/deps/nebulet-9684cf7767550d56.34wk0fzxglg7k3kn.rcgu.o" "/home/normal/apps/nebulet/target/x86_64-nebulet/debug/deps/nebulet-9684cf7767550d56.35l6nak5d4orf0g6.rcgu.o" "/home/normal/apps/nebulet/target/x86_64-nebulet/debug/deps/nebulet-9684cf7767550d56.38ps4pa181wsnsy9.rcgu.o" "/home/normal/apps/nebulet/target/x86_64-nebulet/debug/deps/nebulet-9684cf7767550d56.39ohoqewd0orqd88.rcgu.o" "/home/normal/apps/nebulet/target/x86_64-nebulet/debug/deps/nebulet-9684cf7767550d56.3ayaeypdcro9d6yk.rcgu.o" "/home/normal/apps/nebulet/target/x86_64-nebulet/debug/deps/nebulet-9684cf7767550d56.3douzeqvo0emriqb.rcgu.o" "/home/normal/apps/nebulet/target/x86_64-nebulet/debug/deps/nebulet-9684cf7767550d56.3e10jdqzq0u8y1jk.rcgu.o" "/home/normal/apps/nebulet/target/x86_64-nebulet/debug/deps/nebulet-9684cf7767550d56.3efm217pvnbgv3pa.rcgu.o" "/home/normal/apps/nebulet/target/x86_64-nebulet/debug/deps/nebulet-9684cf7767550d56.3gta6cp1hhtmjly7.rcgu.o" "/home/normal/apps/nebulet/target/x86_64-nebulet/debug/deps/nebulet-9684cf7767550d56.3hdgf1adi7bcs824.rcgu.o" "/home/normal/apps/nebulet/target/x86_64-nebulet/debug/deps/nebulet-9684cf7767550d56.3hkuhgvvdf28ph6c.rcgu.o" "/home/normal/apps/nebulet/target/x86_64-nebulet/debug/deps/nebulet-9684cf7767550d56.3ik0x0hz6l66cx38.rcgu.o" "/home/normal/apps/nebulet/target/x86_64-nebulet/debug/deps/nebulet-9684cf7767550d56.3ivlrygw5yffx2mh.rcgu.o" "/home/normal/apps/nebulet/target/x86_64-nebulet/debug/deps/nebulet-9684cf7767550d56.3l4oj5jwq8el9dy8.rcgu.o" "/home/normal/apps/nebulet/target/x86_64-nebulet/debug/deps/nebulet-9684cf7767550d56.3ldk0i2zxftngav8.rcgu.o" "/home/normal/apps/nebulet/target/x86_64-nebulet/debug/deps/nebulet-9684cf7767550d56.3m5s6hvogqi05qt4.rcgu.o" "/home/normal/apps/nebulet/target/x86_64-nebulet/debug/deps/nebulet-9684cf7767550d56.3mro0grqml7sx4gg.rcgu.o" "/home/normal/apps/nebulet/target/x86_64-nebulet/debug/deps/nebulet-9684cf7767550d56.3osd8b6d94y3uy5i.rcgu.o" "/home/normal/apps/nebulet/target/x86_64-nebulet/debug/deps/nebulet-9684cf7767550d56.3puvd5dvpysg0y8f.rcgu.o" "/home/normal/apps/nebulet/target/x86_64-nebulet/debug/deps/nebulet-9684cf7767550d56.3qvj6vh18ar1xt0.rcgu.o" "/home/normal/apps/nebulet/target/x86_64-nebulet/debug/deps/nebulet-9684cf7767550d56.3rf6843a8x33yrpk.rcgu.o" "/home/normal/apps/nebulet/target/x86_64-nebulet/debug/deps/nebulet-9684cf7767550d56.3ulhplwn4br7ee34.rcgu.o" "/home/normal/apps/nebulet/target/x86_64-nebulet/debug/deps/nebulet-9684cf7767550d56.3urlgffs5ir77gy9.rcgu.o" "/home/normal/apps/nebulet/target/x86_64-nebulet/debug/deps/nebulet-9684cf7767550d56.3wta9ctgdrpkmlpr.rcgu.o" "/home/normal/apps/nebulet/target/x86_64-nebulet/debug/deps/nebulet-9684cf7767550d56.3z12vymbt3bp90vx.rcgu.o" "/home/normal/apps/nebulet/target/x86_64-nebulet/debug/deps/nebulet-9684cf7767550d56.41z3ogmlk1j8c5so.rcgu.o" "/home/normal/apps/nebulet/target/x86_64-nebulet/debug/deps/nebulet-9684cf7767550d56.436dotimmrgzkwfa.rcgu.o" "/home/normal/apps/nebulet/target/x86_64-nebulet/debug/deps/nebulet-9684cf7767550d56.437q2ois6fu0jjbd.rcgu.o" "/home/normal/apps/nebulet/target/x86_64-nebulet/debug/deps/nebulet-9684cf7767550d56.43v6g0y2xsxoggnt.rcgu.o" "/home/normal/apps/nebulet/target/x86_64-nebulet/debug/deps/nebulet-9684cf7767550d56.45pc7c65foh9i35f.rcgu.o" "/home/normal/apps/nebulet/target/x86_64-nebulet/debug/deps/nebulet-9684cf7767550d56.45rnfv5hnvlqvkod.rcgu.o" "/home/normal/apps/nebulet/target/x86_64-nebulet/debug/deps/nebulet-9684cf7767550d56.45tr6gzo4pf6p27r.rcgu.o" "/home/normal/apps/nebulet/target/x86_64-nebulet/debug/deps/nebulet-9684cf7767550d56.47irkjj3hrb7b0qf.rcgu.o" "/home/normal/apps/nebulet/target/x86_64-nebulet/debug/deps/nebulet-9684cf7767550d56.482wodr6aeib8t4r.rcgu.o" "/home/normal/apps/nebulet/target/x86_64-nebulet/debug/deps/nebulet-9684cf7767550d56.49a7n47po4ttqjl7.rcgu.o" "/home/normal/apps/nebulet/target/x86_64-nebulet/debug/deps/nebulet-9684cf7767550d56.49lx1q7cxvpykyv0.rcgu.o" "/home/normal/apps/nebulet/target/x86_64-nebulet/debug/deps/nebulet-9684cf7767550d56.4a9v1cwpa02xqga4.rcgu.o" "/home/normal/apps/nebulet/target/x86_64-nebulet/debug/deps/nebulet-9684cf7767550d56.4brwxiorhmgsb6oc.rcgu.o" "/home/normal/apps/nebulet/target/x86_64-nebulet/debug/deps/nebulet-9684cf7767550d56.4bzt158envpr5sbe.rcgu.o" "/home/normal/apps/nebulet/target/x86_64-nebulet/debug/deps/nebulet-9684cf7767550d56.4ehv7l3k9cyz2hit.rcgu.o" "/home/normal/apps/nebulet/target/x86_64-nebulet/debug/deps/nebulet-9684cf7767550d56.4ezmh1vbs95c5ack.rcgu.o" "/home/normal/apps/nebulet/target/x86_64-nebulet/debug/deps/nebulet-9684cf7767550d56.4h3pcn07klvcj6tl.rcgu.o" "/home/normal/apps/nebulet/target/x86_64-nebulet/debug/deps/nebulet-9684cf7767550d56.4hqczukarqnsxim3.rcgu.o" "/home/normal/apps/nebulet/target/x86_64-nebulet/debug/deps/nebulet-9684cf7767550d56.4i9vl57w5sugyc4r.rcgu.o" "/home/normal/apps/nebulet/target/x86_64-nebulet/debug/deps/nebulet-9684cf7767550d56.4lpgqfqied29bp6i.rcgu.o" "/home/normal/apps/nebulet/target/x86_64-nebulet/debug/deps/nebulet-9684cf7767550d56.4mntdqdcddcdj9ei.rcgu.o" "/home/normal/apps/nebulet/target/x86_64-nebulet/debug/deps/nebulet-9684cf7767550d56.4ngdnh8cyjozg8d9.rcgu.o" "/home/normal/apps/nebulet/target/x86_64-nebulet/debug/deps/nebulet-9684cf7767550d56.4njvpzrazlkok9uf.rcgu.o" "/home/normal/apps/nebulet/target/x86_64-nebulet/debug/deps/nebulet-9684cf7767550d56.4pbypfl7ppj4sspf.rcgu.o" "/home/normal/apps/nebulet/target/x86_64-nebulet/debug/deps/nebulet-9684cf7767550d56.4ucffhmhmn2isvxl.rcgu.o" "/home/normal/apps/nebulet/target/x86_64-nebulet/debug/deps/nebulet-9684cf7767550d56.4uqhar8cd2x2vc5h.rcgu.o" "/home/normal/apps/nebulet/target/x86_64-nebulet/debug/deps/nebulet-9684cf7767550d56.4vxzyes09r1znfq9.rcgu.o" "/home/normal/apps/nebulet/target/x86_64-nebulet/debug/deps/nebulet-9684cf7767550d56.4xq48u46a1pwiqn7.rcgu.o" "/home/normal/apps/nebulet/target/x86_64-nebulet/debug/deps/nebulet-9684cf7767550d56.4yh8x2b62dcih00t.rcgu.o" "/home/normal/apps/nebulet/target/x86_64-nebulet/debug/deps/nebulet-9684cf7767550d56.4ypvbwho0bu5tnww.rcgu.o" "/home/normal/apps/nebulet/target/x86_64-nebulet/debug/deps/nebulet-9684cf7767550d56.4z48g7rt4pu2zc91.rcgu.o" "/home/normal/apps/nebulet/target/x86_64-nebulet/debug/deps/nebulet-9684cf7767550d56.50afhtnctzmbrhlt.rcgu.o" "/home/normal/apps/nebulet/target/x86_64-nebulet/debug/deps/nebulet-9684cf7767550d56.50yvfm5lascvjb64.rcgu.o" "/home/normal/apps/nebulet/target/x86_64-nebulet/debug/deps/nebulet-9684cf7767550d56.522979y8adaojfct.rcgu.o" "/home/normal/apps/nebulet/target/x86_64-nebulet/debug/deps/nebulet-9684cf7767550d56.54cdjyzwqjcvw2v2.rcgu.o" "/home/normal/apps/nebulet/target/x86_64-nebulet/debug/deps/nebulet-9684cf7767550d56.55w79tn9gj2q976e.rcgu.o" "/home/normal/apps/nebulet/target/x86_64-nebulet/debug/deps/nebulet-9684cf7767550d56.56dly8q07ws8ucdq.rcgu.o" "/home/normal/apps/nebulet/target/x86_64-nebulet/debug/deps/nebulet-9684cf7767550d56.57k06xfugllsc526.rcgu.o" "/home/normal/apps/nebulet/target/x86_64-nebulet/debug/deps/nebulet-9684cf7767550d56.5adou0qr7tvip7aw.rcgu.o" "/home/normal/apps/nebulet/target/x86_64-nebulet/debug/deps/nebulet-9684cf7767550d56.5cbeguylg7fto6d6.rcgu.o" "/home/normal/apps/nebulet/target/x86_64-nebulet/debug/deps/nebulet-9684cf7767550d56.5chdyztotv2tnagk.rcgu.o" "/home/normal/apps/nebulet/target/x86_64-nebulet/debug/deps/nebulet-9684cf7767550d56.5dnuqklgos769xed.rcgu.o" "/home/normal/apps/nebulet/target/x86_64-nebulet/debug/deps/nebulet-9684cf7767550d56.5ekol49tsc5zk4jg.rcgu.o" "/home/normal/apps/nebulet/target/x86_64-nebulet/debug/deps/nebulet-9684cf7767550d56.7sudkzalsfwk3ws.rcgu.o" "/home/normal/apps/nebulet/target/x86_64-nebulet/debug/deps/nebulet-9684cf7767550d56.81jpvh8cn5k8ng8.rcgu.o" "/home/normal/apps/nebulet/target/x86_64-nebulet/debug/deps/nebulet-9684cf7767550d56.8xzrsc1ux72v29j.rcgu.o" "/home/normal/apps/nebulet/target/x86_64-nebulet/debug/deps/nebulet-9684cf7767550d56.98g0d9x8aw3akpe.rcgu.o" "/home/normal/apps/nebulet/target/x86_64-nebulet/debug/deps/nebulet-9684cf7767550d56.9elsx31vb4it187.rcgu.o" "/home/normal/apps/nebulet/target/x86_64-nebulet/debug/deps/nebulet-9684cf7767550d56.9fcb3syd3ne5k0n.rcgu.o" "/home/normal/apps/nebulet/target/x86_64-nebulet/debug/deps/nebulet-9684cf7767550d56.9jcpbqi1g4xyc.rcgu.o" "/home/normal/apps/nebulet/target/x86_64-nebulet/debug/deps/nebulet-9684cf7767550d56.c6lbtaiefvx3wya.rcgu.o" "/home/normal/apps/nebulet/target/x86_64-nebulet/debug/deps/nebulet-9684cf7767550d56.cxgx6dqdh5t86u1.rcgu.o" "/home/normal/apps/nebulet/target/x86_64-nebulet/debug/deps/nebulet-9684cf7767550d56.died1222q2hh16i.rcgu.o" "/home/normal/apps/nebulet/target/x86_64-nebulet/debug/deps/nebulet-9684cf7767550d56.ffb69a33zy7jlyh.rcgu.o" "/home/normal/apps/nebulet/target/x86_64-nebulet/debug/deps/nebulet-9684cf7767550d56.fw6p28qkawtd7r1.rcgu.o" "/home/normal/apps/nebulet/target/x86_64-nebulet/debug/deps/nebulet-9684cf7767550d56.k5ami1mlhxwg16p.rcgu.o" "/home/normal/apps/nebulet/target/x86_64-nebulet/debug/deps/nebulet-9684cf7767550d56.mq3owelce3bjn25.rcgu.o" "/home/normal/apps/nebulet/target/x86_64-nebulet/debug/deps/nebulet-9684cf7767550d56.pyf16arlcwytwqj.rcgu.o" "/home/normal/apps/nebulet/target/x86_64-nebulet/debug/deps/nebulet-9684cf7767550d56.rsvoby459qk2sr8.rcgu.o" "/home/normal/apps/nebulet/target/x86_64-nebulet/debug/deps/nebulet-9684cf7767550d56.sky8hy77cprlqr7.rcgu.o" "/home/normal/apps/nebulet/target/x86_64-nebulet/debug/deps/nebulet-9684cf7767550d56.y08g5q2x813c4wx.rcgu.o" "/home/normal/apps/nebulet/target/x86_64-nebulet/debug/deps/nebulet-9684cf7767550d56.yici1h8hz4z7ap5.rcgu.o" "/home/normal/apps/nebulet/target/x86_64-nebulet/debug/deps/nebulet-9684cf7767550d56.z9ox7biyn1otfln.rcgu.o" "-o" "/home/normal/apps/nebulet/target/x86_64-nebulet/debug/deps/nebulet-9684cf7767550d56" "/home/normal/apps/nebulet/target/x86_64-nebulet/debug/deps/nebulet-9684cf7767550d56.crate.allocator.rcgu.o" "--gc-sections" "-L" "/home/normal/apps/nebulet/target/x86_64-nebulet/debug/deps" "-L" "/home/normal/apps/nebulet/target/debug/deps" "-L" "/home/normal/apps/nebulet/target/x86_64-nebulet/debug/build/raw-cpuid-08470260f755d24e/out" "-L" "/home/normal/.xargo/lib/rustlib/x86_64-nebulet/lib" "-Bstatic" "/home/normal/apps/nebulet/target/x86_64-nebulet/debug/deps/libcton_native-c16c158642769f2d.rlib" "/home/normal/apps/nebulet/target/x86_64-nebulet/debug/deps/libraw_cpuid-5b06b940a632ac62.rlib" "/home/normal/apps/nebulet/target/x86_64-nebulet/debug/deps/libbitflags-87a14bdd20c808c8.rlib" "/home/normal/apps/nebulet/target/x86_64-nebulet/debug/deps/libcton_wasm-c4886a6146cdd1f3.rlib" "/home/normal/apps/nebulet/target/x86_64-nebulet/debug/deps/libcton_frontend-dc9ae2c9227e892a.rlib" "/home/normal/apps/nebulet/target/x86_64-nebulet/debug/deps/libcretonne-5ecbde32b0fe8966.rlib" "/home/normal/apps/nebulet/target/x86_64-nebulet/debug/deps/libfailure-f0cf6a2a449941c1.rlib" "/home/normal/apps/nebulet/target/x86_64-nebulet/debug/deps/libwasmparser-a792df467adf7729.rlib" "/home/normal/apps/nebulet/target/x86_64-nebulet/debug/deps/libnabi-df996a71dd197c7c.rlib" "/home/normal/apps/nebulet/target/x86_64-nebulet/debug/deps/libhashmap_core-f3bb1fe18ade5e6e.rlib" "/home/normal/.xargo/lib/rustlib/x86_64-nebulet/lib/liballoc-ba08b25afee5cc7e.rlib" "/home/normal/apps/nebulet/target/x86_64-nebulet/debug/deps/librlibc-39b199af1345dcbf.rlib" "/home/normal/apps/nebulet/target/x86_64-nebulet/debug/deps/libx86_64-e65fc547a5061dcd.rlib" "/home/normal/apps/nebulet/target/x86_64-nebulet/debug/deps/libux-4f9321af464fe275.rlib" "/home/normal/apps/nebulet/target/x86_64-nebulet/debug/deps/libusize_conversions-0913c6d3264d6353.rlib" "/home/normal/apps/nebulet/target/x86_64-nebulet/debug/deps/libbit_field-05990547aec5ebd3.rlib" "/home/normal/apps/nebulet/target/x86_64-nebulet/debug/deps/libos_bootinfo-5716a621af57f297.rlib" "/home/normal/apps/nebulet/target/x86_64-nebulet/debug/deps/libbitflags-865193ef743bb3fb.rlib" "/home/normal/apps/nebulet/target/x86_64-nebulet/debug/deps/liblazy_static-9d83f9fd0f7d3e26.rlib" "/home/normal/apps/nebulet/target/x86_64-nebulet/debug/deps/libspin-23abbef1be7c2d3b.rlib" "/home/normal/.xargo/lib/rustlib/x86_64-nebulet/lib/libcore-989008e101bbd9de.rlib" "/home/normal/.xargo/lib/rustlib/x86_64-nebulet/lib/libcompiler_builtins-8e6d24cba76d9299.rlib" "-Bdynamic"
  = note: lld: error: zlib is not available
          

error: aborting due to previous error

error: Could not compile `nebulet`.

To learn more, run the command again with --verbose.

@lachlansneff
Copy link
Contributor

That's really strange. Could it be isolated to Rrch Linux? I'm personally running Ubuntu in WSL.

@gmorenz
Copy link
Contributor Author

gmorenz commented Apr 15, 2018

I doubt it's isolated to specfically arch linux just because arch tries to change so little from upstream packages. But I could easily imagine it's isolated to my system or non-debian-derivatives or some other category.

Basically I think the problem is that rust's lld is built without zlib support, and something (compressing debug info?) needs it for some reason. The only source for the string "zlib is not available" that I can find is here (edit: Also here). The isAvailable function is defined as true/false at compile time here.

Supporting this is that by checking by strace it's definitely not failing to find zlib.

I'll spend a bit of time later today and see if I can figure out how to make lld not try and use zlib, but I think there is a good chance that the best solution (i.e. not doing something like disabling debug info) is going to be to use the systems lld.

@lachlansneff
Copy link
Contributor

Using rust's lld works just fine on my system. (@phil-opp Can you confirm?)

I'll switch it back to the system allocator for now.

@phil-opp
Copy link

Using the current master branch and rustc's lld ("linker-flavor": "ld.lld") I get the following result for bootimage run:

image

The keyboard interrupt occured when I pressed the escape key.

@gmorenz
Copy link
Contributor Author

gmorenz commented May 26, 2018

Just an update that I still experience the zlib issue (error message: = note: lld: error: zlib is not available).

For anyone else who experiences this issue. The workaround is cp x86_64-nebulet-sys.json x86_64-nebulet.json.

@gmorenz gmorenz changed the title Trying to build - undefined reference to memcpy Trying to build - zlib is not available May 26, 2018
@lachlansneff
Copy link
Contributor

Hmm, there's no file called x86_64-nebulet-sys.json in this repository.

@gmorenz
Copy link
Contributor Author

gmorenz commented May 26, 2018

Oops, that's a local file I made the first time around I guess... here is a copy of it for anyone who needs it:

{
    "llvm-target": "x86_64-unknown-none",
    "data-layout": "e-m:e-i64:64-f80:128-n8:16:32:64-S128",
    "arch": "x86_64",
    "target-endian": "little",
    "target-pointer-width": "64",
    "target-c-int-width": "32",
    "os": "nebulet",
    "executables": true,
    "linker-flavor": "ld",
    "linker": "ld.lld",
    "panic-strategy": "abort",
    "disable-redzone": true,
    "features": "-mmx,-sse,+soft-float"
}

@lachlansneff
Copy link
Contributor

I'm kind of surprised that works, since cretonne checks the os field of the config for picking a isa to compile wasm with.

@gmorenz
Copy link
Contributor Author

gmorenz commented May 26, 2018

Interesting... changing the os to nebulet (making the diff only changing linker-flavor and adding linker) still works, so I updated the above file to that.

@protono
Copy link

protono commented May 30, 2018

Using Manjaro linux I also need to edit x86_64-nebulet.json and change "linker-flavor": "ld.lld", into "linker-flavor": "ld",.

image

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants