* [Buildroot] [RCF 1/2] support: enforce '--binary' when applying patches
@ 2016-09-29 14:57 James Knight
2016-09-29 14:57 ` [Buildroot] [RCF 2/2] rapidxml: add patch to fix usage with gcc 4.7+ James Knight
2016-09-29 16:11 ` [Buildroot] [RCF 1/2] support: enforce '--binary' when applying patches Ricardo Martincoski
0 siblings, 2 replies; 4+ messages in thread
From: James Knight @ 2016-09-29 14:57 UTC (permalink / raw)
To: buildroot
The following commit enforces the patch operation to "disable the
heuristic for transforming CRLF line endings into LF line endings" [1].
This is to help packages, which source files have been generated on non-
POSIX systems, to apply compatible non-POSIX generated patches. The
addition of this option should have no effect on existing patches [2].
[1]: http://git.savannah.gnu.org/cgit/patch.git/tree/patch.man#n306
[2]: https://www.gnu.org/software/diffutils/manual/html_node/Binary.html
Signed-off-by: James Knight <james.knight@rockwellcollins.com>
---
support/scripts/apply-patches.sh | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/support/scripts/apply-patches.sh b/support/scripts/apply-patches.sh
index 7ccb39d..a71a51a 100755
--- a/support/scripts/apply-patches.sh
+++ b/support/scripts/apply-patches.sh
@@ -114,7 +114,8 @@ function apply_patch {
exit 1
fi
echo "${path}/${patch}" >> ${builddir}/.applied_patches_list
- ${uncomp} "${path}/$patch" | patch -g0 -p1 -E -d "${builddir}" -t -N $silent
+ ${uncomp} "${path}/$patch" | \
+ patch --binary -g0 -p1 -E -d "${builddir}" -t -N $silent
if [ $? != 0 ] ; then
echo "Patch failed! Please fix ${patch}!"
exit 1
--
2.8.4.windows.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [Buildroot] [RCF 2/2] rapidxml: add patch to fix usage with gcc 4.7+
2016-09-29 14:57 [Buildroot] [RCF 1/2] support: enforce '--binary' when applying patches James Knight
@ 2016-09-29 14:57 ` James Knight
2016-09-29 16:11 ` [Buildroot] [RCF 1/2] support: enforce '--binary' when applying patches Ricardo Martincoski
1 sibling, 0 replies; 4+ messages in thread
From: James Knight @ 2016-09-29 14:57 UTC (permalink / raw)
To: buildroot
The official `rapidxml` package release only supports up to GCC 4.6.x
for all capabilities. Implementers attempting to include the file
"rapidxml_print.hpp" will all result in a complilation failure when
using a currently supported Buildroot GCC version (all 4.7+ at this
time). With the provided patch, dependent packages will be able to use
all of rapidxml's capabilities using a generated toolchain from
Buildroot (let alone external toolchains).
This commit also enforces rapidxml-provided patches to using CRLF line
endings. Since official rapidxml sources package in a CRLF-based
environment, patches need to following the same line endings or issues
arise:
patching file rapidxml_print.hpp
Hunk #1 FAILED at 101 (different line endings).
While this may not be required, it should mitigate maintences woes when
dealing with this package's patches [1].
[1]: https://github.com/git/git/commit/8d8140843501107c92e2f9a5acb60ee136352c1f
Signed-off-by: James Knight <james.knight@rockwellcollins.com>
---
package/rapidxml/.gitattributes | 2 +
...rnal-print-operations-are-declared-before.patch | 45 ++++++++++++++++++++++
2 files changed, 47 insertions(+)
create mode 100644 package/rapidxml/.gitattributes
create mode 100644 package/rapidxml/0001-ensure-internal-print-operations-are-declared-before.patch
diff --git a/package/rapidxml/.gitattributes b/package/rapidxml/.gitattributes
new file mode 100644
index 0000000..ebf512d
--- /dev/null
+++ b/package/rapidxml/.gitattributes
@@ -0,0 +1,2 @@
+# rapidxml's sources are crlf; enforce crlf on patches to prevent apply issues.
+*.patch text eol=crlf
diff --git a/package/rapidxml/0001-ensure-internal-print-operations-are-declared-before.patch b/package/rapidxml/0001-ensure-internal-print-operations-are-declared-before.patch
new file mode 100644
index 0000000..0526beb
--- /dev/null
+++ b/package/rapidxml/0001-ensure-internal-print-operations-are-declared-before.patch
@@ -0,0 +1,45 @@
+From fa6c67c5cb9dd3ae77ca0fdc8770236f197b0ee1 Mon Sep 17 00:00:00 2001
+From: James Knight <james.knight@rockwellcollins.com>
+Date: Wed, 28 Sep 2016 16:27:52 -0400
+Subject: [PATCH 1/1] ensure internal print operations are declared before use
+
+Stock rapidxml-1.13 does not allow implementers of the
+`rapidxml_print.hpp` header to build under GCC 4.7 (or newer) due to
+compliation issues. This is a result of "Name lookup changes" introduced
+in GCC 4.7 [1]. The following adds forward declarations required to
+compile with GCC 4.7+.
+
+This issue has been mentioned upstream [2], but it has yet to be fixed
+in official sources.
+
+[1]: https://gcc.gnu.org/gcc-4.7/porting_to.html
+[2]: https://sourceforge.net/p/rapidxml/bugs/16/
+
+Signed-off-by: James Knight <james.knight@rockwellcollins.com>
+---
+ rapidxml_print.hpp | 9 +++++++++
+ 1 file changed, 9 insertions(+)
+
+diff --git a/rapidxml_print.hpp b/rapidxml_print.hpp
+index 0ae2b14..dd89c26 100644
+--- a/rapidxml_print.hpp
++++ b/rapidxml_print.hpp
+@@ -101,6 +101,15 @@ namespace rapidxml
+
+ ///////////////////////////////////////////////////////////////////////////
+ // Internal printing operations
++
++ template<class OutIt, class Ch> inline OutIt print_cdata_node(OutIt out, const xml_node<Ch> *node, int flags, int indent);
++ template<class OutIt, class Ch> inline OutIt print_children(OutIt out, const xml_node<Ch> *node, int flags, int indent);
++ template<class OutIt, class Ch> inline OutIt print_comment_node(OutIt out, const xml_node<Ch> *node, int flags, int indent);
++ template<class OutIt, class Ch> inline OutIt print_data_node(OutIt out, const xml_node<Ch> *node, int flags, int indent);
++ template<class OutIt, class Ch> inline OutIt print_declaration_node(OutIt out, const xml_node<Ch> *node, int flags, int indent);
++ template<class OutIt, class Ch> inline OutIt print_doctype_node(OutIt out, const xml_node<Ch> *node, int flags, int indent);
++ template<class OutIt, class Ch> inline OutIt print_element_node(OutIt out, const xml_node<Ch> *node, int flags, int indent);
++ template<class OutIt, class Ch> inline OutIt print_pi_node(OutIt out, const xml_node<Ch> *node, int flags, int indent);
+
+ // Print node
+ template<class OutIt, class Ch>
+--
+2.8.4.windows.1
+
--
2.8.4.windows.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [Buildroot] [RCF 1/2] support: enforce '--binary' when applying patches
2016-09-29 14:57 [Buildroot] [RCF 1/2] support: enforce '--binary' when applying patches James Knight
2016-09-29 14:57 ` [Buildroot] [RCF 2/2] rapidxml: add patch to fix usage with gcc 4.7+ James Knight
@ 2016-09-29 16:11 ` Ricardo Martincoski
2016-09-29 17:22 ` James Knight
1 sibling, 1 reply; 4+ messages in thread
From: Ricardo Martincoski @ 2016-09-29 16:11 UTC (permalink / raw)
To: buildroot
James,
This change can have issues with old distros, see below.
Currently buildroot does not enforce a minimal version of 'patch'.
----- Original Message -----
> From: "James Knight" <james.knight@rockwellcollins.com>
> To: buildroot at busybox.net
> Cc: "James Knight" <james.knight@rockwellcollins.com>
> Sent: Thursday, September 29, 2016 11:57:00 AM
> Subject: [Buildroot] [RCF 1/2] support: enforce '--binary' when applying patches
> The following commit enforces the patch operation to "disable the
> heuristic for transforming CRLF line endings into LF line endings" [1].
[snip]
So I think you need a version of the tool 'patch' that contains [3]
that was merged in patch v2.6
RHEL5 and RHEL4 use patch v2.5.4.
> [1]: http://git.savannah.gnu.org/cgit/patch.git/tree/patch.man#n306
> [2]: https://www.gnu.org/software/diffutils/manual/html_node/Binary.html
[snip]
[3] http://git.savannah.gnu.org/cgit/patch.git/commit/?id=b7687446d1e7673a39fd66bc6043f4a78961f675
Regards,
Ricardo Martincoski
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Buildroot] [RCF 1/2] support: enforce '--binary' when applying patches
2016-09-29 16:11 ` [Buildroot] [RCF 1/2] support: enforce '--binary' when applying patches Ricardo Martincoski
@ 2016-09-29 17:22 ` James Knight
0 siblings, 0 replies; 4+ messages in thread
From: James Knight @ 2016-09-29 17:22 UTC (permalink / raw)
To: buildroot
Ricardo,
On Thu, Sep 29, 2016 at 12:11 PM, Ricardo Martincoski
<ricardo.martincoski@datacom.ind.br> wrote:
>
> This change can have issues with old distros, see below.
> Currently buildroot does not enforce a minimal version of 'patch'.
Good to know; thanks for the information. I'll try an alternative
solution for my current situation [1].
[1]: https://patchwork.ozlabs.org/patch/676644/
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2016-09-29 17:22 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-29 14:57 [Buildroot] [RCF 1/2] support: enforce '--binary' when applying patches James Knight
2016-09-29 14:57 ` [Buildroot] [RCF 2/2] rapidxml: add patch to fix usage with gcc 4.7+ James Knight
2016-09-29 16:11 ` [Buildroot] [RCF 1/2] support: enforce '--binary' when applying patches Ricardo Martincoski
2016-09-29 17:22 ` James Knight
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.