| Summary: | Cannot Patch Toolchain Files Using BR2_GLOBAL_PATCH_DIR | ||
|---|---|---|---|
| Product: | buildroot | Reporter: | Michael Johnson <michael.johnson> |
| Component: | Other | Assignee: | unassigned |
| Status: | RESOLVED MOVED | ||
| Severity: | normal | CC: | buildroot, michael.johnson, yann.morin.1998 |
| Priority: | P5 | ||
| Version: | 2021.08 | ||
| Target Milestone: | --- | ||
| Hardware: | All | ||
| OS: | Linux | ||
| Host: | Target: | ||
| Build: | |||
Thank you for your report.
The issue tracker for the Buildroot project has been moved to
the Gitlab.com issue tracker:
https://gitlab.com/buildroot.org/buildroot/-/issues
We are taking this opportunity to close old issues in this old
tracker. If you believe your issue is still relevant, please
open one in the new issue tracker.
Thank you!
|
I am attempting to patch include/c++/10.2.1/variant that gets built as part of buildroot to avoid a nvcc compiler issue my company is dealing with. In so doing, I wrote a patch file and placed it in /app/br2_external/patches/toolchain-external-arm-aarch64/2020.11/0000-std-variant-nvcc-compat.patch Supplied the BR config BR2_GLOBAL_PATCH_DIR=/app/br2_external/patches Then when building the toolchain with `make toolchain` my patch file is failing to find the appropriate path to variant. I dug into the final call that is being made by patch, and found the underlying command be run was: cat /app/br2_external/patches/toolchain-external-arm-aarch64/00-std-variant-nvcc-compat.patch | patch -g0 -p1 -E --no-backup-if-mismatch -d /app/tmp/sources/buildroot/output/build/toolchain-external-arm-aarch64-2020.11 -t -N The key here was the patch was attempting to run in the directory toolchain-external-arm-aarch64-2020.11 However, when I looked at `make V=1 toolchain`, I saw during toolchain-external-arm-aarch64 extraction phase, ALL of the src was moved from toolchain-external-arm-aarch64 to /app/tmp/sources/buildroot/output/host/* Because the extraction moves the files to a different path AND patch uses -p1 (Which essentially breaks absolute paths in patch files), I am fairly confident there is no way to apply patches to the toolchain source files via the BR2_GLOBAL_PATCH_DIR mechanism. It would be AMAZING if this were to be possible! We are exploring forking BR as an alternative, changing the source URL of the gcc toolchain to provide an already-patched tarball rather than having buildroot patch at buildtime :/ We use BR 2021.08 today!