Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: bugzilla@busybox.net
To: buildroot@uclibc.org
Subject: [Buildroot] [Bug 14991] New: Cannot Patch Toolchain Files Using BR2_GLOBAL_PATCH_DIR
Date: Thu, 08 Sep 2022 20:54:38 +0000	[thread overview]
Message-ID: <bug-14991-163@https.bugs.busybox.net/> (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: unassigned@buildroot.uclibc.org
          Reporter: michael.johnson@getcruise.com
                CC: buildroot@uclibc.org
  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!

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

             reply	other threads:[~2022-09-08 20:54 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-08 20:54 bugzilla [this message]
2024-06-15 15:04 ` [Buildroot] [Bug 14991] Cannot Patch Toolchain Files Using BR2_GLOBAL_PATCH_DIR bugzilla

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-14991-163@https.bugs.busybox.net/ \
    --to=bugzilla@busybox.net \
    --cc=buildroot@uclibc.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox