I'm trying to follow this guide as my entry into Solana blockchain development. I'm running into an error when I run the command $anchor build
For context, I'm running wsl. I'm not concerned about the warning, but any help would be much appreciated!
Here are the contents of the error:
error: linking with `ld` failed: exit status: 1
|
= note: "ld" "--version-script=/tmp/rustc7rlvlq/list" "--Bdynamic" "--entry=entrypoint" "--threads=1" "-z" "notext" "/home/tai8910/Code/solana-twitter/target/bpfel-unknown-unknown/release/deps/solana_twitter.solana_twitter.667be1f5-cgu.0.rcgu.o" "/home/tai8910/Code/solana-twitter/target/bpfel-unknown-unknown/release/deps/solana_twitter.solana_twitter.667be1f5-cgu.1.rcgu.o" "/home/tai8910/Code/solana-twitter/target/bpfel-unknown-unknown/release/deps/solana_twitter.solana_twitter.667be1f5-cgu.10.rcgu.o" "/home/tai8910/Code/solana-twitter/target/bpfel-unknown-unknown/release/deps/solana_twitter.solana_twitter.667be1f5-cgu.11.rcgu.o" "/home/tai8910/Code/solana-twitter/target/bpfel-unknown-unknown/release/deps/solana_twitter.solana_twitter.667be1f5-cgu.12.rcgu.o" "/home/tai8910/Code/solana-twitter/target/bpfel-unknown-unknown/release/deps/solana_twitter.solana_twitter.667be1f5-cgu.13.rcgu.o" "/home/tai8910/Code/solana-twitter/target/bpfel-unknown-unknown/release/deps/solana_twitter.solana_twitter.667be1f5-cgu.14.rcgu.o" "/home/tai8910/Code/solana-twitter/target/bpfel-unknown-unknown/release/deps/solana_twitter.solana_twitter.667be1f5-cgu.15.rcgu.o" "/home/tai8910/Code/solana-twitter/target/bpfel-unknown-unknown/release/deps/solana_twitter.solana_twitter.667be1f5-cgu.2.rcgu.o" "/home/tai8910/Code/solana-twitter/target/bpfel-unknown-unknown/release/deps/solana_twitter.solana_twitter.667be1f5-cgu.3.rcgu.o" "/home/tai8910/Code/solana-twitter/target/bpfel-unknown-unknown/release/deps/solana_twitter.solana_twitter.667be1f5-cgu.4.rcgu.o" "/home/tai8910/Code/solana-twitter/target/bpfel-unknown-unknown/release/deps/solana_twitter.solana_twitter.667be1f5-cgu.5.rcgu.o" "/home/tai8910/Code/solana-twitter/target/bpfel-unknown-unknown/release/deps/solana_twitter.solana_twitter.667be1f5-cgu.6.rcgu.o" "/home/tai8910/Code/solana-twitter/target/bpfel-unknown-unknown/release/deps/solana_twitter.solana_twitter.667be1f5-cgu.7.rcgu.o" "/home/tai8910/Code/solana-twitter/target/bpfel-unknown-unknown/release/deps/solana_twitter.solana_twitter.667be1f5-cgu.8.rcgu.o" "/home/tai8910/Code/solana-twitter/target/bpfel-unknown-unknown/release/deps/solana_twitter.solana_twitter.667be1f5-cgu.9.rcgu.o" "/home/tai8910/Code/solana-twitter/target/bpfel-unknown-unknown/release/deps/solana_twitter.23ok8bvhjt9fifog.rcgu.o" "--as-needed" "-L" "/home/tai8910/Code/solana-twitter/target/bpfel-unknown-unknown/release/deps" "-L" "/home/tai8910/Code/solana-twitter/target/release/deps" "-L" "/home/tai8910/.cache/solana/v1.20/bpf-tools/rust/lib/rustlib/bpfel-unknown-unknown/lib" "-Bstatic" "/home/tai8910/Code/solana-twitter/target/bpfel-unknown-unknown/release/deps/libanchor_lang-369f9fcce7f9778b.rlib" "/home/tai8910/Code/solana-twitter/target/bpfel-unknown-unknown/release/deps/libbase64-ee92f11b5395c52e.rlib" "/home/tai8910/Code/solana-twitter/target/bpfel-unknown-unknown/release/deps/libsolana_program-9fe9cc99ff752644.rlib" "/home/tai8910/Code/solana-twitter/target/bpfel-unknown-unknown/release/deps/libserde_bytes-5207c42260a7c267.rlib" "/home/tai8910/Code/solana-twitter/target/bpfel-unknown-unknown/release/deps/libhex-6cd04f1b9c696e32.rlib" "/home/tai8910/Code/solana-twitter/target/bpfel-unknown-unknown/release/deps/libsolana_frozen_abi-f9c2f8b8a627f8aa.rlib" "/home/tai8910/Code/solana-twitter/target/bpfel-unknown-unknown/release/deps/libbs58-fe01222278a2eda8.rlib" "/home/tai8910/Code/solana-twitter/target/bpfel-unknown-unknown/release/deps/libbv-c7c0e796134886cb.rlib" "/home/tai8910/Code/solana-twitter/target/bpfel-unknown-unknown/release/deps/liblazy_static-809b40aac429888e.rlib" "/home/tai8910/Code/solana-twitter/target/bpfel-unknown-unknown/release/deps/libitertools-c458dae8c4611cd8.rlib" "/home/tai8910/Code/solana-twitter/target/bpfel-unknown-unknown/release/deps/libeither-6eeb62e68a9b8e57.rlib" "/home/tai8910/Code/solana-twitter/target/bpfel-unknown-unknown/release/deps/libsha3-24b5c86da1eb0453.rlib" "/home/tai8910/Code/solana-twitter/target/bpfel-unknown-unknown/release/deps/libkeccak-ac25e9c6d97c1dff.rlib" "/home/tai8910/Code/solana-twitter/target/bpfel-unknown-unknown/release/deps/libthiserror-90c773aba6f68987.rlib" "/home/tai8910/Code/solana-twitter/target/bpfel-unknown-unknown/release/deps/libsha2-48f21f103c901542.rlib" "/home/tai8910/Code/solana-twitter/target/bpfel-unknown-unknown/release/deps/libopaque_debug-7a932b68d3299c7b.rlib" "/home/tai8910/Code/solana-twitter/target/bpfel-unknown-unknown/release/deps/libdigest-6389a1260a04b96b.rlib" "/home/tai8910/Code/solana-twitter/target/bpfel-unknown-unknown/release/deps/libblock_buffer-a630a7b4c9084931.rlib" "/home/tai8910/Code/solana-twitter/target/bpfel-unknown-unknown/release/deps/libblock_padding-1a56ee8f16ee908c.rlib" "/home/tai8910/Code/solana-twitter/target/bpfel-unknown-unknown/release/deps/libgeneric_array-d7158a87da87264b.rlib" "/home/tai8910/Code/solana-twitter/target/bpfel-unknown-unknown/release/deps/libtypenum-ef879e2476d2db6d.rlib" "/home/tai8910/Code/solana-twitter/target/bpfel-unknown-unknown/release/deps/liblog-cc2d231fbaac5454.rlib" "/home/tai8910/Code/solana-twitter/target/bpfel-unknown-unknown/release/deps/libcfg_if-1643e4a2c6efb510.rlib" "/home/tai8910/Code/solana-twitter/target/bpfel-unknown-unknown/release/deps/libnum_traits-67afc00ec41f572f.rlib" "/home/tai8910/Code/solana-twitter/target/bpfel-unknown-unknown/release/deps/libbincode-daf7bb0fce4a700c.rlib"
"/home/tai8910/Code/solana-twitter/target/bpfel-unknown-unknown/release/deps/libserde-e445d83f85708c13.rlib" "/home/tai8910/Code/solana-twitter/target/bpfel-unknown-unknown/release/deps/libborsh-701da45de74b9763.rlib" "/home/tai8910/Code/solana-twitter/target/bpfel-unknown-unknown/release/deps/libbytemuck-eaed85aa73d5dfbc.rlib" "--start-group" "/home/tai8910/.cache/solana/v1.20/bpf-tools/rust/lib/rustlib/bpfel-unknown-unknown/lib/libstd-b9e47931bb048ddd.rlib" "/home/tai8910/.cache/solana/v1.20/bpf-tools/rust/lib/rustlib/bpfel-unknown-unknown/lib/libpanic_abort-cee38af281743742.rlib" "/home/tai8910/.cache/solana/v1.20/bpf-tools/rust/lib/rustlib/bpfel-unknown-unknown/lib/libstd_detect-4bf956fa4dfc36ef.rlib" "/home/tai8910/.cache/solana/v1.20/bpf-tools/rust/lib/rustlib/bpfel-unknown-unknown/lib/libhashbrown-419e08fa951207df.rlib" "/home/tai8910/.cache/solana/v1.20/bpf-tools/rust/lib/rustlib/bpfel-unknown-unknown/lib/librustc_std_workspace_alloc-f389bcb5a4dc00c1.rlib" "/home/tai8910/.cache/solana/v1.20/bpf-tools/rust/lib/rustlib/bpfel-unknown-unknown/lib/libunwind-9d2b664eda1e59bf.rlib" "/home/tai8910/.cache/solana/v1.20/bpf-tools/rust/lib/rustlib/bpfel-unknown-unknown/lib/libcfg_if-0df5cdc1ad3f0480.rlib" "/home/tai8910/.cache/solana/v1.20/bpf-tools/rust/lib/rustlib/bpfel-unknown-unknown/lib/liblibc-1d523315f98b1675.rlib" "/home/tai8910/.cache/solana/v1.20/bpf-tools/rust/lib/rustlib/bpfel-unknown-unknown/lib/liballoc-38dcdcf486775e23.rlib" "/home/tai8910/.cache/solana/v1.20/bpf-tools/rust/lib/rustlib/bpfel-unknown-unknown/lib/librustc_std_workspace_core-8201043866f2d4dd.rlib" "/home/tai8910/.cache/solana/v1.20/bpf-tools/rust/lib/rustlib/bpfel-unknown-unknown/lib/libcore-a4fd67b7f3cf9226.rlib" "--end-group" "/home/tai8910/.cache/solana/v1.20/bpf-tools/rust/lib/rustlib/bpfel-unknown-unknown/lib/libcompiler_builtins-fcfbbdc9d2a94cb9.rlib" "-Bdynamic" "--script" "/tmp/rustc7rlvlq/rustc-bpfel-linkfile.ld" "-znoexecstack" "-L" "/home/tai8910/.cache/solana/v1.20/bpf-tools/rust/lib/rustlib/bpfel-unknown-unknown/lib" "-o" "/home/tai8910/Code/solana-twitter/target/bpfel-unknown-unknown/release/deps/solana_twitter.so" "--gc-sections" "-shared" "-O1"
= note: ld: unrecognized option '--threads=1'
ld: use the --help option for usage information
warning: `solana-twitter` (lib) generated 1 warning
error: could not compile `solana-twitter` due to previous error; 1 warning emitted
It looks like the build is not using the correct linker that's part of the BPF tool suite, probably using the default ld instead.
Can you make sure that ~/.local/share/solana/install/active_release/bin is part of your PATH? After that, try simply running cargo build-bpf to make sure that the program can build without Anchor. If it's still failing, you may need to reinstall the Solana tools.
Related
I'm currently trying to set up an environment for Yocto project for my personal study.
I was clueless about where to start Yocto so I bought the book Embedded Linux Projects Using Yocto Project Cookbook but it keeps failing to build the environment.
I've run only simple commands. I ran source oe-init-build-env <dir name> to make a directory and ran bitbake core-image-minimal.
But bitbake command keeps giving me errors like this. This is the log.
WARNING: Host distribution "Ubuntu-18.04" has not been validated with this version of the build system; you may possibly experience unexpected failures. It is recommended that you use a tested distribution.
Parsing recipes: 100%
|#################################################################################| Time: 00:00:25Parsing of 891 .bb files complete (0 cached, 891 parsed). 1287 targets, 61 skipped, 0 masked, 0 errors.
NOTE: Resolving any missing task queue dependencies
Build Configuration:
BB_VERSION = "1.24.0"
BUILD_SYS = "x86_64-linux"
NATIVELSBSTRING = "Ubuntu-18.04"
TARGET_SYS = "arm-poky-linux-gnueabi"
MACHINE = "qemuarm"
DISTRO = "poky"
DISTRO_VERSION = "1.7.3"
TUNE_FEATURES = "arm armv5 thumb dsp"
TARGET_FPU = "soft"
meta
meta-yocto
meta-yocto-bsp = "dizzy:58863ad092c9a279e305c841dbb4353de2ecfae8"
NOTE: Preparing runqueue
NOTE: Executing SetScene Tasks
NOTE: Executing RunQueue Tasks
WARNING: Failed to fetch URL http://www.zlib.net/zlib-1.2.8.tar.xz, attempting MIRRORS if available
WARNING: Failed to fetch URL http://www.multiprecision.org/mpc/download/mpc-1.0.2.tar.gz, attempting MIRRORS if available
WARNING: Failed to fetch URL ftp://ftp.gmplib.org/pub/gmp-6.0.0/gmp-6.0.0a.tar.bz2, attempting MIRRORS if available
WARNING: Failed to fetch URL http://ymorin.is-a-geek.org/download/kconfig-frontends/kconfig-frontends-3.12.0.0.tar.xz, attempting MIRRORS if available
WARNING: Failed to fetch URL http://download.gna.org/cryptodev-linux/cryptodev-linux-1.6.tar.gz, attempting MIRRORS if available
WARNING: Checksum failure encountered with download of http://www.bzip.org/1.0.6/bzip2-1.0.6.tar.gz - will attempt other sources if available
WARNING: Renaming /opt/yocto/poky/qemuarm/downloads/bzip2-1.0.6.tar.gz to /opt/yocto/poky/qemuarm/downloads/bzip2-1.0.6.tar.gz_bad-checksum_2ae3e6c958d83d2855a37f13fe29fd95
WARNING: Failed to fetch URL http://gnome-build-stage-1.googlecode.com/files/uuid-1.6.2.tar.gz, attempting MIRRORS if available
WARNING: Checksum failure encountered with download of http://rpm5.org/files/popt/popt-1.16.tar.gz - will attempt other sources if available
WARNING: Renaming /opt/yocto/poky/qemuarm/downloads/popt-1.16.tar.gz to /opt/yocto/poky/qemuarm/downloads/popt-1.16.tar.gz_bad-checksum_9e09d0bf772649c5ba385c48ba2d3547
WARNING: Failed to fetch URL http://zlib.net/pigz/pigz-2.3.1.tar.gz, attempting MIRRORS if available
WARNING: Checksum failure encountered with download of http://www.rpm5.org/files/rpm/rpm-5.4/rpm-5.4.14-0.20131024.src.rpm;extract=rpm-5.4.14.tar.gz - will attempt other sources if available
WARNING: Renaming /opt/yocto/poky/qemuarm/downloads/rpm-5.4.14-0.20131024.src.rpm to /opt/yocto/poky/qemuarm/downloads/rpm-5.4.14-0.20131024.src.rpm_bad-checksum_6a8d9bc6a7e0162d7ff72fefc9e841e5
WARNING: Failed to fetch URL http://downloads.sourceforge.net/expat/expat-2.1.0.tar.gz, attempting MIRRORS if available
WARNING: Failed to fetch URL ftp://invisible-island.net/byacc/byacc-20140422.tgz, attempting MIRRORS if available
WARNING: Failed to fetch URL http://pkg-shadow.alioth.debian.org/releases/shadow-4.2.1.tar.xz, attempting MIRRORS if available
I checked the URLs in the log and it turned out they are all 404 pages. And most importantly, it terminates by showing this message.
ERROR: Error executing a python function in /opt/yocto/poky/meta/recipes-devtools/gcc/gcc-source_4.9.bb:
The stack trace of python calls that resulted in this exception/failure was:
File: 'do_preconfigure', lineno: 12, function: <module>
0008: cmd = d.expand("sed -i 's/BUILD_INFO=info/BUILD_INFO=/' /opt/yocto/poky/qemuarm/tmp/work-shared/gcc-4.9.1-r0/gcc-4.9.1/gcc/configure")
0009: subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=True)
0010:
0011:
*** 0012:do_preconfigure(d)
0013:
File: 'do_preconfigure', lineno: 5, function: do_preconfigure
0001:
0002:def do_preconfigure(d):
0003: import subprocess
0004: cmd = d.expand('PATH=/opt/yocto/poky/scripts:/opt/yocto/poky/qemuarm/tmp/sysroots/x86_64-linux/usr/bin/arm-poky-linux-gnueabi:/opt/yocto/poky/qemuarm/tmp/sysroots/qemuarm/usr/bin/crossscripts:/opt/yocto/poky/qemuarm/tmp/sysroots/x86_64-linux/usr/sbin:/opt/yocto/poky/qemuarm/tmp/sysroots/x86_64-linux/usr/bin:/opt/yocto/poky/qemuarm/tmp/sysroots/x86_64-linux/sbin:/opt/yocto/poky/qemuarm/tmp/sysroots/x86_64-linux/bin:/opt/yocto/poky/scripts:/opt/yocto/poky/bitbake/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/mnt/c/Program Files/WindowsApps/CanonicalGroupLimited.Ubuntu18.04onWindows_1804.2020.824.0_x64__79rhkp1fndgsc:/mnt/c/WINDOWS/system32:/mnt/c/WINDOWS:/mnt/c/WINDOWS/System32/Wbem:/mnt/c/WINDOWS/System32/WindowsPowerShell/v1.0/:/mnt/c/WINDOWS/System32/OpenSSH/:/mnt/c/Users/kimth/AppData/Local/Microsoft/WindowsApps:/mnt/c/Users/kimth/AppData/Local/Programs/MiKTeX 2.9/miktex/bin/x64/:/mnt/c/Users/kimth/AppData/Roaming/TinyTeX/bin/win32:/snap/bin cd /opt/yocto/poky/qemuarm/tmp/work-shared/gcc-4.9.1-r0/gcc-4.9.1 && gnu-configize')
*** 0005: subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=True)
0006: # See 0044-gengtypes.patch, we need to regenerate this file
0007: bb.utils.remove(d.expand("/opt/yocto/poky/qemuarm/tmp/work-shared/gcc-4.9.1-r0/gcc-4.9.1/gcc/gengtype-lex.c"))
0008: cmd = d.expand("sed -i 's/BUILD_INFO=info/BUILD_INFO=/' /opt/yocto/poky/qemuarm/tmp/work-shared/gcc-4.9.1-r0/gcc-4.9.1/gcc/configure")
0009: subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=True)
File: '/usr/lib/python2.7/subprocess.py', lineno: 223, function: check_output
0219: if retcode:
0220: cmd = kwargs.get("args")
0221: if cmd is None:
0222: cmd = popenargs[0]
*** 0223: raise CalledProcessError(retcode, cmd, output=output)
0224: return output
0225:
0226:
0227:def list2cmdline(seq):
Exception: CalledProcessError: Command 'PATH=/opt/yocto/poky/scripts:/opt/yocto/poky/qemuarm/tmp/sysroots/x86_64-linux/usr/bin/arm-poky-linux-gnueabi:/opt/yocto/poky/qemuarm/tmp/sysroots/qemuarm/usr/bin/crossscripts:/opt/yocto/poky/qemuarm/tmp/sysroots/x86_64-linux/usr/sbin:/opt/yocto/poky/qemuarm/tmp/sysroots/x86_64-linux/usr/bin:/opt/yocto/poky/qemuarm/tmp/sysroots/x86_64-linux/sbin:/opt/yocto/poky/qemuarm/tmp/sysroots/x86_64-linux/bin:/opt/yocto/poky/scripts:/opt/yocto/poky/bitbake/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/mnt/c/Program Files/WindowsApps/CanonicalGroupLimited.Ubuntu18.04onWindows_1804.2020.824.0_x64__79rhkp1fndgsc:/mnt/c/WINDOWS/system32:/mnt/c/WINDOWS:/mnt/c/WINDOWS/System32/Wbem:/mnt/c/WINDOWS/System32/WindowsPowerShell/v1.0/:/mnt/c/WINDOWS/System32/OpenSSH/:/mnt/c/Users/kimth/AppData/Local/Microsoft/WindowsApps:/mnt/c/Users/kimth/AppData/Local/Programs/MiKTeX 2.9/miktex/bin/x64/:/mnt/c/Users/kimth/AppData/Roaming/TinyTeX/bin/win32:/snap/bin cd /opt/yocto/poky/qemuarm
I feel like I need to modify conf files to fetch available URLs but I'm new to Yocto and Bitbake so I'm very lost now. I would appreciate if anyone could tell me where to find solutions. Thank you and stay safe everyone.
You seem to use quite an old yocto version 1.7.3 while there is already 3.3 released. This means also you try to build recipes for some packages that are also old and hence some URLs might be unavailable. Might it be an option for you to use a newer version?
If this is no option for you, one thing to try would be setting MIRROR (see [1]) to a mirror [2] where those packages are still available. But this approach I would not prefer.
[1] https://www.yoctoproject.org/docs/1.7/bitbake-user-manual/bitbake-user-manual.html#var-MIRRORS
[2] could be: http://downloads.yoctoproject.org/mirror/sources/
1.7.3 is a very old release of the project, originally released in 2015 with a last point release in 2016. The fetcher warnings you see aren't the problem, they're warnings but it will fall back to the project mirrors. If it hadn't fallen back correctly, it would have shown errors as well as the warnings. The bigger problem is in fact this:
WARNING: Host distribution "Ubuntu-18.04" has not been validated with this version of the build system; you may possibly experience unexpected failures. It is recommended that you use a tested distribution.
Since Ubuntu 18.04 is three years newer than the project release you're using, there is no way it would be compatible with that release. You need to use a host OS from the era of the release, so Ubuntu 16.04 may work better. This is because the host OS provides gcc used to build the cross tools and the newer gcc versions don't tend to work with 100% of old code without tweaks.
So in short, use an older distro if you want to try and get that to build.
I am able to follow the directions on the dpdk docs for windows.
http://doc.dpdk.org/guides/windows_gsg/build_dpdk.html
I am able to run meson build and ninja -C build and everything seems to work. The problem is whenever I run with the flag -Dexamples=helloworld, or any example for that matter, I get the following failure after running ninja -C build
FAILED: examples/dpdk-helloworld.exe
"clang" -Wl,/MACHINE:X64 -Wl,/OUT:examples/dpdk-helloworld.exe examples/dpdk-helloworld.exe.p/helloworld_main.c.obj "-Wl,/nologo" "-Wl,/release" "-Wl,/nologo" "-Wl,/OPT:REF" "-Wl,/WHOLEARCHIVE:lib\librte_hash.a" "-Wl,/WHOLEARCHIVE:lib\librte_cmdline.a" "-Wl,/WHOLEARCHIVE:lib\librte_pci.a" "-Wl,/WHOLEARCHIVE:lib\librte_ethdev.a" "-Wl,/WHOLEARCHIVE:lib\librte_meter.a" "-Wl,/WHOLEARCHIVE:lib\librte_net.a" "-Wl,/WHOLEARCHIVE:lib\librte_mbuf.a" "-Wl,/WHOLEARCHIVE:lib\librte_mempool.a" "-Wl,/WHOLEARCHIVE:lib\librte_rcu.a" "-Wl,/WHOLEARCHIVE:lib\librte_ring.a" "-Wl,/WHOLEARCHIVE:lib\librte_eal.a" "-Wl,/WHOLEARCHIVE:lib\librte_telemetry.a" "-Wl,/WHOLEARCHIVE:lib\librte_kvargs.a" "-Wl,/WHOLEARCHIVE:drivers\librte_bus_pci.a" "-Wl,/WHOLEARCHIVE:drivers\librte_bus_vdev.a" "-Wl,/WHOLEARCHIVE:drivers\librte_mempool_ring.a" "-lws2_32" "-lmincore" "-ladvapi32" "-lsetupapi" "-ldbghelp" "lib\librte_hash.a" "lib\librte_cmdline.a" "lib\librte_pci.a" "lib\librte_ethdev.a" "lib\librte_meter.a" "lib\librte_net.a" "lib\librte_mbuf.a" "lib\librte_mempool.a" "lib\librte_rcu.a" "lib\librte_ring.a" "lib\librte_eal.a" "lib\librte_telemetry.a" "lib\librte_kvargs.a" "drivers\librte_bus_pci.a" "drivers\librte_bus_vdev.a" "drivers\librte_mempool_ring.a" "-Wl,--subsystem,console" "-lkernel32" "-luser32" "-lgdi32" "-lwinspool" "-lshell32" "-lole32" "-loleaut32" "-luuid" "-lcomdlg32"
LINK : warning LNK4044: unrecognized option '/-subsystem'; ignored
LINK : fatal error LNK1181: cannot open input file 'console.obj'
clang: error: linker command failed with exit code 1181 (use -v to see invocation)
[179/181] Linking target lib/rte_hash-21.dll
Creating library lib\rte_hash.lib and object lib\rte_hash.exp
ninja: build stopped: subcommand failed.
I'm trying to build Firefox(60.esr) from source. I followed the steps mentioned in Build Firefox on Windows. But it fails.
Method #1:
I followed all the steps mentioned in the Windows Build Instruction.
The Build process failed with error.
0:24.36 ERROR: Could not find LLVM/Clang installation for compiling stylo build-time
0:24.36 bindgen. Please specify the 'LLVM_CONFIG' environment variable
0:24.36 (recommended), pass the '--with-libclang-path' and '--with-clang-path'
0:24.36 options to configure, or put 'llvm-config' in your PATH. Altering your
0:24.36 PATH may expose 'clang' as well, potentially altering your compiler,
0:24.36 which may not be what you intended.
So, I tried method 2.
Method #2:
Since it was expecting LLVM/clang, I installed LLVM/Clang 6.0 and added ‘LLVM_CONFIG’ to the environment variable.
And then I executed mach build. Adding LLVM_CONFIG fixed the error which was caused in Method 1.
But the build failed again with error.
0:16.24 c:/Users/n182s826/mozilla/mozilla-central/old-configure: fork: Resource temporarily unavailable
0:18.59 m.AllocationBase 0x0, m.BaseAddress 0x607A0000, m.RegionSize 0x240000, m.State 0x10000
0:18.59 C:\mozilla-build\msys\bin\sh.exe: *** Couldn't reserve space for cygwin's heap (0x607A0000 <0xB80000>) in child, Win32 error 0
0:18.59 0 [main] sh 13328 sync_with_child: child 14220(0x3B8) died before initialization with status code 0x1
0:18.59 51 [main] sh 13328 sync_with_child: *** child state waiting for longjmp
0:18.59 c:/Users/n182s826/mozilla/mozilla-central/old-configure: fork: Resource temporarily unavailable
0:18.61 ERROR: old-configure failed
0:18.65 *** Fix above errors and then restart with\
0:18.65 "c:/mozilla-build/mozmake/mozmake.EXE -f client.mk build"
I even raised a request at Bugzilla. But I haven't found any solution.
I am trying to build Boost library locally and want to use it as a local_repository in my own project. I am referring to this (https://github.com/nelhage/rules_boost) for help.
I have a directory tree like this:
boost/ // root of the boost project
|
bazel/
| |
| boost.bzl // contains "boost_library" function from https://github.com/nelhage/rules_boost/blob/master/boost/boost.bzl
| |
| BUILD // empty
boost/ // the original boost headers folder from original boost dist
|
lib/ // the original boost sources folder from original boost dist
|
BUILD
|
WORKSPACE
The BUILD file looks like this one:
https://github.com/nelhage/rules_boost/blob/master/BUILD.boost
with properly loading boost.bzl
The WORKSPACE is just:
workspace( name = "boost" )
The issue:
Now I am trying to build individual components (bazel build //:<component>).
Some of the components (Boost.Container, Boost.Test) are failing to build for a similar reason (not finding header files).
bazel build //:container 1 ↵
INFO: Found 1 target...
ERROR: /home/spyder/codebase/boost/BUILD:103:1: C++ compilation of rule '//:container' failed: Process exited with status 1 [sandboxed].
libs/container/src/global_resource.cpp:12:51: fatal error: boost/container/pmr/memory_resource.hpp: No such file or directory
compilation terminated.
Use --strategy=CppCompile=standalone to disable sandboxing for the failing actions.
Target //:container failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 0.519s, Critical Path: 0.18s
bazel build //:test 1 ↵
INFO: Found 1 target...
ERROR: /home/spyder/codebase/boost/BUILD:581:1: C++ compilation of rule '//:test' failed: Process exited with status 1 [sandboxed].
libs/test/src/junit_log_formatter.cpp:11:51: fatal error: boost/test/impl/junit_log_formatter.ipp: No such file or directory
compilation terminated.
Use --strategy=CppCompile=standalone to disable sandboxing for the failing actions.
Target //:test failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 1.027s, Critical Path: 0.82s
Can anyone guide me on fixing it ?
EDIT:
I also tried to query the expanded cc_library rule by bazel query --output=build //:container and got this
cc_library(
name = "container",
visibility = ["//visibility:public"],
generator_name = "container",
generator_function = "boost_library",
generator_location = "/home/spyder/codebase/boost/BUILD:103",
licenses = ["notice"],
deps = ["//:config", "//:core", "//:intrusive", "//:move"],
defines = [],
includes = ["boost/container/"],
copts = ["-Wno-unused-value"],
srcs = ["//:libs/container/src/alloc_lib.c", "//:libs/container/src/dlmalloc.cpp", "//:libs/container/src/dlmalloc_2_8_6.c", "//:libs/container/src/dlmalloc_ext_2_8_6.c", "//:libs/container/src/global_resource.cpp", "//:libs/container/src/monotonic_buffer_resource.cpp", "//:libs/container/src/pool_resource.cpp", "//:libs/container/src/synchronized_pool_resource.cpp", "//:libs/container/src/unsynchronized_pool_resource.cpp"],
hdrs = [ ....... , "//:boost/container/pmr/map.hpp", "//:boost/container/pmr/memory_resource.hpp", "//:boost/container/pmr/monotonic_buffer_resource.hpp", "//:boost/container/pmr/polymorphic_allocator.hpp", ........ ],
)
Very shockingly, the source file which is complaining (libs/container/src/global_resource.cpp) and the header that it is complaining about (boost/container/pmr/memory_resource.hpp) are both correctly included in the srcs and hdrs list.
I played with your rules a bit and the biggest problem I see is incomplete dependencies. For example I tried :algorithm component, and that needs to depend on :tuple. I guess you just needs to make sure all dependencies are set correctly.
I played more with container, and the problem I encountered was incorrect include dirs. If you run your build with -s flag, bazel will output all the command lines so you can inspect them and check that -isystem flags contain the directory that contains boost/container/... . What can also help you is the bazel flag --sandbox_debug, which will prevent the sandbox directory from being deleted so you can see which files are where and also you can reproduce the compiler invocation without running through bazel.
Last, bazel does not understand .ipp header extension yet (tbh I've never heard of it, but I also know next to nothing about boost). I have a change in flight that will introduce this.
I have got the following warning while building my code:
gcc -o uartsim.exe xtmpmain.o uartsim.o fiber_driver.o xtmp_options.o getopt.o D:\usr\xtensa\XtDev
ToolsDE\install\tools\RB-2008.4-win32\XtensaTools\lib\iss\xtmp.lib
mt -V manifest uartsim.exe.manifest '-f outputresource:uartsim.exe;1'
mt V2.3, Corinna Vinschen, Apr 19 2004
make: *** No rule to make target ', needed byall'. Stop.
"It means simply that the build tools want to build an object file but can't find all of the source files needed to do it. Consequently the tools will attempt to make the missing files but will then discover they don't know how to do that, hence the error message about not having a rule to "make target". The message can happen for a number of reasons."
So make sure that all of the files needed to build your tree of dependencies actually exists.
Here are some links on the web that should help:
http://www.newlc.com/en/forum/whats-no-rule-make-target-error-actually-means
http://www.google.com/search?q="No+rule+to+make+target"