From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id CFE813858402; Mon, 17 Jan 2022 01:02:30 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org CFE813858402 From: "unlvsur at live dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug bootstrap/104057] cross compiler multilibs libs path too chaos Date: Mon, 17 Jan 2022 01:02:30 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: bootstrap X-Bugzilla-Version: 12.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: unlvsur at live dot com X-Bugzilla-Status: WAITING X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Jan 2022 01:02:30 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D104057 --- Comment #2 from cqwrteur --- (In reply to Andrew Pinski from comment #1) > Can you give an example? > There are two different directories where multilib is there. > One is based on the multilib name and the other is the OS multi-lib > directory name. >=20 > the one that matters to GCC depends on the context of the directory. > For an example ${prefix}/lib and ${prefix}/lib64 are OS directory names. > While things under ${prefix}/lib/gcc/${triplet}/${version}/ are the > multi-lib path. >=20 > Are you using --with-sysroot to use the normal OS directory structure? Example 1: target=3Dx86_64-ubuntu-linux-gnu Let's assume prefix is $HOME/cross/x86_64-ubuntu-linux-gnu When build GCC, GCC would find libs in $HOME/cross/x86_64-ubuntu-linux-gnu/x86_64-ubuntu-linux-gnu/lib for all tar= gets $HOME/cross/x86_64-ubuntu-linux-gnu/x86_64-ubuntu-linux-gnu/lib/64 for 64 b= it target $HOME/cross/x86_64-ubuntu-linux-gnu/x86_64-ubuntu-linux-gnu/lib/x32 for x32 target. However, after building gcc, GCC would find libs in $HOME/cross/x86_64-ubuntu-linux-gnu/x86_64-ubuntu-linux-gnu/lib for all tar= gets $HOME/cross/x86_64-ubuntu-linux-gnu/x86_64-ubuntu-linux-gnu/lib64 for 64 bit targets $HOME/cross/x86_64-ubuntu-linux-gnu/x86_64-ubuntu-linux-gnu/libx32 for x32 = bit targets Example 2: target=3Dx86_64-w64-mingw32 Let's assume prefix is $HOME/cross/x86_64-w64-mingw32 When build GCC, GCC would find libs in $HOME/cross/x86_64-w64-mingw32/x86_64-w64-mingw32/lib for all targets $HOME/cross/x86_64-w64-mingw32/x86_64-w64-mingw32/lib/32 for 32 bit target However, after building gcc, GCC would find libs in $HOME/cross/x86_64-w64-mingw32/x86_64-w64-mingw32/lib for all targets $HOME/cross/x86_64-w64-mingw32/x86_64-w64-mingw32/lib32 for 32 bit targets=