From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H2 autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 20788 invoked from network); 13 Feb 2023 14:13:01 -0000 Received: from second.openwall.net (193.110.157.125) by inbox.vuxu.org with ESMTPUTF8; 13 Feb 2023 14:13:01 -0000 Received: (qmail 1744 invoked by uid 550); 13 Feb 2023 14:12:57 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Reply-To: musl@lists.openwall.com Received: (qmail 1712 invoked from network); 13 Feb 2023 14:12:57 -0000 MIME-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ayaya.dev; s=key1; t=1676297565; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=F1qVK0jwdSZVIcypNong/c8ad40W11jJKJZb+La7lLs=; b=uD2yotdI0Owri3YD8VDKmQQ0F6JdqkPT1iqwoxhESSpU46VRiyfFfLeZUUtUolWYqp67Ch NfpD4g+0E6E2arLl4/TRlH+I5zQpJ66w2+DstfkTPAtk16xC9ZpTJWKJiWgVqq68+dIImt 4Ber0dgcaZ4DmBJIPsu0ffffvLVYF6k= Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Mon, 13 Feb 2023 15:12:38 +0100 Message-Id: X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: "alice" To: References: <13336ea0.2103f.1864ab522cc.Coremail.huajingyun@loongson.cn> In-Reply-To: <13336ea0.2103f.1864ab522cc.Coremail.huajingyun@loongson.cn> X-Migadu-Flow: FLOW_OUT Subject: Re: [musl] Compile gcc-12 with musl and report errors On Mon Feb 13, 2023 at 1:17 PM CET, =E8=8A=B1=E9=9D=99=E4=BA=91 wrote: > Hi=EF=BC=9A > 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= =EF=BC=9A > =E2=80=8B/usr/lib/gcc/x86_64-alpine-linux-musl/12.2.1/../../../../x86_64-= alpine-linux-musl/bin/ld: d/common-outbuffer.o: in function `_D3dmd6common4= file__T11FileMappingThZQq6__ctorMFNbNcxPaZSQCdQCcQBy__TQBwThZQCc': > outbuffer.d:(.text+0x29f): undefined reference to `mmap64' > =20 > I uploaded more detailed logs to gcc_ build_ Error.log file=EF=BC=8Cand o= ther information is as follows=EF=BC=9A > 1=E3=80=81linux-lts=EF=BC=88kernel=EF=BC=89version=EF=BC=9A6.1.10-r0 > 2=E3=80=81gcc version=EF=BC=9A12.2.1_git20220924-r9 > 3=E3=80=81binutils version=EF=BC=9Abinutils-2.40-r4 > 4=E3=80=81musl=EF=BC=9Amaster branch and commit is f47a8cdd250d9163fcfb39= bf4e9d813957c0b187 > > I suspect that the error is caused by the difference of the musl code=EF= =BC=8CWhen > I checked musl source, I found that there was a big difference between th= e > master branch code and the v1.2.3 version code. For example, a large numb= er of > weaks_alias were removed during the 246f1c811448f37a44b41cd8df8d0ef9736d9= 5f4 > commit=EF=BC=8Cinclude =E2=80=9Cweak_alias(mmap, mmap64);=E2=80=9D 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 `mm= ap` and use -D_FILE_OFFSET_BITS=3D64 (for C) . so, gcc (the D frontend here) ne= eds fixing. specifically, it's libphobos/libdruntime/core/sys/posix/sys/mman.d , where: else version (CRuntime_Musl) { static if (__USE_LARGEFILE64) void* mmap64(void*, size_t, int, int, in= t, off_t); static if (__USE_FILE_OFFSET64) alias mmap =3D mmap64; else 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 co= de 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 appl= y > 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 commu= nity > experts. > > I'm Looking forward to your reply,thanks. > > Jingyun Hua > > > > > =E6=9C=AC=E9=82=AE=E4=BB=B6=E5=8F=8A=E5=85=B6=E9=99=84=E4=BB=B6=E5=90=AB= =E6=9C=89=E9=BE=99=E8=8A=AF=E4=B8=AD=E7=A7=91=E7=9A=84=E5=95=86=E4=B8=9A=E7= =A7=98=E5=AF=86=E4=BF=A1=E6=81=AF=EF=BC=8C=E4=BB=85=E9=99=90=E4=BA=8E=E5=8F= =91=E9=80=81=E7=BB=99=E4=B8=8A=E9=9D=A2=E5=9C=B0=E5=9D=80=E4=B8=AD=E5=88=97= =E5=87=BA=E7=9A=84=E4=B8=AA=E4=BA=BA=E6=88=96=E7=BE=A4=E7=BB=84=E3=80=82=E7= =A6=81=E6=AD=A2=E4=BB=BB=E4=BD=95=E5=85=B6=E4=BB=96=E4=BA=BA=E4=BB=A5=E4=BB= =BB=E4=BD=95=E5=BD=A2=E5=BC=8F=E4=BD=BF=E7=94=A8=EF=BC=88=E5=8C=85=E6=8B=AC= =E4=BD=86=E4=B8=8D=E9=99=90=E4=BA=8E=E5=85=A8=E9=83=A8=E6=88=96=E9=83=A8=E5= =88=86=E5=9C=B0=E6=B3=84=E9=9C=B2=E3=80=81=E5=A4=8D=E5=88=B6=E6=88=96=E6=95= =A3=E5=8F=91=EF=BC=89=E6=9C=AC=E9=82=AE=E4=BB=B6=E5=8F=8A=E5=85=B6=E9=99=84= =E4=BB=B6=E4=B8=AD=E7=9A=84=E4=BF=A1=E6=81=AF=E3=80=82=E5=A6=82=E6=9E=9C=E6= =82=A8=E9=94=99=E6=94=B6=E6=9C=AC=E9=82=AE=E4=BB=B6=EF=BC=8C=E8=AF=B7=E6=82= =A8=E7=AB=8B=E5=8D=B3=E7=94=B5=E8=AF=9D=E6=88=96=E9=82=AE=E4=BB=B6=E9=80=9A= =E7=9F=A5=E5=8F=91=E4=BB=B6=E4=BA=BA=E5=B9=B6=E5=88=A0=E9=99=A4=E6=9C=AC=E9= =82=AE=E4=BB=B6=E3=80=82=20 > This email and its attachments contain confidential information from Loon= gson Technology , which is intended only for the person or entity whose add= ress is listed above. Any use of the information contained herein in any wa= y (including, but not limited to, total or partial disclosure, reproduction= or dissemination) by persons other than the intended recipient(s) is prohi= bited. If you receive this email in error, please notify the sender by phon= e or email immediately and delete it.=20