I am working on a project for Raspberry Pi 3 and i'm using buildroot for building linux kernel, fs etc. But every now and then (when i change the settings of buildroot for example) i am no longer able to successfully finish the build proccess even if i roll back to previous configuration (even if i choose initial raspberrypi3_defconfig configuration). The error is always similar:
host-binutils 2.28.1 Configuring
(cd /home/andy/embedded_linux/buildroot/output/build/host-binutils-2.28.1/ && rm -rf config.cache; PATH="/home/andy/embedded_linux/buildroot/output/host/bin:/home/andy/embedded_linux/buildroot/output/host/sbin:/home/andy/bin:/home/andy/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin" PKG_CONFIG="/home/andy/embedded_linux/buildroot/output/host/bin/pkg-config" PKG_CONFIG_SYSROOT_DIR="/" PKG_CONFIG_ALLOW_SYSTEM_CFLAGS=1 PKG_CONFIG_ALLOW_SYSTEM_LIBS=1 PKG_CONFIG_LIBDIR="/home/andy/embedded_linux/buildroot/output/host/lib/pkgconfig:/home/andy/embedded_linux/buildroot/output/host/share/pkgconfig" AR="/usr/bin/ar" AS="/usr/bin/as" LD="/usr/bin/ld" NM="/usr/bin/nm" CC="/usr/bin/gcc" GCC="/usr/bin/gcc" CXX="/usr/bin/g++" CPP="/usr/bin/cpp" OBJCOPY="/usr/bin/objcopy" RANLIB="/usr/bin/ranlib" CPPFLAGS="-I/home/andy/embedded_linux/buildroot/output/host/include" CFLAGS="-O2 -I/home/andy/embedded_linux/buildroot/output/host/include" CXXFLAGS="-O2 -I/home/andy/embedded_linux/buildroot/output/host/include" LDFLAGS="-L/home/andy/embedded_linux/buildroot/output/host/lib -Wl,-rpath,/home/andy/embedded_linux/buildroot/output/host/lib" INTLTOOL_PERL=/usr/bin/perl CFLAGS="-O2 -I/home/andy/embedded_linux/buildroot/output/host/include" LDFLAGS="-L/home/andy/embedded_linux/buildroot/output/host/lib -Wl,-rpath,/home/andy/embedded_linux/buildroot/output/host/lib" MAKEINFO=true CONFIG_SITE=/dev/null ./configure --prefix="/home/andy/embedded_linux/buildroot/output/host" --sysconfdir="/home/andy/embedded_linux/buildroot/output/host/etc" --localstatedir="/home/andy/embedded_linux/buildroot/output/host/var" --enable-shared --disable-static --disable-gtk-doc --disable-gtk-doc-html --disable-doc --disable-docs --disable-documentation --disable-debug --with-xmlto=no --with-fop=no --disable-dependency-tracking --disable-multilib --disable-werror --target=-buildroot-linux-uclibcgnueabihf --disable-shared --enable-static --with-sysroot=/home/andy/embedded_linux/buildroot/output/host/-buildroot-linux-uclibcgnueabihf/sysroot --enable-poison-system-directories --disable-sim --disable-gdb )
configure: loading site script /dev/null
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking target system type... configure: error: /bin/bash ./config.sub -buildroot-linux-uclibcgnueabihf failed
The error can occur while configuring some other utility (for example while configuring flex 2.6.4, or dropbear etc) but the main parttern of the error is always the same:
checking target system type... configure: error: /bin/bash ./config.sub -buildroot-linux-something failed
Couldn't find out the solution to that problem, please, help me.
I don't exactly get what is going wrong, but as you describe "when i change the settings of buildroot for example", I can tell you that buildroot has no means of supporting this in all cases from a normal make. You should e.g. use a make clean and do a full rebuild.
See https://buildroot.org/downloads/manual/manual.html#full-rebuild for more information.
Related
I'm trying to compile the binutils for the i686-elf target according to this tutorial:
https://wiki.osdev.org/GCC_Cross-Compiler
I just added the --enable-tui option, so that I have the support in the gdb.
I did the following:
# get sources
git clone git://sourceware.org/git/binutils-gdb.git
# store settings
export PREFIX="`pwd`/opt/cross"
export TARGET=i686-elf
export PATH="$PREFIX/bin:$PATH"
# create build folder
mkdir build-binutils
cd build-binutils
# run configure
../binutils-gdb/configure -target=$TARGET --prefix="$PREFIX" --with-sysroot --disable-nls --disable-werror --enable-tui
# make
make
This runs for some time and terminates with the following error:
checking for library containing socketpair... (cached) none required
checking for ld used by GCC... (cached) ld
checking if the linker (ld) is GNU ld... (cached) yes
checking for shared library run path origin... (cached) done
checking for iconv... (cached) yes
checking for iconv declaration... (cached)
extern size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
checking for library containing waddstr... (cached) no
configure: error: no enhanced curses library found; disable TUI
make[1]: *** [Makefile:11329: configure-gdb] Error 1
make[1]: Leaving directory '/home/noexpandtab/dev/build-binutils'
make: *** [Makefile:853: all] Error 2
For me it seems, that the ncurses library cannot be found.
I have a Debian 10 running and installed the following additional packages:
libncurses-dev
ncurses-base
ncurses-doc
libncurses5-dev
Do I have to install additional packages? Or am I missing some options for the configure script?
You're cross-compiling to a different architecture (i686-elf) than whatever you're running on—the $TARGET mentioned in the question. gdb will have to be linked with libraries which are built for that architecture.
Debian provides ncurses packages which run on the current architecture, but does not provide a suitable package for the cross-compiled application. So you get to do this for yourself.
When cross-compiling ncurses, you'll have to keep in mind that part of it builds/runs on the current architecture (to generate source-files for compiling by the cross-compiler). That's defined in the environment as $BUILD_CC (rather than $CC), as you might see when reading the script for the mingw cross-compiling. There's a section in the INSTALL file (in the ncurses sources) which outlines the process.
There's no tutorial (that would be off-topic here anyway), but others have read the instructions and cross-compiled ncurses as evidenced by a recent bug report.
I retried the whole compilation, and suddenly it works! I tested a bit and I assume I found my fault: I executed configure without --enable-tui, where make worked. Then I executed configure with --enable-tui in the same folder without cleaning it. After cleaning or running in a new folder it compiled.
Thanks to the one user who posted to delete the contents of opt/cross. (The comment itself was already somehow deleted in between.) This wasn't the solution, but leaded me in the right direction.
TL;DR: Clean the build folder before running configure with different parameters again.
I'm currently building Binutils 2.32 for the armv7l-unknown-linux-gnueabihf target, with this configure command:
chronos#localhost ~/Downloads/tarballs/binutils-2.32 $ ./configure --prefix=/usr/local/opt/arm-cross --target=armv7l-unknown-linux-gnueabihf --enable-shared --enable-host-shared --disable-static --enable-plugins --enable-gold=default --enable-ld --with-system-zlib
I ran make -j3 && make install, and no errors occured.
However, when I added /usr/local/opt/arm-cross/bin to my path and ran armv7l-unknown-linux-gnueabihf-objdump, this error occured:
armv7l-unknown-linux-gnueabihf-objdump: can't set BFD default target to `armv7l-unknown-linux-gnueabihf': invalid bfd target
How do I fix this? I searched on Stack Overflow and Google and couldn't come up with anything.
You configured with --enable-shared --enable-host-shared --disable-static. This means that it is you need to make sure that the binutils programs can find the shared objects they need. Therefore, in addition to PATH, you have to use LD_LIBRARY_PATH, or otherwise make the BFD library available to your custom binutils build.
This could however affect how other installed binutils versions find their BFD library, so it may be easier to link your version statically.
I have followed instructions provided in other articles to fix the below issue but still doesn't appear to work for my system. I am trying to upgrade glibc to v2.27 on my CentOS 7.3 machine. I downloaded the package and running into the below compiler dependency during the configure script execution:
../configure --prefix=/opt/glibc-2.27
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking for gcc... gcc
...
...
checking if gcc is sufficient to build libc... no
checking for nm... nm
checking for python3... no
checking for python... python
configure: error:
*** These critical programs are missing or too old: compiler
*** Check the INSTALL file for required versions.
So I upgraded my gcc and verified the upgraded version:
gcc --version
gcc (GCC) 8.2.0
I also have the following environment variable set in my bashrc:
export CC=/usr/local/bin/gcc
For some reason, the configure script still throws the same error based on which it appears that the upgraded gcc version isn't being used.
What am I missing?
I have downloaded FFTW library and I have followed the installation instruction by typing these commands (http://pblog.ebaker.me.uk/2014/12/installing-fftw-on-os-x-mavericks.html) on the terminal in order to install the FFTW but I got this error.
The commands are:
./configure --enable-float --enable-threads
make
make install
The error is:
./configure
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... configure: error: unsafe absolute working directory name
Any one have a solution for that, please?
This error message states that there is an illegal character in your path (probably one of $, \, #, ", ', `).
In response to one of the comments, it can make sense to build fftw yourself because there are many different choices to make when you build fftw depending on your hardware. Most likely you have AVX2 available on your machine, which was less common on Macs in 2014 when that blog was written. You probably also have multiple cores. To create single, double, and long double libraries use these three code blocks:
./configure CC=/usr/local/bin/gcc-7 --enable-openmp --enable-avx2 --enable-threads --enable-shared --prefix=/usr/local
make
sudo make install
and
./configure CC=/usr/local/bin/gcc-7 --enable-openmp --enable-avx2 --enable-threads --enable-shared --enable-float --prefix=/usr/local
make
sudo make install
and
./configure CC=/usr/local/bin/gcc-7 --enable-openmp --enable-threads --enable-shared --enable-long-double --prefix=/usr/local
make
sudo make install
Of course, /usr/local/bin/gcc-7 should be replaced with the compiler you want to use and /usr/local should be replaced with the path where you want to install the fftw libraries. If you don't specify the compiler path then the default Apple clang compiler will be used... which currently doesn't play nicely with OpenMP, so you have to use another compiler if you want to use multithreading through OpenMP.
I tried to update Ruby in my Mac OS X 10.6.6 system. Now I have 1.8.7, and I want to update to 1.9.2.
When I typed rvm install 1.9.2 I got:
gal-harths-iMac:~ galharth$ rvm install 1.9.2
/Users/galharth/.rvm/rubies/ruby-1.9.2-p136, this may take a while depending on your cpu(s)...
ruby-1.9.2-p136 - #fetching
ruby-1.9.2-p136 - #extracted to /Users/galharth/.rvm/src/ruby-1.9.2-p136 (already extracted)
ruby-1.9.2-p136 - #configuring
Error running ' ./configure --prefix=/Users/galharth/.rvm/rubies/ruby-1.9.2-p136 --enable-shared ', please read /Users/galharth/.rvm/log/ruby-1.9.2-p136/configure.log
There has been an error while running configure. Halting the installation.
I installed XCode and it still doesn't work.
This is the configure.log file:
[2011-02-08 17:10:04] ./configure --prefix=/Users/galharth/.rvm/rubies/ruby-1.9.2-p136 --enable-shared
checking build system type... i386-apple-darwin10.6.0
checking host system type... i386-apple-darwin10.6.0
checking target system type... i386-apple-darwin10.6.0
checking for gcc... no
checking for cc... no
checking for cl.exe... no
configure: error: in `/Users/galharth/.rvm/src/ruby-1.9.2-p136':
configure: error: no acceptable C compiler found in $PATH
See `config.log' for more details
[2011-02-08 17:23:19] ./configure --prefix=/Users/galharth/.rvm/rubies/ruby-1.9.2-p136 --enable-shared
checking build system type... i386-apple-darwin10.6.0
checking host system type... i386-apple-darwin10.6.0
checking target system type... i386-apple-darwin10.6.0
checking for gcc... no
checking for cc... no
checking for cl.exe... no
configure: error: in `/Users/galharth/.rvm/src/ruby-1.9.2-p136':
configure: error: no acceptable C compiler found in $PATH
See `config.log' for more details
[2011-02-08 20:44:14] ./configure --prefix=/Users/galharth/.rvm/rubies/ruby-1.9.2-p136 --enable-shared
checking build system type... i386-apple-darwin10.6.0
checking host system type... i386-apple-darwin10.6.0
checking target system type... i386-apple-darwin10.6.0
checking for gcc... no
checking for cc... no
checking for cl.exe... no
configure: error: in `/Users/galharth/.rvm/src/ruby-1.9.2-p136':
configure: error: no acceptable C compiler found in $PATH
See `config.log' for more details
[2011-02-08 21:02:55] ./configure --prefix=/Users/galharth/.rvm/rubies/ruby-1.9.2-p136 --enable-shared
checking build system type... i386-apple-darwin10.6.0
checking host system type... i386-apple-darwin10.6.0
checking target system type... i386-apple-darwin10.6.0
checking for gcc... no
checking for cc... no
checking for cl.exe... no
configure: error: in `/Users/galharth/.rvm/src/ruby-1.9.2-p136':
configure: error: no acceptable C compiler found in $PATH
See `config.log' for more details
There are some oddities in your log file output. Your question shows you have Mac OS 10.6.6, but the log shows the OS is i386. Mac OS 10.6.6 should be x86_64. This means for some reason your system thinks it's 32-bit when it should be 64bit. Your version of XCode needs to be current, so if you didn't just download it and install it, then do so. The version of XCode on the Snow Leopard disk was buggy, and the version for Mac OS prior to Snow Leopard is out of date once you install 10.6 on your machine.
Here's some things to try. If one works you're done, otherwise try the next one.
Do rvm -v and note the version number, then rvm get head followed by rvm reload if the version number displayed after updating has changed. Try running rvm install 1.9.2-p136.
Delete the files in your ~/.rvm/src/ruby-1.9.2-p136 directory using rm ~/.rvm/src/ruby-1.9.2-p136, then try installing using the install command in #1.
Manually download a copy of Ruby 1.9.2-p136 into your ~/.rvm/archives directory and extract it into your ~/.rvm/src/ruby-1.9.2-p136 directory. You can cd ~/.rvm/archives, delete any existing old version of the archive, then use curl -O ftp://ftp.ruby-lang.org:21//pub/ruby/1.9/ruby-1.9.2-p136.tar.gz or wget ftp://ftp.ruby-lang.org:21//pub/ruby/1.9/ruby-1.9.2-p136.tar.gz to pull in a new version. Then cd ~/.rvm/src then the rm command from #2 above followed by tar zxvf ../archives/ruby-1.9.2-p136.tar.gz to extract the files, then try running the RVM install command in #1.
I have a machine that's behind a proxy that won't allow RVM to get to the Ruby repositories, causing the archive to actually be the proxy's failure notice. When RVM tried burst the tar file, it would fail, but not catch the problem, then would try to configure and fail. The fix was to manually download the archive and burst it into the src directory.
Using the command rvm install 1.9.3 --with-gcc=clang worked for me.
When this happened to me, I inserted the Snow Leopard disk, selected Optional Installs and installed the Xcode package. That solved the missing C compiler problem as described here. Thanks to this blog: http://www.brianp.net/2009/09/05/snow-leopards-ate-my-c-compiler/
In my case, once I solved the compiler problem I got a permissions error. Running as root in bash gave rvm the appropriate permissions.
If you are running Lion check to make sure you have the Command Line Tools installed. They separated them from XCode so they are a separate download now. You can find them here:
https://developer.apple.com/downloads/index.action