From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) by sourceware.org (Postfix) with ESMTP id E6D8F3858D20 for ; Fri, 4 Feb 2022 05:45:22 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org E6D8F3858D20 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gentoo.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gentoo.org Received: by smtp.gentoo.org (Postfix, from userid 559) id 63C8F342E60; Fri, 4 Feb 2022 05:45:22 +0000 (UTC) Date: Fri, 4 Feb 2022 00:45:22 -0500 From: Mike Frysinger To: Jeff Law Cc: newlib@sourceware.org Subject: Re: libgloss multilib installs broken [was nds broken by recent patches] Message-ID: Mail-Followup-To: Jeff Law , newlib@sourceware.org References: <171dc9cb-6b2c-ead3-1c55-27fadb33220f@gmail.com> <3da42247-9096-0a03-4b38-66460854c2c7@gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="ogH1gTQFuxCcr60E" Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-4.0 required=5.0 tests=BAYES_00, BODY_8BITS, KAM_DMARC_STATUS, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_PASS, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: newlib@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Newlib mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Feb 2022 05:45:24 -0000 --ogH1gTQFuxCcr60E Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 03 Feb 2022 09:11, Jeff Law wrote: > I must have tested the wrong thing as bfin-elf isn't working yet.=C2=A0 I= t=20 > doesn't help that I'm only looking at this for a few minutes before my=20 > workday starts...=C2=A0=C2=A0=C2=A0 At least now I=C2=A0 know what's goin= g on. >=20 > The *build* is fine, things go south at *install* time. >=20 > bfin has a wide variety of multilibs and we're installing them into the= =20 > wrong directories. well that's annoying. i was actually testing this code path recently as pa= rt of migrating libgloss to automake, and the install logic worked there, so i guess i fixed this bug and didn't realize it. > So I'm sitting in my build directory... >=20 > > [jlaw@dl360p newlib]$ find . -name libsim.a > > ./bfin-elf/libgloss/bfin/libsim.a > > ./bfin-elf/bf532-none/libgloss/bfin/libsim.a > > ./bfin-elf/bf532-none/mid-shared-library/libgloss/bfin/libsim.a > > ./bfin-elf/bf532-none/mid-shared-library/mleaf-id-shared-library/libglo= ss/bfin/libsim.a > > ./bfin-elf/bf532-none/msep-data/libgloss/bfin/libsim.a > > ./bfin-elf/bf532-none/mfdpic/libgloss/bfin/libsim.a > > ./bfin-elf/mid-shared-library/libgloss/bfin/libsim.a > > ./bfin-elf/mid-shared-library/mleaf-id-shared-library/libgloss/bfin/lib= sim.a > > ./bfin-elf/msep-data/libgloss/bfin/libsim.a > > ./bfin-elf/mfdpic/libgloss/bfin/libsim.a >=20 > As expected.=C2=A0 Now if I go into my install directory: >=20 > > find . -name libsim.a > > ./bfin-elf/lib/libsim.a >=20 > Egad.=C2=A0 It looks like they all got installed on top of each other in = the=20 > wrong directory, effectively ignoring the multilib subdirectories.=C2=A0 = A=20 > checksum quickly shows the version in the install directory is actually= =20 > this one from the build directory: > > ./bfin-elf/bf532-none/mid-shared-library/mleaf-id-shared-library/libglo= ss/bfin/libsim.a >=20 >=20 > If I go look at the Makefile in the terminal directory it has this: >=20 >=20 > > # Multilib support variables. > > # TOP is used instead of MULTI{BUILD,SRC}TOP. > > MULTIDIRS =3D > > MULTISUBDIR =3D > [ ... ] >=20 > > install-sim: > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ${mkinstalldirs} ${DESTDIR}$= {tooldir}/lib${MULTISUBDIR} > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 for x in ${SIM_CRT0} ${SIM_B= SP} ${SIM_SCRIPTS}; do \ > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ${INSTALL_DATA} $$x=20 > > $(DESTDIR)${tooldir}/lib${MULTISUBDIR}/$$x || exit $$?; \ > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 done >=20 > So, yea, no surprise that it installed into the wrong directory. I think= =20 > this is the culprit patch: >=20 > > commit 754f8def0dfeeb43afa5a96ad1971fd0ef02c419 > > Author: Mike Frysinger > > Date:=C2=A0=C2=A0 Sun Jan 23 01:10:33 2022 -0500 > > > > =C2=A0=C2=A0=C2=A0 libgloss: merge stub arch configure scripts up a lev= el > > > > =C2=A0=C2=A0=C2=A0 For about half the ports, we don't need a subdir con= figure script. > > =C2=A0=C2=A0=C2=A0 They're using the config/default.m[ht] rules, and th= ey aren't doing > > =C2=A0=C2=A0=C2=A0 any unique configure tests, so they exist just to pa= ss top-level > > =C2=A0=C2=A0=C2=A0 settings down to create the arch Makefile.=C2=A0 We = can just as easily > > =C2=A0=C2=A0=C2=A0 do that from the top-level Mkaefile directly and ski= p configure. > > > > =C2=A0=C2=A0=C2=A0 Most of the remaining configure scripts could be mig= rated up to > > =C2=A0=C2=A0=C2=A0 the top-level too, but that would require care in ea= ch subdir. > > =C2=A0=C2=A0=C2=A0 So let's be lazy and put that off to another day. yeah, the config-ml.in logic only rewrites the MULTI* settings in the Makef= ile that lives alongside the configure script. when i removed those stub scrip= ts, it lost that rewrite logic since they were no longer the main Makefile. it= 's a bit easy to make work, albeit slightly hacky. on the flip side, the code= is not needed when using non-recursive automake :). afaict, this is only needed for libgloss because the MULTISUBDIR setting is used only when installing things. newlib doesn't install files directly out of its subdirs ... only out of the top libc/libm dirs. but i'll update my local build & test logic to compare the full install tree to be sure. thanks for tracking this down -mike --ogH1gTQFuxCcr60E Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEuQK1JxMl+JKsJRrUQWM7n+g39YEFAmH8vXIACgkQQWM7n+g3 9YHzSxAAr5jgyINrf5e9AG62h0XvSGmulGoW8uyPUUmjMRCKsUEITbasvik85PJX uadJC29xYU+1D9VMuPd3GkSb6L+peOE5wLMy1OORQOj4B4ladC3Kk1ek38dHUVwi CTNl7UPudPqxPPUrzGwf/er2AL70R/LulQYsUR+dUwaUrvEPaIdmCpAla2WbM/y/ S0nqoMDdE4XD+RtlrNmBoQZqgVrFJ9ZwmBadMSyQTr5WgzyixEmNpoNh7NT9cbrd nP/Mn1v0McoXlQ6e1cpRqFcoP1PAgENMV23KBnIE5c/dZ5G+eUd+KcRMX+flP7YY K7cHveFearghjSlJK29duMNfWbC7S2dAV4yrnvYIyi8A0fqaS+FbAmupOVdgv5ZK DR1wkO4Atai1c3f1R6P0cLyimy8M/d8gOBZ3H0PH7KW6Q+Qbm47MVTTw19HWiXKF rQgb3QUSf0l06EX+c0yxZwjNodwT8yGj1U6SyF8BcA65dRTeOmmOh8B8n7naluZ+ XtxEgswmLkGZ6UHTLAhTvOUUZfBxhO6pFWxcJ1A26LvfxFtK3S8f7grSgfF62saU quBhP5hPZPY+0yp77aGMg0bK4268/jwwpRDt7EJS75X+ULZqYhyfDE/dXzY+NEyR c6Pz7qI+/598UmpyxxtfrZe8f63/NJIDi083EaH9Zbv0KMlpxpw= =6xwa -----END PGP SIGNATURE----- --ogH1gTQFuxCcr60E--