mic/mpssd along with MIC drivers are currently only usable on
x86_64. So build mic/mpssd only for x86_64 to avoid build breaks on
big-endian systems.
Reported-by: Daniel Borkmann <[email protected]>
Reported-by: Dan Streetman <[email protected]>
Suggested-by: Peter Foley <[email protected]>
Signed-off-by: Ashutosh Dixit <[email protected]>
---
Documentation/mic/mpssd/Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Documentation/mic/mpssd/Makefile b/Documentation/mic/mpssd/Makefile
index 0f31568..f47fe6b 100644
--- a/Documentation/mic/mpssd/Makefile
+++ b/Documentation/mic/mpssd/Makefile
@@ -1,5 +1,5 @@
# List of programs to build
-hostprogs-y := mpssd
+hostprogs-$(CONFIG_X86_64) := mpssd
mpssd-objs := mpssd.o sysfs.o
--
2.0.0.rc3.2.g998f840
On Thu, Dec 4, 2014 at 4:27 PM, Ashutosh Dixit <[email protected]> wrote:
> mic/mpssd along with MIC drivers are currently only usable on
> x86_64. So build mic/mpssd only for x86_64 to avoid build breaks on
> big-endian systems.
Only building for x86_64 is fine, but in that case what's the point of
leaving the htole16() et. al. functions in mpssd.c? Shouldn't they be
removed?
>
> Reported-by: Daniel Borkmann <[email protected]>
> Reported-by: Dan Streetman <[email protected]>
> Suggested-by: Peter Foley <[email protected]>
> Signed-off-by: Ashutosh Dixit <[email protected]>
> ---
> Documentation/mic/mpssd/Makefile | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/Documentation/mic/mpssd/Makefile b/Documentation/mic/mpssd/Makefile
> index 0f31568..f47fe6b 100644
> --- a/Documentation/mic/mpssd/Makefile
> +++ b/Documentation/mic/mpssd/Makefile
> @@ -1,5 +1,5 @@
> # List of programs to build
> -hostprogs-y := mpssd
> +hostprogs-$(CONFIG_X86_64) := mpssd
>
> mpssd-objs := mpssd.o sysfs.o
>
> --
> 2.0.0.rc3.2.g998f840
>
On Thu, 4 Dec 2014 13:27:29 -0800
Ashutosh Dixit <[email protected]> wrote:
> mic/mpssd along with MIC drivers are currently only usable on
> x86_64. So build mic/mpssd only for x86_64 to avoid build breaks on
> big-endian systems.
I can certainly apply this. But it seems to me that this kind of code
doesn't belong in the documentation directory. How about a patch to move
it to tools/ ?
jon
On Thu, Dec 04 2014 at 07:27:06 PM, Dan Streetman <[email protected]> wrote:
> On Thu, Dec 4, 2014 at 4:27 PM, Ashutosh Dixit <[email protected]> wrote:
>> mic/mpssd along with MIC drivers are currently only usable on
>> x86_64. So build mic/mpssd only for x86_64 to avoid build breaks on
>> big-endian systems.
>
> Only building for x86_64 is fine, but in that case what's the point of
> leaving the htole16() et. al. functions in mpssd.c? Shouldn't they be
> removed?
I am hoping that once glibc is fixed we can remove this limitation on
building only for x86_64, so I'd rather htole16() et. al. stayed. As I
said earlier, I'm fine with your patch too, but restricting the build
for x86_64 seems to be the smallest patch which provides an acceptable
solution.
On Fri, Dec 05 2014 at 08:18:18 AM, Jonathan Corbet <[email protected]> wrote:
> On Thu, 4 Dec 2014 13:27:29 -0800
> Ashutosh Dixit <[email protected]> wrote:
>
>> mic/mpssd along with MIC drivers are currently only usable on
>> x86_64. So build mic/mpssd only for x86_64 to avoid build breaks on
>> big-endian systems.
>
> I can certainly apply this. But it seems to me that this kind of code
> doesn't belong in the documentation directory. How about a patch to move
> it to tools/ ?
Yes, let's resolve the situation for now and then we'll submit another
patch soon to move it to tools.
On Fri, Dec 05 2014 at 08:18:18 AM, Jonathan Corbet <[email protected]> wrote:
> On Thu, 4 Dec 2014 13:27:29 -0800
> Ashutosh Dixit <[email protected]> wrote:
>
>> mic/mpssd along with MIC drivers are currently only usable on
>> x86_64. So build mic/mpssd only for x86_64 to avoid build breaks on
>> big-endian systems.
>
> I can certainly apply this. But it seems to me that this kind of code
> doesn't belong in the documentation directory. How about a patch to move
> it to tools/ ?
Yes, let's resolve the situation for now and then we'll submit another
patch soon to move it to tools.
On Fri, Dec 5, 2014 at 1:18 PM, Ashutosh Dixit <[email protected]> wrote:
> On Thu, Dec 04 2014 at 07:27:06 PM, Dan Streetman <[email protected]> wrote:
>> On Thu, Dec 4, 2014 at 4:27 PM, Ashutosh Dixit <[email protected]> wrote:
>>> mic/mpssd along with MIC drivers are currently only usable on
>>> x86_64. So build mic/mpssd only for x86_64 to avoid build breaks on
>>> big-endian systems.
>>
>> Only building for x86_64 is fine, but in that case what's the point of
>> leaving the htole16() et. al. functions in mpssd.c? Shouldn't they be
>> removed?
>
> I am hoping that once glibc is fixed we can remove this limitation on
> building only for x86_64, so I'd rather htole16() et. al. stayed.
FYI, the bug I opened with glibc:
https://sourceware.org/bugzilla/show_bug.cgi?id=17679
was rejected because Andreas states "C does not allow function calls
in file scope." The suggestion was made to try to fix gcc, but
honestly I don't have the time (or energy) to push for a gcc change
just for this. :-)
I do think it's too bad that glibc hto* functions don't work in file
scope (i.e. with static/global var initialization) for constant values
(using them with variables is different, which is why
__bswap_constant_* works in file scope but __bswap_* doesn't), since
it's simply a 2-step process that's entirely doable by the
preprocessor and/or compiler; just check if target endianness matches
desired endianness, and if not the compiler does a simple byte swap of
the constant value.
Anyway, I doubt glibc and/or gcc will be updated anytime soon to allow this.
> As I
> said earlier, I'm fine with your patch too, but restricting the build
> for x86_64 seems to be the smallest patch which provides an acceptable
> solution.
Fine with me too. It'll get big-endian building again.