* [PATCH] rmc: Fix compiling issue with musl
@ 2016-11-14 22:10 Jianxun Zhang
2016-11-14 22:28 ` Jianxun Zhang
2016-11-14 22:50 ` Khem Raj
0 siblings, 2 replies; 5+ messages in thread
From: Jianxun Zhang @ 2016-11-14 22:10 UTC (permalink / raw)
To: openembedded-core
| src/rmcl/rmcl.c: In function 'query_policy_from_db':
| src/rmcl/rmcl.c:254:25: error: unknown type name 'ssize_t'
| ssize_t cmd_name_len = strlen((char *)&rmc_db[policy_idx]) + 1;
| ^~~~~~~~
The musl C lib provides ssize_t but we need to enable it
with a macro.
Signed-off-by: Jianxun Zhang <jianxun.zhang@linux.intel.com>
---
Before maintainer(s) push "merge" button, please read this short summary.
I feel there could be a better syntax to do it. And We could need to get
an ack from Hernandez, Alejandro who reported this issue and seems still
have (other) compiling errors even with this patch.
I submit this patch based on my thoughts and test out of tiny config.
Tests:
() Specify TCLIBC = "musl" in local.conf in my build dir.
() Build quark
() I can see this issue happens without the fix
() With this patch and do clean builds for quark and corei7-64,
Compiling passes. Boot test passed on RMC targets quark and Broxton-m.
Thanks
common/recipes-bsp/rmc/rmc.bb | 2 ++
1 file changed, 2 insertions(+)
diff --git a/common/recipes-bsp/rmc/rmc.bb b/common/recipes-bsp/rmc/rmc.bb
index aeaf12e..61a1bdb 100644
--- a/common/recipes-bsp/rmc/rmc.bb
+++ b/common/recipes-bsp/rmc/rmc.bb
@@ -24,6 +24,8 @@ COMPATIBLE_HOST = "(x86_64.*|i.86.*)-linux*"
EXTRA_OEMAKE='RMC_CFLAGS="-Wl,--hash-style=both"'
+EXTRA_OEMAKE_append_libc-musl = '" -D__NEED_ssize_t"'
+
# from gnu-efi, we should align arch-mapping with it.
def rmc_efi_arch(d):
import re
--
2.7.4
^ permalink raw reply related [flat|nested] 5+ messages in thread* Re: [PATCH] rmc: Fix compiling issue with musl
2016-11-14 22:10 [PATCH] rmc: Fix compiling issue with musl Jianxun Zhang
@ 2016-11-14 22:28 ` Jianxun Zhang
2016-11-14 22:50 ` Khem Raj
1 sibling, 0 replies; 5+ messages in thread
From: Jianxun Zhang @ 2016-11-14 22:28 UTC (permalink / raw)
To: openembedded-core
OOPS. Please ignore this patch. It is for another BSP project!
> On Nov 14, 2016, at 2:10 PM, Jianxun Zhang <jianxun.zhang@linux.intel.com> wrote:
>
> | src/rmcl/rmcl.c: In function 'query_policy_from_db':
> | src/rmcl/rmcl.c:254:25: error: unknown type name 'ssize_t'
> | ssize_t cmd_name_len = strlen((char *)&rmc_db[policy_idx]) + 1;
> | ^~~~~~~~
>
> The musl C lib provides ssize_t but we need to enable it
> with a macro.
>
> Signed-off-by: Jianxun Zhang <jianxun.zhang@linux.intel.com>
> ---
> Before maintainer(s) push "merge" button, please read this short summary.
> I feel there could be a better syntax to do it. And We could need to get
> an ack from Hernandez, Alejandro who reported this issue and seems still
> have (other) compiling errors even with this patch.
>
> I submit this patch based on my thoughts and test out of tiny config.
>
> Tests:
> () Specify TCLIBC = "musl" in local.conf in my build dir.
> () Build quark
> () I can see this issue happens without the fix
> () With this patch and do clean builds for quark and corei7-64,
> Compiling passes. Boot test passed on RMC targets quark and Broxton-m.
>
> Thanks
>
>
> common/recipes-bsp/rmc/rmc.bb | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/common/recipes-bsp/rmc/rmc.bb b/common/recipes-bsp/rmc/rmc.bb
> index aeaf12e..61a1bdb 100644
> --- a/common/recipes-bsp/rmc/rmc.bb
> +++ b/common/recipes-bsp/rmc/rmc.bb
> @@ -24,6 +24,8 @@ COMPATIBLE_HOST = "(x86_64.*|i.86.*)-linux*"
>
> EXTRA_OEMAKE='RMC_CFLAGS="-Wl,--hash-style=both"'
>
> +EXTRA_OEMAKE_append_libc-musl = '" -D__NEED_ssize_t"'
> +
> # from gnu-efi, we should align arch-mapping with it.
> def rmc_efi_arch(d):
> import re
> --
> 2.7.4
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] rmc: Fix compiling issue with musl
2016-11-14 22:10 [PATCH] rmc: Fix compiling issue with musl Jianxun Zhang
2016-11-14 22:28 ` Jianxun Zhang
@ 2016-11-14 22:50 ` Khem Raj
2016-11-14 23:08 ` Jianxun Zhang
1 sibling, 1 reply; 5+ messages in thread
From: Khem Raj @ 2016-11-14 22:50 UTC (permalink / raw)
To: Jianxun Zhang, openembedded-core
[-- Attachment #1.1: Type: text/plain, Size: 1768 bytes --]
On 11/14/16 2:10 PM, Jianxun Zhang wrote:
> | src/rmcl/rmcl.c: In function 'query_policy_from_db':
> | src/rmcl/rmcl.c:254:25: error: unknown type name 'ssize_t'
> | ssize_t cmd_name_len = strlen((char *)&rmc_db[policy_idx]) + 1;
> | ^~~~~~~~
>
> The musl C lib provides ssize_t but we need to enable it
> with a macro.
>
> Signed-off-by: Jianxun Zhang <jianxun.zhang@linux.intel.com>
> ---
> Before maintainer(s) push "merge" button, please read this short summary.
> I feel there could be a better syntax to do it. And We could need to get
> an ack from Hernandez, Alejandro who reported this issue and seems still
> have (other) compiling errors even with this patch.
>
> I submit this patch based on my thoughts and test out of tiny config.
>
> Tests:
> () Specify TCLIBC = "musl" in local.conf in my build dir.
> () Build quark
> () I can see this issue happens without the fix
> () With this patch and do clean builds for quark and corei7-64,
> Compiling passes. Boot test passed on RMC targets quark and Broxton-m.
>
> Thanks
>
>
> common/recipes-bsp/rmc/rmc.bb | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/common/recipes-bsp/rmc/rmc.bb b/common/recipes-bsp/rmc/rmc.bb
> index aeaf12e..61a1bdb 100644
> --- a/common/recipes-bsp/rmc/rmc.bb
> +++ b/common/recipes-bsp/rmc/rmc.bb
> @@ -24,6 +24,8 @@ COMPATIBLE_HOST = "(x86_64.*|i.86.*)-linux*"
>
> EXTRA_OEMAKE='RMC_CFLAGS="-Wl,--hash-style=both"'
>
> +EXTRA_OEMAKE_append_libc-musl = '" -D__NEED_ssize_t"'
this is not right way to handle it. you should be doing something like
#include <sys/types.h> in your source file
> +
> # from gnu-efi, we should align arch-mapping with it.
> def rmc_efi_arch(d):
> import re
>
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 211 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] rmc: Fix compiling issue with musl
2016-11-14 22:50 ` Khem Raj
@ 2016-11-14 23:08 ` Jianxun Zhang
2016-11-14 23:15 ` Khem Raj
0 siblings, 1 reply; 5+ messages in thread
From: Jianxun Zhang @ 2016-11-14 23:08 UTC (permalink / raw)
To: Khem Raj; +Cc: openembedded-core
> On Nov 14, 2016, at 2:50 PM, Khem Raj <raj.khem@gmail.com> wrote:
>
>
>
> On 11/14/16 2:10 PM, Jianxun Zhang wrote:
>> | src/rmcl/rmcl.c: In function 'query_policy_from_db':
>> | src/rmcl/rmcl.c:254:25: error: unknown type name 'ssize_t'
>> | ssize_t cmd_name_len = strlen((char *)&rmc_db[policy_idx]) + 1;
>> | ^~~~~~~~
>>
>> The musl C lib provides ssize_t but we need to enable it
>> with a macro.
>>
>> Signed-off-by: Jianxun Zhang <jianxun.zhang@linux.intel.com>
>> ---
>> Before maintainer(s) push "merge" button, please read this short summary.
>> I feel there could be a better syntax to do it. And We could need to get
>> an ack from Hernandez, Alejandro who reported this issue and seems still
>> have (other) compiling errors even with this patch.
>>
>> I submit this patch based on my thoughts and test out of tiny config.
>>
>> Tests:
>> () Specify TCLIBC = "musl" in local.conf in my build dir.
>> () Build quark
>> () I can see this issue happens without the fix
>> () With this patch and do clean builds for quark and corei7-64,
>> Compiling passes. Boot test passed on RMC targets quark and Broxton-m.
>>
>> Thanks
>>
>>
>> common/recipes-bsp/rmc/rmc.bb | 2 ++
>> 1 file changed, 2 insertions(+)
>>
>> diff --git a/common/recipes-bsp/rmc/rmc.bb b/common/recipes-bsp/rmc/rmc.bb
>> index aeaf12e..61a1bdb 100644
>> --- a/common/recipes-bsp/rmc/rmc.bb
>> +++ b/common/recipes-bsp/rmc/rmc.bb
>> @@ -24,6 +24,8 @@ COMPATIBLE_HOST = "(x86_64.*|i.86.*)-linux*"
>>
>> EXTRA_OEMAKE='RMC_CFLAGS="-Wl,--hash-style=both"'
>>
>> +EXTRA_OEMAKE_append_libc-musl = '" -D__NEED_ssize_t"'
>
> this is not right way to handle it. you should be doing something like
> #include <sys/types.h> in your source file
Khem,
Thanks lot for your review even when I wrongly submit it here! I tried it first but didn’t succeed for some reason with the suggested change.
Let me try it again...
>
>
>> +
>> # from gnu-efi, we should align arch-mapping with it.
>> def rmc_efi_arch(d):
>> import re
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] rmc: Fix compiling issue with musl
2016-11-14 23:08 ` Jianxun Zhang
@ 2016-11-14 23:15 ` Khem Raj
0 siblings, 0 replies; 5+ messages in thread
From: Khem Raj @ 2016-11-14 23:15 UTC (permalink / raw)
To: Jianxun Zhang; +Cc: openembedded-core
[-- Attachment #1.1: Type: text/plain, Size: 2369 bytes --]
On 11/14/16 3:08 PM, Jianxun Zhang wrote:
>
>> On Nov 14, 2016, at 2:50 PM, Khem Raj <raj.khem@gmail.com> wrote:
>>
>>
>>
>> On 11/14/16 2:10 PM, Jianxun Zhang wrote:
>>> | src/rmcl/rmcl.c: In function 'query_policy_from_db':
>>> | src/rmcl/rmcl.c:254:25: error: unknown type name 'ssize_t'
>>> | ssize_t cmd_name_len = strlen((char *)&rmc_db[policy_idx]) + 1;
>>> | ^~~~~~~~
>>>
>>> The musl C lib provides ssize_t but we need to enable it
>>> with a macro.
>>>
>>> Signed-off-by: Jianxun Zhang <jianxun.zhang@linux.intel.com>
>>> ---
>>> Before maintainer(s) push "merge" button, please read this short summary.
>>> I feel there could be a better syntax to do it. And We could need to get
>>> an ack from Hernandez, Alejandro who reported this issue and seems still
>>> have (other) compiling errors even with this patch.
>>>
>>> I submit this patch based on my thoughts and test out of tiny config.
>>>
>>> Tests:
>>> () Specify TCLIBC = "musl" in local.conf in my build dir.
>>> () Build quark
>>> () I can see this issue happens without the fix
>>> () With this patch and do clean builds for quark and corei7-64,
>>> Compiling passes. Boot test passed on RMC targets quark and Broxton-m.
>>>
>>> Thanks
>>>
>>>
>>> common/recipes-bsp/rmc/rmc.bb | 2 ++
>>> 1 file changed, 2 insertions(+)
>>>
>>> diff --git a/common/recipes-bsp/rmc/rmc.bb b/common/recipes-bsp/rmc/rmc.bb
>>> index aeaf12e..61a1bdb 100644
>>> --- a/common/recipes-bsp/rmc/rmc.bb
>>> +++ b/common/recipes-bsp/rmc/rmc.bb
>>> @@ -24,6 +24,8 @@ COMPATIBLE_HOST = "(x86_64.*|i.86.*)-linux*"
>>>
>>> EXTRA_OEMAKE='RMC_CFLAGS="-Wl,--hash-style=both"'
>>>
>>> +EXTRA_OEMAKE_append_libc-musl = '" -D__NEED_ssize_t"'
>>
>> this is not right way to handle it. you should be doing something like
>> #include <sys/types.h> in your source file
> Khem,
> Thanks lot for your review even when I wrongly submit it here! I tried it first but didn’t succeed for some reason with the suggested change.
mostly, it could be the makefiles not respecting the compiler options passed
from bitbake. You have to make sure that, all the -I<dir> options are used
properly which are relative to sysroot.
>
> Let me try it again...
>
>>
>>
>>> +
>>> # from gnu-efi, we should align arch-mapping with it.
>>> def rmc_efi_arch(d):
>>> import re
>
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 211 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2016-11-14 23:15 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-11-14 22:10 [PATCH] rmc: Fix compiling issue with musl Jianxun Zhang
2016-11-14 22:28 ` Jianxun Zhang
2016-11-14 22:50 ` Khem Raj
2016-11-14 23:08 ` Jianxun Zhang
2016-11-14 23:15 ` Khem Raj
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox