Skip to content

Failed to build with musl libc in WSL 1 #512

@CyanoHao

Description

@CyanoHao

In short, with the unexpected floating point control word, the macro NET_SSLEAY_PERL_VERSION is evaluated to a floating point number in Makefile.PL, causing a C preprocessor error.

Build log: build.log
Userland: Gentoo profile default/linux/amd64/23.0/musl
Kernel: 4.4.0-19041-Microsoft (WSL 1, Windows 10 21H2 19044.5371)
Musl version: 1.2.5
GCC version: 14.2.1_p20241221 p7
Perl version: 5.40.0
SSLeay version: 1.940.0

Extra info

  1. Test command: echo 'print $] * 1e6' | perl

    • Musl + WSL 1: 5040000.00000088
    • Glibc or Linux kernel: 5040000

    Investigating into Perl interpreter, I found there's nothing strange about multiply operation, but $] has unexpected value.

  2. Test command: echo 'printf("%.16f\n", $])' | perl

    • Musl + WSL 1: 5.0400000000008732
    • Glibc or Linux kernel: 5.0400000000000000

    It seems the version number has been broken when compiling Perl interpreter.

  3. Test program:

    #include <stdio.h>
    int main()
    {
      const char *s = "5.040000";
      double v;
      sscanf(s, "%lf", &v);
      printf("%.16f\n", v);
    }
    • Musl + WSL 1: 5.0400000000008732
    • Glibc or Linux kernel: 5.0400000000000000

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions