diff options
| author | Mingli Yu <Mingli.Yu@windriver.com> | 2019-04-16 16:05:01 +0800 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2019-04-23 23:30:19 +0100 |
| commit | a5dd314fba9e0571ab9af81d6f91c48d8ebfd14a (patch) | |
| tree | e4cf8cff46c8815d378c1967c2a8dfbca9c4a9ee /meta/recipes-devtools/elfutils/files | |
| parent | 073556fa8c6e95ebd1cd97d5226b8b9e743fe4e0 (diff) | |
| download | poky-a5dd314fba9e0571ab9af81d6f91c48d8ebfd14a.tar.gz | |
elfutils: fix build failure with musl
Fix below build failure with musl when ptest
enabled.
| In file included from ../../elfutils-0.176/tests/dwfl-proc-attach.c:33:
| ../../elfutils-0.176/lib/system.h:63:35: error: called object 'err' is not a function or function pointer
| #define error(status, errno, ...) err(status, __VA_ARGS__)
| ^~~
| ../../elfutils-0.176/tests/dwfl-proc-attach.c:92:5: note: in expansion of macro 'error'
| error (-1, 0, "dwfl_linux_proc_attach pid %d: %s", pid,
| ^~~~~
| ../../elfutils-0.176/tests/dwfl-proc-attach.c:79:7: note: declared here
| int err;
| ^~~
The root cause is because the conflicts between
vairable and function name, so change the variable
name to workaround it.
(From OE-Core rev: 48dbb1bd980f7ed17a612fa7c1be298f14955c3f)
Signed-off-by: Mingli Yu <Mingli.Yu@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools/elfutils/files')
| -rw-r--r-- | meta/recipes-devtools/elfutils/files/0001-fix-err-variable-and-function-conflicts.patch | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/meta/recipes-devtools/elfutils/files/0001-fix-err-variable-and-function-conflicts.patch b/meta/recipes-devtools/elfutils/files/0001-fix-err-variable-and-function-conflicts.patch new file mode 100644 index 0000000000..4cf54008b7 --- /dev/null +++ b/meta/recipes-devtools/elfutils/files/0001-fix-err-variable-and-function-conflicts.patch | |||
| @@ -0,0 +1,62 @@ | |||
| 1 | From 2c50fe7068bd6911958c6d851aef88179e73bb21 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Mingli Yu <Mingli.Yu@windriver.com> | ||
| 3 | Date: Tue, 16 Apr 2019 15:30:38 +0800 | ||
| 4 | Subject: [PATCH] fix err variable and function conflicts | ||
| 5 | |||
| 6 | There comes below build failure with musl when | ||
| 7 | ptest enabled. | ||
| 8 | | In file included from ../../elfutils-0.176/tests/dwfl-proc-attach.c:33: | ||
| 9 | | ../../elfutils-0.176/lib/system.h:63:35: error: called object 'err' is not a function or function pointer | ||
| 10 | | #define error(status, errno, ...) err(status, __VA_ARGS__) | ||
| 11 | | ^~~ | ||
| 12 | | ../../elfutils-0.176/tests/dwfl-proc-attach.c:92:5: note: in expansion of macro 'error' | ||
| 13 | | error (-1, 0, "dwfl_linux_proc_attach pid %d: %s", pid, | ||
| 14 | | ^~~~~ | ||
| 15 | | ../../elfutils-0.176/tests/dwfl-proc-attach.c:79:7: note: declared here | ||
| 16 | | int err; | ||
| 17 | | ^~~ | ||
| 18 | |||
| 19 | It is because there is no error.h in musl and | ||
| 20 | the patch 0008-build-Provide-alternatives-for-glibc-assumptions-hel.patch | ||
| 21 | has updated to use err.h to replace error.h | ||
| 22 | and also added macro definiton as below when | ||
| 23 | use musl. | ||
| 24 | #define error(status, errno, ...) err(status, __VA_ARGS__) | ||
| 25 | |||
| 26 | And in err.h, there is below logic: | ||
| 27 | _Noreturn void err(int, const char *, ...); | ||
| 28 | |||
| 29 | But when ptest enabled, there comes below error | ||
| 30 | as there is both variable and function defined | ||
| 31 | to be err in tests/dwfl-proc-attach.c. | ||
| 32 | So change the err variable's name to workaround | ||
| 33 | the build failure with musl. | ||
| 34 | |||
| 35 | Upstream-Status: Inappropriate [workaround in musl] | ||
| 36 | |||
| 37 | Signed-off-by: Mingli Yu <Mingli.Yu@windriver.com> | ||
| 38 | --- | ||
| 39 | tests/dwfl-proc-attach.c | 6 +++--- | ||
| 40 | 1 file changed, 3 insertions(+), 3 deletions(-) | ||
| 41 | |||
| 42 | diff --git a/tests/dwfl-proc-attach.c b/tests/dwfl-proc-attach.c | ||
| 43 | index 102ba18..ad4208e 100644 | ||
| 44 | --- a/tests/dwfl-proc-attach.c | ||
| 45 | +++ b/tests/dwfl-proc-attach.c | ||
| 46 | @@ -76,10 +76,10 @@ main (int argc __attribute__ ((unused)), | ||
| 47 | char **argv __attribute__ ((unused))) | ||
| 48 | { | ||
| 49 | /* Create two extra threads to iterate through. */ | ||
| 50 | - int err; | ||
| 51 | - if ((err = pthread_create (&thread1, NULL, sleeper, NULL)) != 0) | ||
| 52 | + int err1; | ||
| 53 | + if ((err1 = pthread_create (&thread1, NULL, sleeper, NULL)) != 0) | ||
| 54 | error (-1, err, "Couldn't create thread1"); | ||
| 55 | - if ((err = pthread_create (&thread2, NULL, sleeper, NULL)) != 0) | ||
| 56 | + if ((err1 = pthread_create (&thread2, NULL, sleeper, NULL)) != 0) | ||
| 57 | error (-1, err, "Couldn't create thread2"); | ||
| 58 | |||
| 59 | Dwfl *dwfl = dwfl_begin (&proc_callbacks); | ||
| 60 | -- | ||
| 61 | 2.7.4 | ||
| 62 | |||
