mailing list of musl libc
 help / color / mirror / code / Atom feed
From: "alice" <>
To: <>
Subject: Re: [musl] Compile gcc-12 with musl and report errors
Date: Mon, 13 Feb 2023 15:12:38 +0100	[thread overview]
Message-ID: <CQHHW3CQV73Z.2DWR5AVWJXF9L@sumire> (raw)
In-Reply-To: <>

On Mon Feb 13, 2023 at 1:17 PM CET, 花静云 wrote:
> Hi:
> I installed the Alpine Linux system on the x86_64 platform, and exposed a
> problem when compiling gcc 12 using musl (master branch) in this system:
> ​/usr/lib/gcc/x86_64-alpine-linux-musl/12.2.1/../../../../x86_64-alpine-linux-musl/bin/ld: d/common-outbuffer.o: in function `_D3dmd6common4file__T11FileMappingThZQq6__ctorMFNbNcxPaZSQCdQCcQBy__TQBwThZQCc':
> outbuffer.d:(.text+0x29f): undefined reference to `mmap64'
> I uploaded more detailed logs to gcc_ build_ Error.log file,and other information is as follows:
> 1、linux-lts(kernel)version:6.1.10-r0
> 2、gcc version:12.2.1_git20220924-r9
> 3、binutils version:binutils-2.40-r4
> 4、musl:master branch and commit is f47a8cdd250d9163fcfb39bf4e9d813957c0b187
> I suspect that the error is caused by the difference of the musl code,When
> I checked musl source, I found that there was a big difference between the
> master branch code and the v1.2.3 version code. For example, a large number of
> weaks_alias were removed during the 246f1c811448f37a44b41cd8df8d0ef9736d95f4
> commit,include “weak_alias(mmap, mmap64);” in src/mman/mmap.c.

yes, as that commit says, this was intentional. code is _not_ meant to call
these *64 functions that were removed- code should unconditionally call `mmap`
and use -D_FILE_OFFSET_BITS=64 (for C) . so, gcc (the D frontend here) needs fixing.

specifically, it's libphobos/libdruntime/core/sys/posix/sys/mman.d ,


 else version (CRuntime_Musl)
     static if (__USE_LARGEFILE64) void* mmap64(void*, size_t, int, int, int, off_t);
     static if (__USE_FILE_OFFSET64)
         alias mmap = mmap64;
         void* mmap(void*, size_t, int, int, int, off_t);
     int munmap(void*, size_t);

probably does something like expose the mmap64 symbol (no idea what this code means).
maybe __USE_LARGEFILE64 has to be unset for it?

> I want to compile gcc 12 based on musl (master branch). and I try to apply
> the old code to the latest branch, but this seems to be not a wise choice.
> so I share this error and look forward to some suggestions from the community
> experts.
> I'm Looking forward to your reply,thanks.
> Jingyun Hua
> 本邮件及其附件含有龙芯中科的商业秘密信息,仅限于发送给上面地址中列出的个人或群组。禁止任何其他人以任何形式使用(包括但不限于全部或部分地泄露、复制或散发)本邮件及其附件中的信息。如果您错收本邮件,请您立即电话或邮件通知发件人并删除本邮件。 
> This email and its attachments contain confidential information from Loongson Technology , which is intended only for the person or entity whose address is listed above. Any use of the information contained herein in any way (including, but not limited to, total or partial disclosure, reproduction or dissemination) by persons other than the intended recipient(s) is prohibited. If you receive this email in error, please notify the sender by phone or email immediately and delete it. 

  reply	other threads:[~2023-02-13 14:13 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-13 12:17 花静云
2023-02-13 14:12 ` alice [this message]
2023-02-13 14:17   ` David Wang
2023-02-13 14:26     ` Rich Felker
2023-02-13 14:23   ` Rich Felker

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CQHHW3CQV73Z.2DWR5AVWJXF9L@sumire \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).