Skip to contentSkip to conversation

New: Cannot Patch Toolchain Files Using BR2_GLOBAL_PATCH_DIR

Buildroot [email protected] 1 participant 2 messages Sep 8, 2022 – Jun 15, 2024

lore
Share & tools
lore
#0 lore raw

https://bugs.busybox.net/show_bug.cgi?id=14991

            Bug ID: 14991
           Summary: Cannot Patch Toolchain Files Using
                    BR2_GLOBAL_PATCH_DIR
           Product: buildroot
           Version: 2021.08
          Hardware: All
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P5
         Component: Other
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected]

Target Milestone: ---

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!

Signature · 6 lines
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#1 lore raw

[Buildroot] [Bug 14991] Cannot Patch Toolchain Files Using BR2_GLOBAL_PATCH_DIR

https://bugs.busybox.net/show_bug.cgi?id=14991

Yann E. MORIN <[email protected]> changed:

What |Removed |Added
----------------------------------------------------------------------------

         Resolution|---                         |MOVED
             Status|NEW                         |RESOLVED
                 CC|                            |[email protected]

--- Comment #1 from Yann E. MORIN <[email protected]> --- 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!

Signature · 6 lines
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot