b3cc7e65ee
copy_toolchain_lib_root copies libraries from staging to target, resolving and copying symbolic links along the way. The most inner loop, a "while" loop, starts from an initial name, and if it's a symbolic link, gets resolved to the target, and the loop iterates until we reach a real file. However, the destination folder where the symbolic link or real file is created is computed in DESTDIR only once, before this loop starts. Therefore, this loop works fine when all symbolic links in the chain, and the real file all belong to the same directory. But it doesn't do the correct thing when the symbolic link and/or real file are in different folder. An example is Crosstool-NG musl toolchains, where the dynamic loader is in /lib/ld-musl*.so but points to ../usr/lib/libc.so. With the current logic, we copy /lib/ld-musl*.so to /lib, but we also copy libc.so to /lib instead of the expected /usr/lib. This currently doesn't cause any problem because the musl dynamic linker is manually created by the TOOLCHAIN_EXTERNAL_MUSL_LD_LINK hook. However, this logic has a number of problems, so in a followup commit, we are going to put the musl dynamic linker in TOOLCHAIN_EXTERNAL_LIBS, which will cause it to be copied by copy_toolchain_lib_root. But we obviously want the link and its target to be copied to the right place, hence this fix. Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> |
||
---|---|---|
arch | ||
board | ||
boot | ||
configs | ||
docs | ||
fs | ||
linux | ||
package | ||
support | ||
system | ||
toolchain | ||
utils | ||
.defconfig | ||
.gitignore | ||
.gitlab-ci.yml | ||
.gitlab-ci.yml.in | ||
CHANGES | ||
Config.in | ||
Config.in.legacy | ||
COPYING | ||
DEVELOPERS | ||
Makefile | ||
Makefile.legacy | ||
README |
Buildroot is a simple, efficient and easy-to-use tool to generate embedded Linux systems through cross-compilation. The documentation can be found in docs/manual. You can generate a text document with 'make manual-text' and read output/docs/manual/manual.text. Online documentation can be found at http://buildroot.org/docs.html To build and use the buildroot stuff, do the following: 1) run 'make menuconfig' 2) select the target architecture and the packages you wish to compile 3) run 'make' 4) wait while it compiles 5) find the kernel, bootloader, root filesystem, etc. in output/images You do not need to be root to build or run buildroot. Have fun! Buildroot comes with a basic configuration for a number of boards. Run 'make list-defconfigs' to view the list of provided configurations. Please feed suggestions, bug reports, insults, and bribes back to the buildroot mailing list: buildroot@buildroot.org You can also find us on #buildroot on Freenode IRC. If you would like to contribute patches, please read https://buildroot.org/manual.html#submitting-patches