[PATCH v2] newlib: libc: merge build up a directory

Corinna Vinschen vinschen@redhat.com
Wed Mar 16 07:24:58 GMT 2022


On Mar 14 23:15, Mike Frysinger wrote:
> On 14 Mar 2022 23:04, Mike Frysinger wrote:
> > Convert all the libc/ subdir makes into the top-level Makefile.  This
> > allows us to build all of libc from the top Makefile without using any
> > recursive make calls.  This is faster and avoids the funky lib.a logic
> > where we unpack subdir archives to repack into a single libc.a.  The
> > machine override logic is maintained though by way of Makefile include
> > ordering, and source file accumulation in libc_a_SOURCES.
> > 
> > There's a few dummy.c files that are no longer necessary since we aren't
> > doing the lib.a accumulating, so punt them.
> > ---
> > v2
> > - fix some bad paths & compiler settings & missing \ in stdio subdirs
> 
> i also pushed this to topic/vapier-libc if you want to fetch that to test.
> 
> i checked against these targets:
> aarch64-elf arc-elf arm-eabi
> bfin-elf
> cr16-elf cris-elf csky-elf
> epiphany-elf
> frv-elf
> h8300-elf
> i386-elf i686-pc-cygwin iq2000-elf
> lm32-elf
> m68k-elf microblaze-elf mips-elf mn10300-elf moxie-elf
> nds32le-elf
> or1k-elf
> powerpc-elf
> sparc-elf sparc-rtems
> v850e-elf visium-elf
> x86_64-pc-cygwin xstormy16-elf
> 
> i checked the newlib object lists to make sure they matched and the
> disassembly was the same between them.  there were some changes, but
> they were expected: no longer including dummy.o, and for some ports,
> using libc_a- prefix on the objects.
> 
> cygwin newlib works, but winsup breaks because it has a direct
> reference on an internal lib.a file that no longer exists:
> libssp.a: $(LIB_NAME) $(newlib_build)/libc/ssp/lib.a
> 	$(AM_V_GEN)$(speclib) $^ $(@F)
> 
> i could fix it like so:
> 
> --- a/winsup/cygwin/Makefile.am
> +++ b/winsup/cygwin/Makefile.am
> @@ -719,7 +719,7 @@
>  libacl.a: $(LIB_NAME) sec_posixacl.o
>  	$(AM_V_GEN)$(speclib) $^ $(@F)
>  
> -libssp.a: $(LIB_NAME) $(newlib_build)/libc/ssp/lib.a
> +libssp.a: $(LIB_NAME) $(wildcard $(newlib_build)/libc/ssp/*.o)
>  	$(AM_V_GEN)$(speclib) $^ $(@F)
>  
>  #
> 
> not sure what the preference is here.
> -mike

LGTM.  Just merge the above patch into yours and push it as one.


Thanks,
Corinna



More information about the Newlib mailing list