diff options
author | Thomas Petazzoni <thomas.petazzoni@free-electrons.com> | 2016-08-05 22:52:36 +0200 |
---|---|---|
committer | Thomas Petazzoni <thomas.petazzoni@free-electrons.com> | 2016-08-08 23:48:13 +0200 |
commit | 225e1681cc000d904e5e98a3fcff974aac4e8d71 (patch) | |
tree | eb6b7e74df7018edc18f31e93e862598e9a5ddcc /package/netplug/0003-remove-assert-fail.patch | |
parent | 0bb83105d2a2915bd59455831fed081eb80c8dda (diff) | |
download | buildroot-225e1681cc000d904e5e98a3fcff974aac4e8d71.tar.gz buildroot-225e1681cc000d904e5e98a3fcff974aac4e8d71.zip |
netplug: add two patches to fix musl build issues
This commit adds two patches to netplug that are needed for this package
to build with musl:
- One patch to add a missing header inclusion
- One patch to fix a conflicting prototype on __assert_fail().
Fixes:
http://autobuild.buildroot.net/results/c2a5dfedba46cc8eb3d0c5c43f1f76fe0bb1805f/
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Diffstat (limited to 'package/netplug/0003-remove-assert-fail.patch')
-rw-r--r-- | package/netplug/0003-remove-assert-fail.patch | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/package/netplug/0003-remove-assert-fail.patch b/package/netplug/0003-remove-assert-fail.patch new file mode 100644 index 0000000000..635c462a5e --- /dev/null +++ b/package/netplug/0003-remove-assert-fail.patch @@ -0,0 +1,51 @@ +Remove __assert_fail() + +The netplug code uses the assert() macro in various places. In glibc +internally, assert() uses a function called __assert_fail() to print a +message and abort. Relying on internal glibc details, netplug +re-defines __assert_fail() in the hope that it will get called instead +of glibc internal version. + +This attempt: + + * Doesn't work with uClibc, which doesn't use any __assert_fail() + function at all. It doesn't fail to build, but it is entirely + useless. + + * Fails to build with musl, which also defines __assert_fail(), but + with a different prototype. + +We simply remove the __assert_fail() implementation, so that the C +library implementation of assert() just does its normal work. The only +functionality lost is that the message is displayed on the standard +output rather than in netplug's logs (and this was only working with +glibc anyway). + +Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> + +Index: b/lib.c +=================================================================== +--- a/lib.c ++++ b/lib.c +@@ -199,21 +199,6 @@ + return x; + } + +- +-void +-__assert_fail(const char *assertion, const char *file, +- unsigned int line, const char *function) +-{ +- do_log(LOG_CRIT, "%s:%u: %s%sAssertion `%s' failed", +- file, line, +- function ? function : "", +- function ? ": " : "", +- assertion); +- +- abort(); +-} +- +- + /* + * Local variables: + * c-file-style: "stroustrup" |