I am brand-new to Buildroot and didn’t use embedded systems or distros a lot.
I successfully flashed my STM32 and have buildroot as distro on it but after flashing it I figured out that I needed to install gcc package.
I didn’t find the gcc package after make menuconfig -->target packages. In fact not all packages listed in the buildroot/package/ Directory are listed in the menuconfig target packages interface.
I am really a noob and it would be great if you orient me step by step in order to get this done.
Best Regards
I think you need native compiler on the target in Buildroot. But Buildroot do not provide native toolchain after Buildroot-2012.11.
For more details refer : https://buildroot.org/downloads/manual/manual.html#faq-no-compiler-on-target
If you really need native toolchain try a real distribution like
openembedded
yocto
Fedora
I think this helped you !
Related
I have built a sdcard.img for raspberry pi using Buildroot. When I run apt-get command it throws error "apt-get: command not found". I did not find apt-get/dpkg package to enable in 'make menuconfig' options. Now I'm trying to run cross-compiled opencv program on my Rpi but some shared libraries are missing and I want to install these libraries using apt repository (as I already did it on standard Raspbian Stretch os & program run successfully).
I googled it, there's no solution for Buildroot rasbpbian os. Also I tried downloading and installing .deb packages for apt/apt-get/dpkg, didn't work.
apt-get: command not found
I want to cross-compile a kernel which will have all the necessary packages such as apt/dpkg, bin and lib files. Or for the time being to get the work done need guidance to install apt/dpkg packages on Rpi buildroot os.
Buildroot will never have apt or any package manager. With buildroot you have to decide ahead-of-time what packages you'll want included in your rootfs. Use Raspbian if you want to use apt-get.
robert-orr has already answered your question but I think you are confused about the naming. You cannot rebuild raspbian using buildroot.
Rebuilding raspbian (a debian derivative) is a fairly involved process. You have to implement bootstrapping of a distro (compile a compiler, compile your packages with your compiled compiler, etc.) See Debian Bootstrap for everything needed to create your own distro from source. This is usually done by debian and debian-derivative distributions only.
You can build a simpler image using Buildroot, if that satisfies your needs. Also look at Yocto/OE to see if that satisfies your requirement for building an image from source.
With a Buildroot-generated system, it is not possible to use a package manager, because there is no way to make sure the package binaries will actually work on your system. There are two reasons for this:
Binaries depend on the toolchain (C library, kernel header version, subarchitecture choices, ABI choices). There are hundreds of combinations of these choices possible in Buildroot, it's not possible to build package binaries for all of them. Traditional distros limit the choices to just one per architecture.
How one package is configured affects how other packages can be built. Again, Buildroot offers choices there, while traditional distros choose one (usually enable all features).
In Buildroot, instead of using apt-get, you'd go back to make menuconfig, select the additional packages you want to install, and rebuild the system.
I make a modification in linux kernel of OpenWrt and then I compile the new (kernel) with command :
make target/linux/compile V=99
but I don't found the new image under
build_dir\linux-x86_generic\linux-3.3.8
in order to upgrade the kernel in my OpenWrt running in VM VirtuaBox
how to proceed to get the new kernel and upgrade the Openwrt ?
I am a bit puzzled by the fact you are looking at the linux-x86 folder since with openWRT you usually cross-compile everytime, or at least I've never used it for not cross compilations.
What are you compiling for ?
You should see a build/$TARGET folder with a linux-x-x directory in it where the linux kernel was compiled.
I have built the openwrt firmware and installed it to a device.
Now I want to compile my source code in C in the device (I can ssh into it).
However, openwrt firmware is quite basic and does not include make.
How can I install make/ equivalent to compile my C source code inside the device running openwrt firmware?
OpenWrt is not intended to work as a build server, so you won't find compiler, linker etc. in its root file system. As you mentioned before, you've successfully compiled the firmware. That means you have cross compiler at hand, so you can cross compile your software and then copy it to your system via scp.
Another approach would be to create your own feed, add your software to this feed, so that at the end you'll get an ordinary ipkg package, that you can download and install via web interface. See OpenWrt documentation for more details.
Lots of Cross Compiler are available for host system i.e PC running any Linux OS.
Just install compiler corresponding to Architecture in which Openwrt is running,
e.g If OpenWRT running on ARM architecture,
sudo apt-get install gcc-arm-linux-gnueabi
then compile source code as:
arm-linux-gcc -o yourprogram yourprogram.c
I'm working on a FORTRAN project and I would like to build all of the binaries that I want to maintain on a linux machine that is dedicated for automated builds. I have successfully used mingw to build 32-bit and 64-bit binaries from C source for windows machines on the linux machine with the following packages on Ubuntu.
apt-get install mingw32
apt-get install mingw-w64
Then I run the following commands to actually compile:
gcc -b amd64-mingw32msvc -V 4.4.4 -o <...other options>
However, the mingw packages that I've obtained via apt-get do not include FORTRAN compilers.
Anybody got any ideas on what I can do?
if you got mingw32 and the Gnu C cross compiler is working for you ... when why not just get the Gnu Fortran cross compiler, too?
http://www.nber.org/sys-admin/mingw32-fortran-fedora.html
EXAMPLE apt-get install mingw32-gcc-fortran
I know this is an old thread but a few things seem to have changed and people might still be interested in the topic.
Problem: I want to use my linux machine to compile some code and create a .exe that I can send to people using Windows.
Solution: Essentially here: http ://mxe.cc/
What I did:
Check to see if your system has all the software you need here
run
git clone -b stable https://github.com/mxe/mxe.git
It will download a few small things and create the directory "mxe" (probably in your home folder)
cd into that mxe directory and run "make". HOWEVER: this would take hours and take up a few GB on your hard drive so instead run something like
make mpfr eigen opencsg cgal qt
For more ideas on how to shorten that all see this or the mxe tutorial or somewhere else ;)
The easiest way to compile stuff then seems to be something like:
~/mxe/usr/bin/i686-pc-mingw32-gfortran -c main.f95
~/mxe/usr/bin/i686-pc-mingw32-gfortran main.o -o outfile.exe
Of course you can chose something other than fortran, just consult the mxe/usr/bin to see what its called.
You can always download and install a prebuilt compiler from the MinGW(-w64) project itself:
Windows 64-bit: http://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win64/Personal%20Builds/rubenvb/4.6.2-1/
Windows 32-bit: http://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win32/Personal%20Builds/rubenvb/4.6.2-1/
Just unpack somewhere and add the cross*/bin directory to PATH.
I include (obj)c(++) and fortran.
On Ubuntu 18.04 I use
apt install gfortran-mingw-w64
Then use the compiler x86_64-w64-mingw32-gfortran in place of gfortran. If you're using cmake, you can configure the compiler from the build directory like so:
FC=x86_64-w64-mingw32-gfortran cmake ..
I am currently using ubuntu 9.10 with the glibc version 2.11.1-0,
well i am doing a project, that i want to test with the another version of glibc that is 2.5-58, i wanted to know following things regarding this:
How to compile the version of 2.5-58, however keeping the previous version?
How to link the existing programs with the binaries of newer version of glibc?
I would be highly obliged if anybody can help me!!!
Thanks
If you want to manually compile another version of glibc, then I suggest you configuring (./configure script run) it with --prefix option to install not to /lib, /usr/lib but to /home/mehul/glibc2.5.58test/lib and /home/mehul/glibc2.5.58test/usr/lib
But compiling of glibc is not very easy thing, so another way is to get glibc 2.5-58 in compiled form from other linux and manually copy it to some subdirectory. Then you can override library search path of gcc and recompile your lib with libc from subdirectory.
Or you can use LD_LIBRARY_PATH to override library search path of compiled binary to use older glibc like this:
$ LD_LIBRARY_PATH=/home/mehul/glibc2.5.58test/lib /path/to/your/application
If you know that that version of libc is used in an older ditribution, you could install that distribution in a chroot/scratchbox/kvm/qemu/livecd or other such system for testing and building. Or there may be some other build farm type solution. Then you'll have an authentic system to test on that will not mess up your up to date one. It'll also be repeatable if you keep that system image.
If this isn't about a specific older release, why on earth would you want to test against a specific very old libc?