[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [UNIKRAFT/LIB-MUSL PATCH] math: Provide constants to Unikraft


  • To: Simon Kuenzer <simon.kuenzer@xxxxxxxxx>, "minios-devel@xxxxxxxxxxxxx" <minios-devel@xxxxxxxxxxxxx>
  • From: "Jung, Alexander" <a.jung@xxxxxxxxxxxxxxx>
  • Date: Tue, 7 Jul 2020 09:04:43 +0000
  • Accept-language: en-GB, en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=lancaster.ac.uk; dmarc=pass action=none header.from=lancaster.ac.uk; dkim=pass header.d=lancaster.ac.uk; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=pCyVjQpj7aGaFU7UEwahhzA89dnT7y30UtZlCcrQStA=; b=FGpnnWXtIyDYw8QQTgkSO+vs3vQhfAX2sq2IoK5GLDt7sg5V8uEy/tIStX1eFT2hzPxU1KvvBoL85ICJOkPvOZ7x4BvrBqeDwz6gIZtes/hLsyR94/z4LrI0Aqvcx99dZ0EwnVat28PTBozmN5byW90ld+hGx1CcqTdRwRjfVacSI98GFWdscjO93I8Nxa2uzbs8dZi7VmWEmWglj06Li1XyPa3qMxge/43p/J+Jw0b6i2phfZ/PnsQjKtZr/F1Y/QHXxaze4WzAn7u4jaRNjnWGhxtjZSAOO2v4X08oCbnUV4aqywo+xs66Bs1Ce5OeS1SbTbRmk2OZx9rqa9pMfA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=gu6+q9LgIk9kymRVv30m5LxNYb51rS0w0mACd5RsX+jctxGXR58NayebQQxFAmoxI2ArSVqWRaXrTDzRfWiyYs4M1rEAMIGl2ACb82HB+IiCMiJ/copjc7IQNnGGKVDYG4uHQloarr20ZLOVFTEn7TiC/HGIdtu1aaI7dIMdIecuQaJF/jZwT370H4hIoeqKwsalrMa0h9A5RerR5kiyAewgkvaVP6e3t7FFxLjbnC1hiEED4xsGnjg1x5UTBkSdQvFrtiU3yMOQJPHEyyTk6WncnK8VVagf7A2lgOAtH0w5Jg9RDYzgZO48Gq82i36PElwgWSHxqGyEB+FGKI8BDg==
  • Authentication-results: neclab.eu; dkim=none (message not signed) header.d=none;neclab.eu; dmarc=none action=none header.from=lancaster.ac.uk;
  • Cc: Felipe Huici <Felipe.Huici@xxxxxxxxx>, Gaulthier Gain <gaulthier.gain@xxxxxxxxx>
  • Delivery-date: Tue, 07 Jul 2020 09:04:50 +0000
  • List-id: Mini-os development list <minios-devel.lists.xenproject.org>
  • Thread-index: AQHWVD2niUaigKlxE0WqUaqlIxUjWQ==
  • Thread-topic: [UNIKRAFT/LIB-MUSL PATCH] math: Provide constants to Unikraft

Hi,

I was trying to compile the maths library from musl when this error occurred:

/root/workspace/unikraft/apps/app/build/libmusl/origin/musl-1.1.19//src/math/cosf.c:21:12:
 error: ‘M_PI_2’ undeclared here (not in a function)
c1pio2 = 1*M_PI_2, /* 0x3FF921FB, 0x54442D18 */
           ^~~~~~

This constant is only provided when one of those definitions are provided, but 
I can simply define them if this is the better approach.

Thanks,

Alex

On 07.07.20, 10:58, "Minios-devel on behalf of Simon Kuenzer" 
<minios-devel-bounces@xxxxxxxxxxxxxxxxxxxx on behalf of 
simon.kuenzer@xxxxxxxxx> wrote:

    Hey Alex,



    which program has an issue with this? Shouldn't it define _XOPEN_SOURCE, 
_GNU_SOURCE, or _BSD_SOURCE in the sources before including <math.h>? I think 
we should not change this libc standard since it may break other programs.

    Thanks,

    Simon

    On 29.06.20, 21:05, "Alexander Jung" <a.jung@xxxxxxxxxxx> wrote:

        This patch modifes the math library to provide Mathematical constants
        such as Pi and e in the header <math.h>.

        Signed-off-by: Alexander Jung <a.jung@xxxxxxxxxxx>
        ---
         .../0008-math-Provide-constants-to-Unikraft.patch  | 29 
++++++++++++++++++++++
         1 file changed, 29 insertions(+)
         create mode 100644 
patches/0008-math-Provide-constants-to-Unikraft.patch

        diff --git a/patches/0008-math-Provide-constants-to-Unikraft.patch 
b/patches/0008-math-Provide-constants-to-Unikraft.patch
        new file mode 100644
        index 0000000..ba7282e
        --- /dev/null
        +++ b/patches/0008-math-Provide-constants-to-Unikraft.patch
        @@ -0,0 +1,29 @@
        +From 4f1964346aad513869a1543868847ade767130e2 Mon Sep 17 00:00:00 2001
        +From: Alexander Jung <alexander.jung@xxxxxxxxx>
        +Date: Mon, 29 Jun 2020 20:51:34 +0200
        +Subject: [PATCH] math: Provide constants to Unikraft
        +
        +This patch modifes the math library to provide Mathematical constants
        +such as Pi and e in the header <math.h>.
        +
        +Signed-off-by: Alexander Jung <alexander.jung@xxxxxxxxx>
        +---
        + include/math.h | 2 +-
        + 1 file changed, 1 insertion(+), 1 deletion(-)
        +
        +diff --git a/include/math.h b/include/math.h
        +index 6ac91da..d95e06d 100644
        +--- a/include/math.h
        ++++ b/include/math.h
        +@@ -354,7 +354,7 @@ long double truncl(long double);
        + #define MAXFLOAT        3.40282346638528859812e+38F
        + #endif
        + 
        +-#if defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || 
defined(_BSD_SOURCE)
        ++#if defined(__Unikraft__)
        + #define M_E             2.7182818284590452354   /* e */
        + #define M_LOG2E         1.4426950408889634074   /* log_2 e */
        + #define M_LOG10E        0.43429448190325182765  /* log_10 e */
        +-- 
        +2.20.1
        +
        -- 
        2.11.0






 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.